fix: display property names not idents for query

table and settings
feat/tables
Gabriel Horner 2024-06-26 09:34:33 -04:00
parent 958ba90115
commit 5e5a8ee1df
3 changed files with 12 additions and 7 deletions

View File

@ -59,7 +59,7 @@
:hide? true}}
:logseq.property/query-table {:schema {:type :checkbox
:hide? true}}
;; query-properties is a coll of property uuids and keywords where keywords are special frontend keywords
;; query-properties is a coll of property db-idents and keywords where keywords are special frontend keywords
:logseq.property/query-properties {:schema {:type :coll
:hide? true}}
:logseq.property/query-sort-by {:schema {:type :keyword

View File

@ -235,10 +235,12 @@
[:thead
[:tr.cursor
(for [column columns]
(let [title (if (and (= column :clock-time) (integer? clock-time-total))
(util/format "clock-time(total: %s)" (clock/seconds->days:hours:minutes:seconds
clock-time-total))
(name column))]
(let [title (if db-graph?
(if (qualified-keyword? column) (db-pu/get-property-name column) (name column))
(if (and (= column :clock-time) (integer? clock-time-total))
(util/format "clock-time(total: %s)" (clock/seconds->days:hours:minutes:seconds
clock-time-total))
(name column)))]
(sortable-title title column sort-state (:block/uuid current-block) {:db-graph? db-graph?})))]]
[:tbody
(for [row sort-result]

View File

@ -299,7 +299,8 @@
(reset! *query-properties {})
state)}
[block shown-properties all-properties]
(let [query-properties (rum/react *query-properties)]
(let [query-properties (rum/react *query-properties)
db-graph? (config/db-based-graph? (state/get-current-repo))]
[:div
[:h1.font-semibold.-mt-2.mb-2.text-lg (t :query/config-property-settings)]
[:a.flex
@ -316,7 +317,9 @@
(contains? shown-properties property)
property-value)]
[:div.flex.flex-row.my-2.justify-between.align-items
[:div (if (uuid? property) (db-pu/get-property-name property) (name property))]
[:div (if (and db-graph? (qualified-keyword? property))
(db-pu/get-property-name property)
(name property))]
[:div.mt-1 (ui/toggle shown?
(fn []
(let [value (not shown?)]