fix: disable collapse/expand if empty properties for object's class

This commit is contained in:
Tienson Qin
2024-01-26 13:31:57 +08:00
parent c8a7a4e627
commit bec7768f14

View File

@@ -3448,19 +3448,21 @@
(when block-id
(let [repo (state/get-current-repo)]
(if-let [block (db/entity [:block/uuid block-id])]
(or (db-model/has-children? block-id)
(valid-dsl-query-block? block)
(valid-custom-query-block? block)
(and (config/db-based-graph? repo)
(seq (:block/properties block))
(not (db-pu/all-hidden-built-in-properties? (keys (:block/properties block)))))
(and (config/db-based-graph? repo)
(seq (:block/tags block)))
(and
(:outliner/block-title-collapse-enabled? (state/get-config))
(block-with-title? (:block/format block)
(:block/content block)
semantic?)))
(let [db-based? (config/db-based-graph? repo)
tags (:block/tags (db/entity (:db/id block)))]
(or (db-model/has-children? block-id)
(valid-dsl-query-block? block)
(valid-custom-query-block? block)
(and db-based?
(seq (:block/properties block))
(not (db-pu/all-hidden-built-in-properties? (keys (:block/properties block)))))
(and db-based? (seq tags)
(some (fn [t] (seq (:properties (:block/schema t)))) tags))
(and
(:outliner/block-title-collapse-enabled? (state/get-config))
(block-with-title? (:block/format block)
(:block/content block)
semantic?))))
false)))))
(defn all-blocks-with-level