fix: property completion should only include properties

Was including classes and blocks with :block/schema. Also not
hiding icon property correctly. Also updated outdated docstrings
pull/10544/head
Gabriel Horner 2023-11-22 12:28:08 -05:00
parent 6c618ffae1
commit 6c5072e7e6
3 changed files with 9 additions and 3 deletions

View File

@ -20,6 +20,7 @@
| 4 | db schema |
| 5 | unknown type |
| 6 | property block |
| 7 | macro |
"
[block]
(cond
@ -70,7 +71,7 @@
(transit/write t-writer))))
(defn block-with-timestamps
"Copy of outliner-core/block-with-timestamps. Too basic to couple this to main app"
"Adds updated-at timestamp and created-at if it doesn't exist"
[block]
(let [updated-at (time-ms)
block (cond->

View File

@ -1181,7 +1181,10 @@ independent of format as format specific heading characters are stripped"
(let [db (conn/get-db)
ids (->> (d/datoms db :aevt :block/schema)
(map :e))]
(map #(:block/original-name (db-utils/entity %)) ids)))
(->> ids
(map db-utils/entity)
(filter #(contains? (:block/type %) "property"))
(map :block/original-name))))
(defn get-all-properties
"Returns a seq of property name strings"

View File

@ -178,7 +178,9 @@
(defn get-all-properties
[]
(let [hidden-props (if (config/db-based-graph? (state/get-current-repo))
(set (map name db-property/hidden-built-in-properties))
(set (map #(or (get-in db-property/built-in-properties [% :original-name])
(name %))
db-property/hidden-built-in-properties))
(set (map name (property-util/hidden-properties))))]
(remove hidden-props (db-model/get-all-properties))))