fix: query table column selection

also fix lint in related ns
feat/db-inferred-properties
Gabriel Horner 2023-08-22 16:13:16 -04:00
parent 2327fa3103
commit 6ad560e4cb
5 changed files with 11 additions and 9 deletions

View File

@ -185,6 +185,7 @@
:background-color {:schema {:type :default}}
:heading {:schema {:type :any}} ; number (1-6) or boolean for auto heading
:query-table {:schema {:type :checkbox}}
;; query-properties is a coll of property uuids and keywords where keywords are special frontend properties
:query-properties {:schema {:type :coll}}
:query-sort-by {:schema {:type :checkbox}}
:query-sort-desc {:schema {:type :checkbox}}

View File

@ -112,7 +112,8 @@
(let [properties (:block/properties current-block)
query-properties (pu/lookup properties :query-properties)
query-properties (if (config/db-based-graph? (state/get-current-repo))
query-properties
;; TODO: Remove this when :query-properties can be saved as a vector
(vec query-properties)
(some-> query-properties
(common-handler/safe-read-string "Parsing query properties failed")))
query-properties (if page? (remove #{:block} query-properties) query-properties)

View File

@ -814,7 +814,8 @@
repo (state/get-current-repo)
db-based? (config/db-based-graph? repo)
query-properties (if db-based?
query-properties
;; TODO: Remove this when :query-properties can be saved as a vector
(vec query-properties)
(some-> query-properties
(common-handler/safe-read-string "Parsing query properties failed")))
query-properties (if (seq query-properties)

View File

@ -328,8 +328,10 @@
(defmethod handle :modal/set-query-properties [[_ block all-properties]]
(let [properties (:block/properties block)
query-properties (pu/lookup properties :query-properties)
block-properties (some-> query-properties
(common-handler/safe-read-string "Parsing query properties failed"))
block-properties (if (config/db-based-graph? (state/get-current-repo))
query-properties
(some-> query-properties
(common-handler/safe-read-string "Parsing query properties failed")))
shown-properties (if (seq block-properties)
(set block-properties)
(set all-properties))

View File

@ -4,8 +4,7 @@
[frontend.handler.file-based.property :as file-property]
[frontend.config :as config]
[frontend.state :as state]
[frontend.db :as db]
[frontend.modules.outliner.core :as outliner-core]))
[frontend.db :as db]))
(def user-face-builtin-schema-types db-property/user-face-builtin-schema-types)
(def internal-builtin-schema-types db-property/internal-builtin-schema-types)
@ -27,15 +26,13 @@
(defn update-property!
[repo property-uuid opts]
{:pre [(uuid? property-uuid)]}
#_:clj-kondo/ignore
(when (config/db-based-graph? repo)
(db-property/update-property! repo property-uuid opts)))
(defn delete-property-value!
"Delete value if a property has multiple values"
[repo block property-id property-value]
#_:clj-kondo/ignore
(if (config/db-based-graph? repo)
(when (config/db-based-graph? repo)
(db-property/delete-property-value! repo block property-id property-value)))
(defn set-editing-new-property!