Sfoglia il codice sorgente

Fix: property fields showing up as editable for publishing

Gabriel Horner 1 anno fa
parent
commit
e660e1e2ae
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      src/main/frontend/components/property.cljs

+ 3 - 1
src/main/frontend/components/property.cljs

@@ -316,7 +316,8 @@
                [:label.col-span-1 "UI position:"]
                [:label.col-span-1 "UI position:"]
                [:div.col-span-2
                [:div.col-span-2
                 (shui/select
                 (shui/select
-                 (cond-> {:on-value-change (fn [v]
+                 (cond-> {:disabled config/publishing?
+                          :on-value-change (fn [v]
                                              (swap! *property-schema assoc :position v)
                                              (swap! *property-schema assoc :position v)
                                              (save-property-fn))}
                                              (save-property-fn))}
                    (string? position)
                    (string? position)
@@ -336,6 +337,7 @@
              [:label "Hide by default:"]
              [:label "Hide by default:"]
              (shui/checkbox
              (shui/checkbox
               {:checked           hide?
               {:checked           hide?
+               :disabled          config/publishing?
                :on-checked-change (fn []
                :on-checked-change (fn []
                                     (swap! *property-schema assoc :hide? (not hide?))
                                     (swap! *property-schema assoc :hide? (not hide?))
                                     (save-property-fn))})])
                                     (save-property-fn))})])