Browse Source

fix: db tests

Tienson Qin 9 months ago
parent
commit
2c04eb76d7

+ 10 - 9
deps/db/src/logseq/db/frontend/malli_schema.cljs

@@ -138,6 +138,7 @@
        (reduce (fn [m [k v]]
        (reduce (fn [m [k v]]
                  (if-let [property (and (db-property/property? k)
                  (if-let [property (and (db-property/property? k)
                                         (not (contains? exceptions-to-block-properties k))
                                         (not (contains? exceptions-to-block-properties k))
+                                        (not= (namespace k) "property")
                                         (d/entity db k))]
                                         (d/entity db k))]
                    (update m :block/properties (fnil conj [])
                    (update m :block/properties (fnil conj [])
                            [(property-entity->map property) v])
                            [(property-entity->map property) v])
@@ -197,7 +198,7 @@
 
 
 (assert (every? #(re-find #"^(block|logseq\.)" (namespace %)) db-property/db-attribute-properties)
 (assert (every? #(re-find #"^(block|logseq\.)" (namespace %)) db-property/db-attribute-properties)
         "All db-attribute idents start with an internal namespace")
         "All db-attribute idents start with an internal namespace")
-(assert (every? #(or (re-find #"^logseq\." %) (= "property" %)) logseq-ident-namespaces)
+(assert (every? #(or (re-find #"^logseq\." %) (contains? #{"property"} %)) logseq-ident-namespaces)
         "All logseq idents start with an internal namespace")
         "All logseq idents start with an internal namespace")
 
 
 ;; Main malli schemas
 ;; Main malli schemas
@@ -267,7 +268,7 @@
    [:db/valueType {:optional true} [:enum :db.type/ref]]
    [:db/valueType {:optional true} [:enum :db.type/ref]]
    [:db/cardinality {:optional true} [:enum :db.cardinality/many :db.cardinality/one]]
    [:db/cardinality {:optional true} [:enum :db.cardinality/many :db.cardinality/one]]
    [:block/order {:optional true} block-order]
    [:block/order {:optional true} block-order]
-   [:property/schema.classes {:optional true} [:set :int]]])
+   [:property/classes {:optional true} [:set :int]]])
 
 
 (def normal-page
 (def normal-page
   (vec
   (vec
@@ -289,6 +290,7 @@
 (def property-common-schema-attrs
 (def property-common-schema-attrs
   "Property :schema attributes common to all properties"
   "Property :schema attributes common to all properties"
   [[:property/hide? {:optional true} :boolean]
   [[:property/hide? {:optional true} :boolean]
+   [:property/public? {:optional true} :boolean]
    [:property/ui-position {:optional true} [:enum :properties :block-left :block-right :block-below]]])
    [:property/ui-position {:optional true} [:enum :properties :block-left :block-right :block-below]]])
 
 
 (def internal-property
 (def internal-property
@@ -298,7 +300,6 @@
      [:db/ident internal-property-ident]
      [:db/ident internal-property-ident]
      [:property/type (apply vector :enum (into db-property-type/internal-built-in-property-types
      [:property/type (apply vector :enum (into db-property-type/internal-built-in-property-types
                                                db-property-type/user-built-in-property-types))]
                                                db-property-type/user-built-in-property-types))]
-     [:property/public? {:optional true} :boolean]
      [:property/view-context {:optional true} [:enum :page :block :class :property :never]]]
      [:property/view-context {:optional true} [:enum :page :block :class :property :never]]]
     property-common-schema-attrs
     property-common-schema-attrs
     property-attrs
     property-attrs
@@ -362,7 +363,7 @@
   (vec
   (vec
    (concat
    (concat
     [:map]
     [:map]
-    [[:property.value/content [:or :string :double :boolean]]
+    [[:property/value [:or :string :double :boolean]]
      [:logseq.property/created-from-property :int]]
      [:logseq.property/created-from-property :int]]
     (remove #(#{:block/title :logseq.property/created-from-property} (first %)) block-attrs)
     (remove #(#{:block/title :logseq.property/created-from-property} (first %)) block-attrs)
     page-or-block-attrs)))
     page-or-block-attrs)))
@@ -394,7 +395,7 @@
     [;; for built-in properties
     [;; for built-in properties
      [:db/ident {:optional true} logseq-property-ident]
      [:db/ident {:optional true} logseq-property-ident]
      [:block/title {:optional true} :string]
      [:block/title {:optional true} :string]
-     [:property.value/content {:optional true} [:or :string :double]]
+     [:property/value {:optional true} [:or :string :double]]
      [:logseq.property/created-from-property :int]
      [:logseq.property/created-from-property :int]
      [:block/closed-value-property {:optional true} [:set :int]]]
      [:block/closed-value-property {:optional true} [:set :int]]]
     (remove #(#{:block/title :logseq.property/created-from-property} (first %)) block-attrs)
     (remove #(#{:block/title :logseq.property/created-from-property} (first %)) block-attrs)
@@ -403,10 +404,10 @@
 (def closed-value-block
 (def closed-value-block
   "A closed value for a property with closed/allowed values"
   "A closed value for a property with closed/allowed values"
   [:and closed-value-block*
   [:and closed-value-block*
-   [:fn {:error/message ":block/title or :property.value/content required"
-         :error/path [:property.value/content]}
+   [:fn {:error/message ":block/title or :property/value required"
+         :error/path [:property/value]}
     (fn [m]
     (fn [m]
-      (or (:block/title m) (:property.value/content m)))]])
+      (or (:block/title m) (:property/value m)))]])
 
 
 (def normal-block
 (def normal-block
   "A block with content and no special type or tag behavior"
   "A block with content and no special type or tag behavior"
@@ -484,7 +485,7 @@
                        :closed-value-block
                        :closed-value-block
 
 
                        (and (:logseq.property/created-from-property d)
                        (and (:logseq.property/created-from-property d)
-                            (:property.value/content d))
+                            (:property/value d))
                        :property-value-block
                        :property-value-block
 
 
                        (:block/uuid d)
                        (:block/uuid d)

+ 7 - 17
deps/db/src/logseq/db/frontend/property.cljs

@@ -28,7 +28,7 @@
                                                    (or (:db/id property) {:db/ident (:db/ident property)}))
                                                    (or (:db/id property) {:db/ident (:db/ident property)}))
           :block/order (db-order/gen-key)}
           :block/order (db-order/gen-key)}
          (if (db-property-type/property-value-content? (:property/type property) property)
          (if (db-property-type/property-value-content? (:property/type property) property)
-           {:property.value/content value}
+           {:property/value value}
            {:block/title value}))
            {:block/title value}))
         common-util/block-with-timestamps)))
         common-util/block-with-timestamps)))
 
 
@@ -73,16 +73,14 @@
      :property/ui-position {:title "Property position"
      :property/ui-position {:title "Property position"
                             :schema {:type :keyword
                             :schema {:type :keyword
                                      :hide? true}}
                                      :hide? true}}
-     :logseq.property.attribute/property-schema-classes
+     :property/classes
      {:title "Property classes"
      {:title "Property classes"
-      :attribute :property/schema.classes
       :schema {:type :entity
       :schema {:type :entity
                :cardinality :many
                :cardinality :many
                :public? false
                :public? false
                :hide? true}}
                :hide? true}}
-     :logseq.property.attribute/property-value-content
+     :property/value
      {:title "Property value"
      {:title "Property value"
-      :attribute :property.value/content
       :schema {:type :any
       :schema {:type :any
                :public? false
                :public? false
                :hide? true}}
                :hide? true}}
@@ -101,11 +99,6 @@
                                      :public? true
                                      :public? true
                                      :classes #{:logseq.class/Root}}
                                      :classes #{:logseq.class/Root}}
                             :queryable? true}
                             :queryable? true}
