fix: remove built-in properties only used by file graphs

In #11508 we switched to a new table component for db graph queries which left
these built-in properties unused. Also moved file query code to
file-based namespaces and fixed a bug where multiple query properties
couldn't be set for a file graph query
This commit is contained in:
Gabriel Horner
2024-09-13 12:05:36 -04:00
parent c594f3c49a
commit a246db8a82
9 changed files with 196 additions and 193 deletions

View File

@@ -893,31 +893,6 @@
"")]
(when edit-block-f (edit-block-f))))))))
(defn set-block-query-properties!
[block-id all-properties key add?]
(when-let [block (db/entity [:block/uuid block-id])]
(let [query-properties (get block (pu/get-pid :logseq.property/query-properties))
repo (state/get-current-repo)
db-based? (config/db-based-graph? repo)
query-properties (if db-based?
query-properties
(some-> query-properties
(common-handler/safe-read-string "Parsing query properties failed")))
query-properties (if (seq query-properties)
query-properties
all-properties)
query-properties (if add?
(distinct (conj query-properties key))
(remove #{key} query-properties))
query-properties (vec query-properties)]
(if (seq query-properties)
(property-handler/set-block-property! repo block-id
(pu/get-pid :logseq.property/query-properties)
(if db-based?
query-properties
(str query-properties)))
(property-handler/remove-block-property! repo block-id (pu/get-pid :logseq.property/query-properties))))))
(defn set-block-timestamp!
[block-id key value]
(let [key (string/lower-case (str key))