Переглянути джерело

fix: when publishing display page properties before class ones

Emphasis should be on the few page properties when reading about a page.
This was the behavior before properties got moved to configure modal
Gabriel Horner 2 роки тому
батько
коміт
1fb9d35e0d
1 змінених файлів з 41 додано та 20 видалено
  1. 41 20
      src/main/frontend/components/page.cljs

+ 41 - 20
src/main/frontend/components/page.cljs

@@ -580,26 +580,47 @@
                                               page
                                               (str edit-input-id-prefix "-page")
                                               (assoc configure-opts :class-schema? false))])
-         [:div.flex.flex-col.gap-4
-          (when has-class-properties?
-            [:div
-             (when has-viewable-properties?
-               [:div.mb-1.opacity-70.font-medium.text-sm "Class properties:"])
-             (component-block/db-properties-cp {:editor-box editor/box}
-                                               page
-                                               (str edit-input-id-prefix "-schema")
-                                               (assoc configure-opts :class-schema? true))])
-
-          (when has-viewable-properties?
-            [:div
-             (when has-class-properties?
-               [:div.mb-1.opacity-70.font-medium.text-sm "Page properties:"])
-             (component-block/db-properties-cp {:editor-box editor/box}
-                                              page
-                                              (str edit-input-id-prefix "-page")
-                                              {:selected? false
-                                               :page-configure? false
-                                               :class-schema? false})])])])))
+         (if config/publishing?
+           [:div.flex.flex-col.gap-4
+            (when has-viewable-properties?
+              [:div
+               (when has-class-properties?
+                 [:div.mb-1.opacity-70.font-medium.text-sm "Page properties:"])
+               (component-block/db-properties-cp {:editor-box editor/box}
+                                                 page
+                                                 (str edit-input-id-prefix "-page")
+                                                 {:selected? false
+                                                  :page-configure? false
+                                                  :class-schema? false})])
+            (when has-class-properties?
+              [:div
+               (when has-viewable-properties?
+                 [:div.mb-1.opacity-70.font-medium.text-sm "Class properties:"])
+               (component-block/db-properties-cp {:editor-box editor/box}
+                                                 page
+                                                 (str edit-input-id-prefix "-schema")
+                                                 (assoc configure-opts :class-schema? true))])]
+
+           [:div.flex.flex-col.gap-4
+            (when has-class-properties?
+              [:div
+               (when has-viewable-properties?
+                 [:div.mb-1.opacity-70.font-medium.text-sm "Class properties:"])
+               (component-block/db-properties-cp {:editor-box editor/box}
+                                                 page
+                                                 (str edit-input-id-prefix "-schema")
+                                                 (assoc configure-opts :class-schema? true))])
+
+            (when has-viewable-properties?
+              [:div
+               (when has-class-properties?
+                 [:div.mb-1.opacity-70.font-medium.text-sm "Page properties:"])
+               (component-block/db-properties-cp {:editor-box editor/box}
+                                                 page
+                                                 (str edit-input-id-prefix "-page")
+                                                 {:selected? false
+                                                  :page-configure? false
+                                                  :class-schema? false})])]))])))
 
 (rum/defc page-properties-react < rum/reactive
   [page* page-opts]