-     :logseq.property.attribute/kv-value {:title "KV value"
-                                          :attribute :kv/value
-                                          :schema {:type :any
-                                                   :public? false
-                                                   :hide? true}}
      :block/parent         {:title "Node parent"
      :block/parent         {:title "Node parent"
                             :attribute :block/parent
                             :attribute :block/parent
                             :schema {:type :entity
                             :schema {:type :entity
@@ -601,13 +594,10 @@
     :block/order :block/collapsed? :block/page
     :block/order :block/collapsed? :block/page
     :block/refs :block/path-refs :block/link
     :block/refs :block/path-refs :block/link
     :block/title :block/closed-value-property
     :block/title :block/closed-value-property
-    :block/created-at :block/updated-at
-    :logseq.property.attribute/kv-value
-    :logseq.property.attribute/property-schema-classes
-    :logseq.property.attribute/property-value-content})
+    :block/created-at :block/updated-at})
 
 
 (assert (= db-attribute-properties
 (assert (= db-attribute-properties
-           (set (keep (fn [[k {:keys [attribute]}]] (when attribute k))
+           (set (keep (fn [[_k {:keys [attribute]}]] (when attribute attribute))
                       built-in-properties)))
                       built-in-properties)))
         "All db attribute properties are configured in built-in-properties")
         "All db attribute properties are configured in built-in-properties")
 
 
