Revert "fix: don't set :logseq.property/built-in? for properties"

This reverts commit e5bb634a08.
feat/tables
Tienson Qin 2024-06-27 16:27:41 +08:00
parent 073427d898
commit fec74edc0c
6 changed files with 11 additions and 16 deletions

View File

@ -457,11 +457,9 @@
(common-util/uuid-string? (:block/name page))))))
(defn built-in?
"Built-in property, page or block"
"Built-in page or block"
[entity]
(or
(db-property/built-in? (:db/ident entity))
(db-property/property-value-content (:logseq.property/built-in? entity))))
(db-property/property-value-content (:logseq.property/built-in? entity)))
(defn built-in-class-property?
"Whether property a built-in property for the specific class"

View File

@ -8,8 +8,6 @@
;; Main property vars
;; ==================
;; TODO: consider adding :db/version for each property or maintain a
;; version->properties list to ensure users are using the app with correct version.
(def ^:large-vars/data-var built-in-properties*
"Map of built in properties for db graphs with their :db/ident as keys.
Each property has a config map with the following keys:
@ -169,11 +167,6 @@
(assoc v :name (keyword (string/lower-case (name k)))))]))
(into (ordered-map))))
(defn built-in?
"Whether property is a built-in property"
[ident]
(when ident (some? (built-in-properties ident))))
(def db-attribute-properties
"Internal properties that are also db schema attributes"
#{:block/alias :block/tags})

View File

@ -50,6 +50,9 @@
tx (concat [built-in-property]
properties
[built-in-prop-value]
;; Adding built-ins must come after initial properties and built-in-prop-value
[(mark-block-as-built-in' built-in-property)]
(map mark-block-as-built-in' properties)
(keep #(when (= #{"closed value"} (:block/type %)) (mark-block-as-built-in' %))
properties))]
{:tx tx

View File

@ -19,7 +19,7 @@
[frontend.handler.file-sync :as file-sync-handler]
[logseq.common.path :as path]
[frontend.handler.property.util :as pu]
[logseq.db :as ldb]))
[logseq.db.frontend.property :as db-property]))
(defn- delete-page!
[page]
@ -99,7 +99,8 @@
(when-not (or contents?
config/publishing?
(and db-based? (ldb/built-in? page)))
(and db-based?
(db-property/property-value-content (:logseq.property/built-in? page))))
{:title (t :page/delete)
:options {:on-click #(delete-page-confirm! page)}})

View File

@ -535,7 +535,6 @@ Some bindings in this fn:
(if db-graph?
;; This keeps built-in properties from showing up in not results.
;; May need to be revisited as more class and property filters are explored
;; FIXME: properties don't have :logseq.property/built-in? now
(concat [['?b :block/uuid] '[(missing? $ ?b :logseq.property/built-in?)]] q)
(concat [['?b :block/uuid]] q))

View File

@ -10,7 +10,8 @@
[frontend.worker.util :as worker-util]
[logseq.db.sqlite.util :as sqlite-util]
[logseq.common.util :as common-util]
[logseq.db :as ldb]))
[logseq.db :as ldb]
[logseq.db.frontend.property :as db-property]))
;; TODO: use sqlite for fuzzy search
(defonce indices (atom nil))
@ -263,7 +264,7 @@
(when p
{:id (str (:block/uuid p))
:name (:block/name p)
:built-in? (ldb/built-in? p)
:built-in? (boolean (db-property/property-value-content (:logseq.property/built-in? p)))
:original-name (:block/original-name p)}))
(defn- hidden-page?