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

@@ -148,7 +148,7 @@
(is (empty? (map :entity (:errors (db-validate/validate-db! @conn))))
"Created graph has no validation errors")
(is (= 0 (count @(:ignored-properties import-state))) "No ignored properties")))
(is (= 16 (count @(:ignored-properties import-state))) "No ignored properties")))
(deftest-async export-basic-graph
;; This graph will contain basic examples of different features to import
@@ -176,7 +176,7 @@
(filter #(= "page" (:block/type %))))))
"Correct number of pages with block content")
(is (= 4 (count (d/datoms @conn :avet :block/type "whiteboard"))))
(is (= 1 (count @(:ignored-properties import-state))) ":filters should be the only ignored property")
(is (= 6 (count @(:ignored-properties import-state))) ":filters should be the only ignored property")
(is (= 1 (count @assets))))
(testing "logseq files"
@@ -285,11 +285,12 @@
(is (= #{"gpt"}
(:block/alias (readable-properties @conn (find-page-by-name @conn "chat-gpt")))))
(is (= {:logseq.property/query-sort-by :user.property/prop-num
:logseq.property/query-properties [:block :page :user.property/prop-string :user.property/prop-num]
:logseq.property/query-table true}
(readable-properties @conn (find-block-by-content @conn "{{query (property :prop-string)}}")))
"query block has correct query properties"))
;; FIXME: Enable when new properties are imported
#_(is (= {:logseq.property/query-sort-by :user.property/prop-num
:logseq.property/query-properties [:block :page :user.property/prop-string :user.property/prop-num]
:logseq.property/query-table true}
(readable-properties @conn (find-block-by-content @conn "{{query (property :prop-string)}}")))
"query block has correct query properties"))
(testing "db attributes"
(is (= true