Просмотр исходного кода

fix(regression): validation should validate tags and alias as properties

It's helpful to validate more about these heavily properties beyond them
just being integers. Follow up to #11565
Gabriel Horner 1 год назад
Родитель
Сommit
af04834d1b

+ 1 - 1
deps/db/src/logseq/db/frontend/malli_schema.cljs

@@ -123,7 +123,7 @@
    (fn [ent]
      (reduce (fn [m [k v]]
                (if-let [property (and (db-property/property? k)
-                                      (not (db-property/db-attribute-properties k))
+                                      (not (db-property/private-db-attribute-properties k))
                                       ;; This allows schemas like property-value-block to require properties in
                                       ;; their schema that they depend on
                                       (not (contains? required-properties k))

+ 6 - 0
deps/db/src/logseq/db/frontend/property.cljs

@@ -436,6 +436,12 @@
     :block/created-at :block/updated-at
     :logseq.property.attribute/kv-value :logseq.property.attribute/property-schema-classes :logseq.property.attribute/property-value-content})
 
+(def private-db-attribute-properties
+  "db-attribute properties that are not visible to user"
+  (->> db-attribute-properties
+       (remove #(get-in built-in-properties [% :schema :public?]))
+       set))
+
 (def read-only-properties
   "Property values that shouldn't be updated"
   #{:logseq.property/built-in?})