浏览代码

fix: remove unused code from #11494

Remove class-attrs b/c parent and class properties are now validated
through :block/properties
Gabriel Horner 1 年之前
父节点
当前提交
b8127dda14
共有 2 个文件被更改,包括 5 次插入19 次删除
  1. 5 10
      deps/db/src/logseq/db/frontend/malli_schema.cljs
  2. 0 9
      deps/outliner/src/logseq/outliner/property.cljs

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

@@ -242,11 +242,6 @@
     page-attrs
     page-or-block-attrs)))
 
-(def class-attrs
-  [[:db/ident class-ident]
-   [:logseq.property/parent {:optional true} :int]
-   [:logseq.property.class/properties {:optional true} [:set :int]]])
-
 (def class-page
   (vec
    (concat
@@ -254,8 +249,8 @@
      [:block/schema
       {:optional true}
       [:map
-       [:properties {:optional true} [:vector property-ident]]]]]
-    class-attrs
+       [:properties {:optional true} [:vector property-ident]]]]
+     [:db/ident class-ident]]
     page-attrs
     page-or-block-attrs)))
 
@@ -465,7 +460,7 @@
 
 ;; Keep malli schema in sync with db schema
 ;; ========================================
-(let [malli-many-ref-attrs (->> (concat class-attrs property-attrs page-attrs block-attrs page-or-block-attrs (rest closed-value-block*))
+(let [malli-many-ref-attrs (->> (concat property-attrs page-attrs block-attrs page-or-block-attrs (rest closed-value-block*))
                                 (filter #(= (last %) [:set :int]))
                                 (map first)
                                 set)]
@@ -474,7 +469,7 @@
                          (string/join ", " undeclared-ref-attrs))
                     {}))))
 
-(let [malli-one-ref-attrs (->> (concat class-attrs property-attrs page-attrs block-attrs page-or-block-attrs (rest normal-page))
+(let [malli-one-ref-attrs (->> (concat property-attrs page-attrs block-attrs page-or-block-attrs (rest normal-page))
                                (filter #(= (last %) :int))
                                (map first)
                                set)
@@ -484,7 +479,7 @@
                          (string/join ", " undeclared-ref-attrs))
                     {}))))
 
-(let [malli-non-ref-attrs (->> (concat class-attrs property-attrs page-attrs block-attrs page-or-block-attrs (rest normal-page))
+(let [malli-non-ref-attrs (->> (concat property-attrs page-attrs block-attrs page-or-block-attrs (rest normal-page))
                                (concat (rest file-block) (rest asset-block) (rest property-value-block)
                                        (rest db-ident-key-val) (rest class-page))
                                (remove #(= (last %) [:set :int]))

+ 0 - 9
deps/outliner/src/logseq/outliner/property.cljs

@@ -391,15 +391,6 @@
          (ldb/sort-by-order)
          (map :db/ident))))
 
-(defn block-has-viewable-properties?
-  [block-entity]
-  (let [properties (->> (keys (:block/properties block-entity))
-                        (remove #{:logseq.property/icon :logseq.property/built-in?}))]
-    (or
-     (seq (:block/alias block-entity))
-     (seq (:block/tags block-entity))
-     (seq properties))))
-
 (defn- build-closed-value-tx
   [db property resolved-value {:keys [id icon]}]
   (let [block (when id (d/entity db [:block/uuid id]))