Przeglądaj źródła

fix: hack so that file graphs all pages view loads

Gabriel Horner 1 rok temu
rodzic
commit
2ca6deeaec
1 zmienionych plików z 8 dodań i 5 usunięć
  1. 8 5
      src/main/frontend/components/views.cljs

+ 8 - 5
src/main/frontend/components/views.cljs

@@ -25,7 +25,8 @@
             [rum.core :as rum]
             [rum.core :as rum]
             [frontend.mixins :as mixins]
             [frontend.mixins :as mixins]
             [logseq.shui.table.core :as table-core]
             [logseq.shui.table.core :as table-core]
-            [logseq.db :as ldb]))
+            [logseq.db :as ldb]
+            [frontend.config :as config]))
 
 
 (defn- get-latest-entity
 (defn- get-latest-entity
   [e]
   [e]
@@ -125,9 +126,11 @@
   [config properties & {:keys [with-object-name? add-tags-column?]
   [config properties & {:keys [with-object-name? add-tags-column?]
                         :or {with-object-name? true
                         :or {with-object-name? true
                              add-tags-column? true}}]
                              add-tags-column? true}}]
-  (let [properties (if (or (some #(= (:db/ident %) :block/tags) properties) (not add-tags-column?))
-                     properties
-                     (conj properties (db/entity :block/tags)))]
+  (let [;; FIXME: Shouldn't file graphs have :block/tags?
+        add-tags-column?' (and (config/db-based-graph? (state/get-current-repo)) add-tags-column?)
+        properties' (if (or (some #(= (:db/ident %) :block/tags) properties) (not add-tags-column?'))
+                      properties
+                      (conj properties (db/entity :block/tags)))]
     (->> (concat
     (->> (concat
           [{:id :select
           [{:id :select
             :name "Select"
             :name "Select"
@@ -186,7 +189,7 @@
                     :get-value get-value
                     :get-value get-value
                     :get-value-for-sort get-value-for-sort
                     :get-value-for-sort get-value-for-sort
                     :type (:type property)}))))
                     :type (:type property)}))))
-           properties)
+           properties')
 
 
           [{:id :block/created-at
           [{:id :block/created-at
             :name (t :page/created-at)
             :name (t :page/created-at)