@@ -688,14 +678,14 @@
   "Gets content/value of a given closed value ent/map. Works for all closed value types"
   "Gets content/value of a given closed value ent/map. Works for all closed value types"
   [ent]
   [ent]
   (or (:block/title ent)
   (or (:block/title ent)
-      (:property.value/content ent)))
+      (:property/value ent)))
 
 
 (defn property-value-content
 (defn property-value-content
   "Given an entity, gets the content for the property value of a ref type
   "Given an entity, gets the content for the property value of a ref type
   property i.e. what the user sees. For page types the content is the page name"
   property i.e. what the user sees. For page types the content is the page name"
   [ent]
   [ent]
   (or (:block/title ent)
   (or (:block/title ent)
-      (:property.value/content ent)))
+      (:property/value ent)))
 
 
 (defn ref->property-value-content
 (defn ref->property-value-content
   "Given a ref from a pulled query e.g. `{:db/id X}`, gets a readable name for
   "Given a ref from a pulled query e.g. `{:db/id X}`, gets a readable name for

+ 1 - 1
deps/db/src/logseq/db/frontend/property/build.cljs

@@ -16,7 +16,7 @@
                                                      property-id)
                                                      property-id)
             :block/parent property-id}
             :block/parent property-id}
            (if (db-property-type/property-value-content? block-type property)
            (if (db-property-type/property-value-content? block-type property)
-             {:property.value/content value}
+             {:property/value value}
              {:block/title value}))))
              {:block/title value}))))
 
 
 (defn build-closed-value-block
 (defn build-closed-value-block

+ 5 - 5
deps/db/src/logseq/db/frontend/property/type.cljs

@@ -44,18 +44,18 @@
 
 
 (def original-value-ref-property-types
 (def original-value-ref-property-types
   "Property value ref types where the refed entity stores its value in
   "Property value ref types where the refed entity stores its value in
-  :property.value/content e.g. :number is stored as a number. new value-ref-property-types
+  :property/value e.g. :number is stored as a number. new value-ref-property-types
   should default to this as it allows for more querying power"
   should default to this as it allows for more querying power"
   #{:number})
   #{:number})
 
 
 (def value-ref-property-types
 (def value-ref-property-types
   "Property value ref types where the refed entities either store their value in
   "Property value ref types where the refed entities either store their value in
-  :property.value/content or :block/title (for :default)"
+  :property/value or :block/title (for :default)"
   (into #{:default :url} original-value-ref-property-types))
   (into #{:default :url} original-value-ref-property-types))
 
 
 (def user-ref-property-types
 (def user-ref-property-types
   "User ref types. Property values that users see are stored in either
   "User ref types. Property values that users see are stored in either
-  :property.value/content or :block/title. :block/title is for all the page related types"
+  :property/value or :block/title. :block/title is for all the page related types"
   (into #{:date :node} value-ref-property-types))
   (into #{:date :node} value-ref-property-types))
 
 
 (assert (set/subset? user-ref-property-types
 (assert (set/subset? user-ref-property-types
@@ -120,7 +120,7 @@
   (if new-closed-value?
   (if new-closed-value?
     (number? id-or-value)
     (number? id-or-value)
     (when-let [entity (d/entity db id-or-value)]
     (when-let [entity (d/entity db id-or-value)]
-      (number? (:property.value/content entity)))))
+      (number? (:property/value entity)))))
 
 
 (defn- text-entity?
 (defn- text-entity?
   [db s {:keys [new-closed-value?]}]
   [db s {:keys [new-closed-value?]}]
@@ -206,7 +206,7 @@
     :else :default))
     :else :default))
 
 
 (defn property-value-content?
 (defn property-value-content?
-  "Whether property value should be stored in :property.value/content"
+  "Whether property value should be stored in :property/value"
   [block-type property]
   [block-type property]
   (or
   (or
    (original-value-ref-property-types (:property/type property))
    (original-value-ref-property-types (:property/type property))

+ 3 - 3
deps/db/src/logseq/db/frontend/rules.cljc

@@ -178,7 +178,7 @@
        [?prop-e :db/valueType :db.type/ref]
        [?prop-e :db/valueType :db.type/ref]
        [?b ?prop ?pv]
        [?b ?prop ?pv]
        (or [?pv :block/title ?val]
        (or [?pv :block/title ?val]
-           [?pv :property.value/content ?val])]]
+           [?pv :property/value ?val])]]
 
 
     :property-missing-value
     :property-missing-value
     '[(property-missing-value ?b ?prop-e ?default-p ?default-v)
     '[(property-missing-value ?b ?prop-e ?default-p ?default-v)
@@ -202,7 +202,7 @@
       (property-missing-value ?b ?prop-e ?default-p ?default-v)
       (property-missing-value ?b ?prop-e ?default-p ?default-v)
       (or
       (or
        [?default-v :block/title ?val]
        [?default-v :block/title ?val]
-       [?default-v :property.value/content ?val])]
+       [?default-v :property/value ?val])]
 
 
     :property-value
     :property-value
     '[[(property-value ?b ?prop-e ?val)
     '[[(property-value ?b ?prop-e ?val)
@@ -280,7 +280,7 @@
        (and
        (and
         [?prop-e :db/valueType :db.type/ref]
         [?prop-e :db/valueType :db.type/ref]
         (or [?pv :block/title ?val]
         (or [?pv :block/title ?val]
-            [?pv :property.value/content ?val])))]
+            [?pv :property/value ?val])))]
 
 
     ;; Checks if a property has a value for simple queries. Supports default values
     ;; Checks if a property has a value for simple queries. Supports default values
     :simple-query-property
     :simple-query-property

+ 0 - 1
deps/db/src/logseq/db/frontend/schema.cljs

@@ -8,7 +8,6 @@
 (def ^:large-vars/data-var schema
 (def ^:large-vars/data-var schema
   {:db/ident        {:db/unique :db.unique/identity}
   {:db/ident        {:db/unique :db.unique/identity}
    :kv/value       {}
    :kv/value       {}
-
    :recent/pages {}
    :recent/pages {}
 
 
    ;; :block/type is a string type of the current block
    ;; :block/type is a string type of the current block

+ 3 - 3
deps/db/src/logseq/db/sqlite/build.cljs

@@ -174,7 +174,7 @@
         (when-let [props (not-empty (:build/properties prop-m))]
         (when-let [props (not-empty (:build/properties prop-m))]
           (->block-properties (merge props (db-property-build/build-properties-with-ref-values pvalue-tx-m)) page-uuids all-idents))
           (->block-properties (merge props (db-property-build/build-properties-with-ref-values pvalue-tx-m)) page-uuids all-idents))
         (when (seq schema-classes)
         (when (seq schema-classes)
-          {:property/schema.classes
+          {:property/classes
            (mapv #(hash-map :db/ident (get-ident all-idents %))
            (mapv #(hash-map :db/ident (get-ident all-idents %))
                  schema-classes)})))
                  schema-classes)})))
       true
       true
@@ -539,8 +539,8 @@
         class-ident->id (->> classes-tx (map (juxt :db/ident :db/id)) (into {}))
         class-ident->id (->> classes-tx (map (juxt :db/ident :db/id)) (into {}))
         ;; Replace idents with db-ids to avoid any upsert issues
         ;; Replace idents with db-ids to avoid any upsert issues
         properties-tx' (mapv (fn [m]
         properties-tx' (mapv (fn [m]
-                               (if (:property/schema.classes m)
-                                 (update m :property/schema.classes
+                               (if (:property/classes m)
+                                 (update m :property/classes
                                          (fn [cs]
                                          (fn [cs]
                                            (mapv #(or (some->> (:db/ident %) class-ident->id (hash-map :db/id))
                                            (mapv #(or (some->> (:db/ident %) class-ident->id (hash-map :db/id))
                                                       (throw (ex-info (str "No :db/id found for :db/ident " (pr-str (:db/ident %))) {})))
                                                       (throw (ex-info (str "No :db/id found for :db/ident " (pr-str (:db/ident %))) {})))

+ 2 - 2
deps/db/src/logseq/db/sqlite/util.cljs

@@ -76,7 +76,7 @@
          (= k :cardinality)
          (= k :cardinality)
          (assoc r :db/cardinality v)
          (assoc r :db/cardinality v)
          (= k :classes)
          (= k :classes)
-         (assoc r :property/schema.classes v)
+         (assoc r :property/classes v)
          :else
          :else
          (assoc r (keyword "property" k) v))))
          (assoc r (keyword "property" k) v))))
    {}
    {}
@@ -138,7 +138,7 @@
 
 
 (defn kv
 (defn kv
   "Creates a key-value pair tx with the key and value respectively stored under
   "Creates a key-value pair tx with the key and value respectively stored under
-  :db/ident and :kv/value.  The key must be under the namespace :logseq.kv"
+  :db/ident and :kv/value. The key must be under the namespace :logseq.kv"
   [k value]
   [k value]
   {:pre [(= "logseq.kv" (namespace k))]}
   {:pre [(= "logseq.kv" (namespace k))]}
   {:db/ident k
   {:db/ident k

+ 1 - 1
deps/db/test/logseq/db/frontend/rules_test.cljs

@@ -44,7 +44,7 @@
                               @conn)
                               @conn)
                 (map (comp :block/title first))))
                 (map (comp :block/title first))))
         "has-property returns no result when block doesn't have property")
         "has-property returns no result when block doesn't have property")
-    (is (= [:user.property/foo :block/tags]
+    (is (= [:block/tags :user.property/foo]
            (q-with-rules '[:find [?p ...]
            (q-with-rules '[:find [?p ...]
                            :where (has-property ?b ?p) [?b :block/title "Page1"]]
                            :where (has-property ?b ?p) [?b :block/title "Page1"]]
                          @conn))
                          @conn))

+ 2 - 1
deps/db/test/logseq/db/sqlite/create_graph_test.cljs

@@ -29,7 +29,8 @@
         (is (= []
         (is (= []
                (->> (remove db-property/db-attribute-properties default-idents)
                (->> (remove db-property/db-attribute-properties default-idents)
                     (keep namespace)
                     (keep namespace)
-                    (remove #(string/starts-with? % "logseq."))))
+                    (remove #(string/starts-with? % "logseq"))
+                    (remove #(string/starts-with? % "property"))))
             "All default :db/ident namespaces start with logseq."))
             "All default :db/ident namespaces start with logseq."))
 
 
       (testing "closed values"
       (testing "closed values"

+ 2 - 2
deps/outliner/src/logseq/outliner/property.cljs

@@ -236,7 +236,7 @@
           :where
           :where
           [?b ?property-id ?v]
           [?b ?property-id ?v]
           (or [?v :block/title ?raw-value]
           (or [?v :block/title ?raw-value]
-              [?v :property.value/content ?raw-value])]
+              [?v :property/value ?raw-value])]
         db
         db
         property-id
         property-id
         raw-value)))
         raw-value)))
@@ -504,7 +504,7 @@
                       {:block/uuid id
                       {:block/uuid id
                        :block/closed-value-property (:db/id property)}
                        :block/closed-value-property (:db/id property)}
                       (if (db-property-type/property-value-content? (:property/type block) property)
                       (if (db-property-type/property-value-content? (:property/type block) property)
-                        {:property.value/content resolved-value}
+                        {:property/value resolved-value}
                         {:block/title resolved-value})))
                         {:block/title resolved-value})))
                      icon
                      icon
                      (assoc :logseq.property/icon icon))]
                      (assoc :logseq.property/icon icon))]

