mirror of https://github.com/logseq/logseq
fix: query table column selection
also fix lint in related nsfeat/db-inferred-properties
parent
2327fa3103
commit
6ad560e4cb
|
@ -185,6 +185,7 @@
|
||||||
:background-color {:schema {:type :default}}
|
:background-color {:schema {:type :default}}
|
||||||
:heading {:schema {:type :any}} ; number (1-6) or boolean for auto heading
|
:heading {:schema {:type :any}} ; number (1-6) or boolean for auto heading
|
||||||
:query-table {:schema {:type :checkbox}}
|
: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-properties {:schema {:type :coll}}
|
||||||
:query-sort-by {:schema {:type :checkbox}}
|
:query-sort-by {:schema {:type :checkbox}}
|
||||||
:query-sort-desc {:schema {:type :checkbox}}
|
:query-sort-desc {:schema {:type :checkbox}}
|
||||||
|
|
|
@ -112,7 +112,8 @@
|
||||||
(let [properties (:block/properties current-block)
|
(let [properties (:block/properties current-block)
|
||||||
query-properties (pu/lookup properties :query-properties)
|
query-properties (pu/lookup properties :query-properties)
|
||||||
query-properties (if (config/db-based-graph? (state/get-current-repo))
|
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
|
(some-> query-properties
|
||||||
(common-handler/safe-read-string "Parsing query properties failed")))
|
(common-handler/safe-read-string "Parsing query properties failed")))
|
||||||
query-properties (if page? (remove #{:block} query-properties) query-properties)
|
query-properties (if page? (remove #{:block} query-properties) query-properties)
|
||||||
|
|
|
@ -814,7 +814,8 @@
|
||||||
repo (state/get-current-repo)
|
repo (state/get-current-repo)
|
||||||
db-based? (config/db-based-graph? repo)
|
db-based? (config/db-based-graph? repo)
|
||||||
query-properties (if db-based?
|
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
|
(some-> query-properties
|
||||||
(common-handler/safe-read-string "Parsing query properties failed")))
|
(common-handler/safe-read-string "Parsing query properties failed")))
|
||||||
query-properties (if (seq query-properties)
|
query-properties (if (seq query-properties)
|
||||||
|
|
|
@ -328,8 +328,10 @@
|
||||||
(defmethod handle :modal/set-query-properties [[_ block all-properties]]
|
(defmethod handle :modal/set-query-properties [[_ block all-properties]]
|
||||||
(let [properties (:block/properties block)
|
(let [properties (:block/properties block)
|
||||||
query-properties (pu/lookup properties :query-properties)
|
query-properties (pu/lookup properties :query-properties)
|
||||||
block-properties (some-> query-properties
|
block-properties (if (config/db-based-graph? (state/get-current-repo))
|
||||||
(common-handler/safe-read-string "Parsing query properties failed"))
|
query-properties
|
||||||
|
(some-> query-properties
|
||||||
|
(common-handler/safe-read-string "Parsing query properties failed")))
|
||||||
shown-properties (if (seq block-properties)
|
shown-properties (if (seq block-properties)
|
||||||
(set block-properties)
|
(set block-properties)
|
||||||
(set all-properties))
|
(set all-properties))
|
||||||
|
|
|
@ -4,8 +4,7 @@
|
||||||
[frontend.handler.file-based.property :as file-property]
|
[frontend.handler.file-based.property :as file-property]
|
||||||
[frontend.config :as config]
|
[frontend.config :as config]
|
||||||
[frontend.state :as state]
|
[frontend.state :as state]
|
||||||
[frontend.db :as db]
|
[frontend.db :as db]))
|
||||||
[frontend.modules.outliner.core :as outliner-core]))
|
|
||||||
|
|
||||||
(def user-face-builtin-schema-types db-property/user-face-builtin-schema-types)
|
(def user-face-builtin-schema-types db-property/user-face-builtin-schema-types)
|
||||||
(def internal-builtin-schema-types db-property/internal-builtin-schema-types)
|
(def internal-builtin-schema-types db-property/internal-builtin-schema-types)
|
||||||
|
@ -27,15 +26,13 @@
|
||||||
(defn update-property!
|
(defn update-property!
|
||||||
[repo property-uuid opts]
|
[repo property-uuid opts]
|
||||||
{:pre [(uuid? property-uuid)]}
|
{:pre [(uuid? property-uuid)]}
|
||||||
#_:clj-kondo/ignore
|
|
||||||
(when (config/db-based-graph? repo)
|
(when (config/db-based-graph? repo)
|
||||||
(db-property/update-property! repo property-uuid opts)))
|
(db-property/update-property! repo property-uuid opts)))
|
||||||
|
|
||||||
(defn delete-property-value!
|
(defn delete-property-value!
|
||||||
"Delete value if a property has multiple values"
|
"Delete value if a property has multiple values"
|
||||||
[repo block property-id property-value]
|
[repo block property-id property-value]
|
||||||
#_:clj-kondo/ignore
|
(when (config/db-based-graph? repo)
|
||||||
(if (config/db-based-graph? repo)
|
|
||||||
(db-property/delete-property-value! repo block property-id property-value)))
|
(db-property/delete-property-value! repo block property-id property-value)))
|
||||||
|
|
||||||
(defn set-editing-new-property!
|
(defn set-editing-new-property!
|
||||||
|
|
Loading…
Reference in New Issue