Browse Source

chore: cleanup after #11858

Remove unused fn
Gabriel Horner 8 months ago
parent
commit
c28fe3194c

+ 2 - 15
deps/db/src/logseq/db/common/property_util.cljs

@@ -1,30 +1,17 @@
 (ns logseq.db.common.property-util
   "Property related util fns. Fns used in both DB and file graphs should go here"
   (:require [datascript.core :as d]
-            [logseq.db.common.entity-plus :as entity-plus]
             [logseq.db.frontend.property :as db-property]
             [logseq.db.sqlite.util :as sqlite-util]))
 
-(defn- get-file-pid-by-ident
-  [db-ident]
-  (get-in db-property/built-in-properties [db-ident :name] (name db-ident)))
-
-;; TODO: refactor later to remove this fn
+;; TODO: replace repo with db later to remove this fn
 (defn get-pid
   "Get a built-in property's id (keyword name for file graph and db-ident for db
   graph) given its db-ident. No need to use this fn in a db graph only context"
   [repo db-ident]
   (if (sqlite-util/db-based-graph? repo)
     db-ident
-    (get-file-pid-by-ident db-ident)))
-
-(defn get-pid-2
-  "Get a built-in property's id (keyword name for file graph and db-ident for db
-  graph) given its db-ident. No need to use this fn in a db graph only context"
-  [db db-ident]
-  (if (entity-plus/db-based-graph? db)
-    db-ident
-    (get-file-pid-by-ident db-ident)))
+    (get-in db-property/built-in-properties [db-ident :name] (name db-ident))))
 
 (defn lookup
   "Get the property value by a built-in property's db-ident from coll. For file and db graphs"

+ 5 - 7
src/main/frontend/common/graph_view.cljs

@@ -5,7 +5,6 @@
             [datascript.core :as d]
             [logseq.common.util :as common-util]
             [logseq.db :as ldb]
-            [logseq.db.common.property-util :as db-property-util]
             [logseq.db.common.entity-plus :as entity-plus]
             [logseq.db.sqlite.create-graph :as sqlite-create-graph]
             [logseq.graph-parser.db :as gp-db]))
@@ -85,7 +84,7 @@
         db-based? (entity-plus/db-based-graph? db)
         created-ats (map :block/created-at full-pages)
 
-            ;; build up nodes
+        ;; build up nodes
         full-pages'
         (cond->> full-pages
           created-at-filter
@@ -93,11 +92,10 @@
           (not journal?)
           (remove ldb/journal?)
           (not excluded-pages?)
-          (remove (fn [p] (true? 
-                             (if db-based?
-                               (get p (db-property-util/get-pid-2 db :logseq.property/exclude-from-graph-view))
-                               (let [props (get p :block/properties)]
-                                 (get props :exclude-from-graph-view)))))))
+          (remove (fn [p] (true?
+                           (if db-based?
+                             (get p :logseq.property/exclude-from-graph-view)
+                             (get-in p [:block/properties :exclude-from-graph-view]))))))
         links (concat relation tagged-pages namespaces)
         linked (set (mapcat identity links))
         build-in-pages (->> (if db-based? sqlite-create-graph/built-in-pages-names gp-db/built-in-pages-names)