+ 2 - 2
deps/outliner/test/logseq/outliner/property_test.cljs

@@ -228,13 +228,13 @@
 
 
     (testing "Add choice successfully"
     (testing "Add choice successfully"
       (let [_ (outliner-property/upsert-closed-value! conn :user.property/num {:value 3})
       (let [_ (outliner-property/upsert-closed-value! conn :user.property/num {:value 3})
-            b (first (d/q '[:find [(pull ?b [*]) ...] :where [?b :property.value/content 3]] @conn))]
+            b (first (d/q '[:find [(pull ?b [*]) ...] :where [?b :property/value 3]] @conn))]
         (is (ldb/closed-value? (d/entity @conn (:db/id b))))
         (is (ldb/closed-value? (d/entity @conn (:db/id b))))
         (is (= [2 3]
         (is (= [2 3]
                (map db-property/closed-value-content (:block/_closed-value-property (d/entity @conn :user.property/num)))))))
                (map db-property/closed-value-content (:block/_closed-value-property (d/entity @conn :user.property/num)))))))
 
 
     (testing "Update choice successfully"
     (testing "Update choice successfully"
-      (let [b (first (d/q '[:find [(pull ?b [*]) ...] :where [?b :property.value/content 2]] @conn))
+      (let [b (first (d/q '[:find [(pull ?b [*]) ...] :where [?b :property/value 2]] @conn))
             _ (outliner-property/upsert-closed-value! conn :user.property/num {:id (:block/uuid b)
             _ (outliner-property/upsert-closed-value! conn :user.property/num {:id (:block/uuid b)
                                                                                :value 4
                                                                                :value 4
                                                                                :description "choice 4"})
                                                                                :description "choice 4"})

+ 4 - 4
scripts/src/logseq/tasks/db_graph/create_graph_with_schema_org.cljs

@@ -364,7 +364,7 @@
   (let [ents (remove #(db-malli-schema/internal-ident? (:db/ident %))
   (let [ents (remove #(db-malli-schema/internal-ident? (:db/ident %))
                      (d/q '[:find [(pull ?b [*
                      (d/q '[:find [(pull ?b [*
                                              {:logseq.property.class/properties [:block/title]}
                                              {:logseq.property.class/properties [:block/title]}
-                                             {:property/schema.classes [:block/title]}
+                                             {:property/classes [:block/title]}
                                              {:logseq.property/parent [:block/title]}
                                              {:logseq.property/parent [:block/title]}
                                              {:block/tags [:block/title]}
                                              {:block/tags [:block/title]}
                                              {:block/refs [:block/title]}]) ...]
                                              {:block/refs [:block/title]}]) ...]
@@ -379,7 +379,7 @@
                                                     (into {}))]
                                                     (into {}))]
                                      (cond-> (select-keys m [:block/name :block/tags :block/title :property/type :db/cardinality :db/ident
                                      (cond-> (select-keys m [:block/name :block/tags :block/title :property/type :db/cardinality :db/ident
                                                              :logseq.property.class/properties :logseq.property/parent
                                                              :logseq.property.class/properties :logseq.property/parent
-                                                             :db/cardinality :property/schema.classes :block/refs])
+                                                             :db/cardinality :property/classes :block/refs])
                                        (seq props)
                                        (seq props)
                                        (assoc :block/properties (-> (update-keys props name)
                                        (assoc :block/properties (-> (update-keys props name)
                                                                     (dissoc "tags")
                                                                     (dissoc "tags")
@@ -391,8 +391,8 @@
                                        (update :logseq.property.class/properties #(set (map :block/title %)))
                                        (update :logseq.property.class/properties #(set (map :block/title %)))
                                        (some? (:logseq.property/parent m))
                                        (some? (:logseq.property/parent m))
                                        (update :logseq.property/parent :block/title)
                                        (update :logseq.property/parent :block/title)
-                                       (seq (:property/schema.classes m))
-                                       (update :property/schema.classes #(set (map :block/title %)))
+                                       (seq (:property/classes m))
+                                       (update :property/classes #(set (map :block/title %)))
                                        (seq (:block/tags m))
                                        (seq (:block/tags m))
                                        (update :block/tags #(set (map :block/title %)))
                                        (update :block/tags #(set (map :block/title %)))
                                        (seq (:block/refs m))
                                        (seq (:block/refs m))

+ 1 - 1
scripts/src/logseq/tasks/dev/db_and_file_graphs.clj

@@ -126,7 +126,7 @@
   []
   []
   (let [db-concepts
   (let [db-concepts
         ;; from logseq.db.frontend.schema
         ;; from logseq.db.frontend.schema
-        ["closed-value" "class/properties" "schema.classes" "property/parent"
+        ["closed-value" "class/properties" "classes" "property/parent"
          "logseq.property" "logseq.class"]
          "logseq.property" "logseq.class"]
         res (apply shell {:out :string :continue true}
         res (apply shell {:out :string :continue true}
                    "git grep -E" (str "(" (string/join "|" db-concepts) ")")
                    "git grep -E" (str "(" (string/join "|" db-concepts) ")")

+ 2 - 2
src/main/frontend/components/property/config.cljs

@@ -90,7 +90,7 @@
          (some-> (rum/deref *ref)
          (some-> (rum/deref *ref)
                  (.click))))
                  (.click))))
      [default-open?])
      [default-open?])
-    (let [schema-classes (:property/schema.classes property)]
+    (let [schema-classes (:property/classes property)]
       [:div.flex.flex-1.col-span-3
       [:div.flex.flex-1.col-span-3
        (let [content-fn
        (let [content-fn
              (fn [{:keys [id]}]
              (fn [{:keys [id]}]
@@ -129,7 +129,7 @@
                                           (toggle-fn)
                                           (toggle-fn)
                                           (p/let [result (<create-class-if-not-exists! value)
                                           (p/let [result (<create-class-if-not-exists! value)
                                                   value' (or result value)
                                                   value' (or result value)
-                                                  tx-data [[(if select? :db/add :db/retract) (:db/id property) :property/schema.classes [:block/uuid value']]]
+                                                  tx-data [[(if select? :db/add :db/retract) (:db/id property) :property/classes [:block/uuid value']]]
                                                   _ (db/transact! (state/get-current-repo) tx-data {:outliner-op :update-property})]
                                                   _ (db/transact! (state/get-current-repo) tx-data {:outliner-op :update-property})]
                                             (when-not multiple-choices? (toggle-fn)))))}]
                                             (when-not multiple-choices? (toggle-fn)))))}]
 
 

+ 5 - 5
src/main/frontend/components/property/value.cljs

@@ -170,7 +170,7 @@
                   :db/index true
                   :db/index true
                   :block/tags :logseq.class/Property
                   :block/tags :logseq.class/Property
                   :property/type :node
                   :property/type :node
-                  :property/schema.classes (:db/id property)}]
+                  :property/classes (:db/id property)}]
                 {:outliner-op :save-block}))
                 {:outliner-op :save-block}))
 
 
 (defn <add-property!
 (defn <add-property!
@@ -614,7 +614,7 @@
    result]
    result]
   (let [[refresh-count set-refresh-count!] (rum/use-state 0)
   (let [[refresh-count set-refresh-count!] (rum/use-state 0)
         repo (state/get-current-repo)
         repo (state/get-current-repo)
-        classes (:property/schema.classes property)
+        classes (:property/classes property)
         tags? (= :block/tags (:db/ident property))
         tags? (= :block/tags (:db/ident property))
         alias? (= :block/alias (:db/ident property))
         alias? (= :block/alias (:db/ident property))
         tags-or-alias? (or tags? alias?)
         tags-or-alias? (or tags? alias?)
@@ -674,7 +674,7 @@
         options (map (fn [node]
         options (map (fn [node]
                        (let [id (or (:value node) (:db/id node))
                        (let [id (or (:value node) (:db/id node))
                              [header label] (if (integer? id)
                              [header label] (if (integer? id)
-                                              (let [node-title (if (seq (:property/schema.classes property))
+                                              (let [node-title (if (seq (:property/classes property))
                                                                  (:block/title node)
                                                                  (:block/title node)
                                                                  (block-handler/block-unique-title node))
                                                                  (block-handler/block-unique-title node))
                                                     title (subs node-title 0 256)
                                                     title (subs node-title 0 256)
@@ -685,7 +685,7 @@
                                                                [:div.text-xs.opacity-70
                                                                [:div.text-xs.opacity-70
                                                                 (breadcrumb {:search? true} (state/get-current-repo) (:block/uuid block) {})]))
                                                                 (breadcrumb {:search? true} (state/get-current-repo) (:block/uuid block) {})]))
                                                     label [:div.flex.flex-row.items-center.gap-1
                                                     label [:div.flex.flex-row.items-center.gap-1
-                                                           (when-not (:property/schema.classes property)
+                                                           (when-not (:property/classes property)
                                                              (ui/icon icon {:size 14}))
                                                              (ui/icon icon {:size 14}))
                                                            [:div title]]]
                                                            [:div title]]]
                                                 [header label])
                                                 [header label])
@@ -780,7 +780,7 @@
                                                                                                    :built-in? false})]
                                                                                                    :built-in? false})]
                                      (set-result! result)))))
                                      (set-result! result)))))
         repo (state/get-current-repo)
         repo (state/get-current-repo)
-        classes (:property/schema.classes property)
+        classes (:property/classes property)
         non-root-classes (remove (fn [c] (= (:db/ident c) :logseq.class/Root)) classes)
         non-root-classes (remove (fn [c] (= (:db/ident c) :logseq.class/Root)) classes)
         parent-property? (= (:db/ident property) :logseq.property/parent)]
         parent-property? (= (:db/ident property) :logseq.property/parent)]
     (when (and (not parent-property?) (seq non-root-classes))
     (when (and (not parent-property?) (seq non-root-classes))

+ 1 - 1
src/main/frontend/db/async.cljs

@@ -120,7 +120,7 @@
                          [?b ?property-id ?vid]
                          [?b ?property-id ?vid]
                          [(not= ?vid :logseq.property/empty-placeholder)]
                          [(not= ?vid :logseq.property/empty-placeholder)]
                          (or
                          (or
-                          [?vid :property.value/content ?value]
+                          [?vid :property/value ?value]
                           [?vid :block/title ?value])]
                           [?vid :block/title ?value])]
                        property-id
                        property-id
                        value)]
                        value)]

+ 1 - 1
src/main/frontend/worker/db/migrate.cljs

@@ -608,7 +608,7 @@
                      :block/refs :block/path-refs :block/link
                      :block/refs :block/path-refs :block/link
                      :block/title :block/closed-value-property
                      :block/title :block/closed-value-property
                      :block/created-at :block/updated-at
                      :block/created-at :block/updated-at
-                     :logseq.property.attribute/property-schema-classes :logseq.property.attribute/property-value-content]}]
+                     :logseq.property.attribute/property-classes :logseq.property.attribute/property-value-content]}]
    [47 {:fix replace-hidden-type-with-schema}]
    [47 {:fix replace-hidden-type-with-schema}]
    [48 {:properties [:logseq.property/default-value :logseq.property/scalar-default-value]}]
    [48 {:properties [:logseq.property/default-value :logseq.property/scalar-default-value]}]
    [49 {:fix replace-special-id-ref-with-id-ref}]
    [49 {:fix replace-special-id-ref-with-id-ref}]

+ 1 - 1
src/main/frontend/worker/rtc/db_listener.cljs

@@ -23,7 +23,7 @@
 (def ^:private watched-attrs
 (def ^:private watched-attrs
   #{:block/title :block/created-at :block/updated-at :block/alias
   #{:block/title :block/created-at :block/updated-at :block/alias
     :block/tags :block/link :block/journal-day
     :block/tags :block/link :block/journal-day
-    :property/schema.classes :property.value/content
+    :property/classes :property/value
     :db/index :db/valueType :db/cardinality})
     :db/index :db/valueType :db/cardinality})
 
 
 (def ^:private watched-attr-ns
 (def ^:private watched-attr-ns

+ 2 - 2
src/main/frontend/worker/rtc/remote_update.cljs

@@ -370,8 +370,8 @@ so need to pull earlier remote-data from websocket."})
     :block/tags
     :block/tags
     :block/link
     :block/link
     :block/journal-day
     :block/journal-day
-    :property/schema.classes
-    :property.value/content})
+    :property/classes
+    :property/value})
 
 
 (def ^:private watched-attr-ns
 (def ^:private watched-attr-ns
   (conj db-property/logseq-property-namespaces "logseq.class"))
   (conj db-property/logseq-property-namespaces "logseq.class"))

File diff suppressed because it is too large
+ 0 - 0
src/rtc_e2e_test/example.cljs


Some files were not shown because too many files changed in this diff