Browse Source

fix: other closed values should have :db/ident

Without db/ident, these values could be deleted easily
which would cause users to lose functionality
Gabriel Horner 1 năm trước cách đây
mục cha
commit
6e7c410427

+ 9 - 3
deps/db/src/logseq/db/frontend/property.cljs

@@ -106,7 +106,9 @@
    :logseq.color {:schema
                   {:type :default :hide? true}
                   :closed-values
-                  (mapv #(hash-map :value % :uuid (random-uuid))
+                  (mapv #(hash-map :db-ident (keyword "logseq.color" %)
+                                   :value %
+                                   :uuid (random-uuid))
                         ;; Stringified version of frontend.colors/COLORS. Too basic to couple
                         ["tomato" "red" "crimson" "pink" "plum" "purple" "violet" "indigo" "blue" "cyan" "teal" "green" "grass" "orange" "brown"])
                   :visible true}
@@ -118,13 +120,17 @@
    :logseq.table.headers {:schema
                           {:type :default :hide? true}
                           :closed-values
-                          (mapv #(hash-map :value % :uuid (random-uuid))
+                          (mapv #(hash-map :db-ident (keyword "logseq.table.headers" %)
+                                           :value %
+                                           :uuid (random-uuid))
                                 ["uppercase" "capitalize" "capitalize-first" "lowercase"])
                           :visible true}
    :logseq.table.hover {:schema
                         {:type :default :hide? true}
                         :closed-values
-                        (mapv #(hash-map :value % :uuid (random-uuid))
+                        (mapv #(hash-map :db-ident (keyword "logseq.table.hover" %)
+                                         :value %
+                                         :uuid (random-uuid))
                               ["row" "col" "both" "none"])
                         :visible true}
    :logseq.table.borders {:schema {:type :checkbox :hide? true}

+ 1 - 1
deps/shui/src/logseq/shui/table/v2.cljs

@@ -449,7 +449,7 @@
                                      :table-underflow? table-underflow?
                                      :cell-col-map cell-col-map)]
     ; (js/console.log "shui table opts context" (clj->js context)) 
-    (js/console.log "shui table opts" (clj->js table-opts)) 
+    ;; (js/console.log "shui table opts" (clj->js table-opts))
     ; (js/console.log "shui table opts" (pr-str table-opts)) 
     ;; Scrollable Container: if the table is larger than the container, manage the scrolling effects here
     (table-scrollable-overflow handle-root-width-change