From 96da22e1439710c6da47db0d1b3600cd5e9e2e3c Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Mon, 18 Sep 2023 11:37:36 -0400 Subject: [PATCH] fix: unable to add class page properties able to add now and simpler to reason about how page properties are displayed --- src/main/frontend/components/page.cljs | 32 ++++---------------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/src/main/frontend/components/page.cljs b/src/main/frontend/components/page.cljs index 8301497799..42ffd048b9 100644 --- a/src/main/frontend/components/page.cljs +++ b/src/main/frontend/components/page.cljs @@ -438,14 +438,10 @@ (rum/defcs configure < rum/reactive (rum/local false ::parent-changed?) - [state page {:keys [journal? show-properties?] :as opts - :or {show-properties? true}}] + [state page {:keys [journal?]}] (let [page-id (:db/id page) page (when page-id (db/sub-block page-id)) type (:block/type page) - properties-opts (merge {:selected? false - :page-configure? true} - opts) class? (= type "class") parent-changed? (::parent-changed? state)] (when page @@ -510,16 +506,7 @@ [:a {:on-click #(route-handler/redirect-to-page! class-name)} class-name])) class-ancestors)))]]) (when (and config/publishing? (= type "property")) - (property/property-config (state/get-current-repo) page {})) - (when (and (not show-properties?) (not config/publishing?)) - (let [edit-input-id (str "edit-block-" (:block/uuid page))] - [:div - [:div.text-sm.opacity-70.font-medium.mb-2 (if class? "Class Properties:" "Properties:")] - (component-block/db-properties-cp - {:editor-box editor/box} - page - edit-input-id - (assoc properties-opts :class-schema? class?))]))]))) + (property/property-config (state/get-current-repo) page {}))]))) (rum/defc page-properties < rum/reactive [page *configure-show?] @@ -602,14 +589,7 @@ *all-collapsed? (::all-collapsed? state) *current-block-page (::current-page state) block-or-whiteboard? (or block? whiteboard?) - home? (= :home (state/get-current-route)) - show-properties? (and - (config/db-based-graph? repo) - (not block?) - (not whiteboard?) - (or (seq (:block/properties page)) - (seq (:block/alias page)) - (seq (:block/tags page))))] + home? (= :home (state/get-current-route))] [:div.flex-1.page.relative (merge (if (seq (:block/tags page)) (let [page-names (model/get-page-names-by-ids (map :db/id (:block/tags page)))] @@ -649,8 +629,7 @@ (do (state/set-modal! #(property/property-config repo page {})) (swap! *configure-show? not)) - (configure page {:journal? journal? - :show-properties? show-properties?}))) + (configure page {:journal? journal?}))) [:div (when (and block? (not sidebar?) (not whiteboard?)) @@ -659,8 +638,7 @@ [:div.mb-4 (component-block/breadcrumb config repo block-id {:level-limit 3})])) - (when show-properties? - (page-properties page *configure-show?)) + (page-properties page *configure-show?) ;; blocks (let [_ (and block? page (reset! *current-block-page (:block/name (:block/page page))))