chore: convert last of frontend tests to db graphs

Now able to remove unused frontend.test.* namespaces.
Also removed file-graph specific handling of old attrs like
:block/ref-pages
This commit is contained in:
Gabriel Horner
2026-01-07 15:15:23 -05:00
parent 96a9f95622
commit 6c876a0be2
30 changed files with 108 additions and 434 deletions

View File

@@ -53,13 +53,4 @@
(:init-db? tx-meta))
(conn/transact! repo tx-data tx-meta))
(ui-outliner-tx/transact! tx-meta
(outliner-op/transact! tx-data tx-meta)))))
(defn set-file-content!
([repo path content]
(set-file-content! repo path content {}))
([repo path content opts]
(when (and repo path)
(let [tx-data {:file/path path
:file/content content}]
(transact! repo [tx-data] opts)))))
(outliner-op/transact! tx-data tx-meta)))))

View File

@@ -10,7 +10,6 @@
[frontend.util.text :as text-util]
[logseq.common.util :as common-util]
[logseq.db :as ldb]
[logseq.db.file-based.schema :as file-schema]
[logseq.db.frontend.schema :as db-schema]
[logseq.graph-parser.text :as text]))
@@ -81,9 +80,7 @@
(start! repo {}))
([repo {:keys [listen-handler]}]
(let [db-name (db-conn-state/get-repo-path repo)
db-conn (if (config/db-based-graph? repo)
(d/create-conn db-schema/schema)
(d/create-conn file-schema/schema))]
db-conn (d/create-conn db-schema/schema)]
(destroy-all!)
(swap! conns assoc db-name db-conn)
(when listen-handler

View File

@@ -66,14 +66,6 @@
(walk/postwalk
(fn [f]
(cond
;; backward compatible
;; 1. replace :page/ => :block/
(and (keyword? f) (= "page" (namespace f)))
(keyword "block" (name f))
(and (keyword? f) (contains? #{:block/ref-pages :block/ref-blocks} f))
:block/refs
(and (list? f)
(= (first f) '=)
(= 3 (count f))

View File

@@ -126,9 +126,6 @@
_ (<ensure-dir! containing-dir)
_ (js/window.pfs.writeFile fpath content)]
;; TODO: store file metadata
;; (db/set-file-content! repo rpath content)
;; (db/set-file-last-modified-at! repo rpath (js/Date.))
))
(rename! [_this _repo old-path new-path]
(let [old-path (path/url-to-path old-path)

View File

@@ -21,11 +21,6 @@
[]
(path/path-join @root-dir "config"))
(defn safe-global-config-dir
"Fetch config dir in a general context, not just for global config"
[]
(when @root-dir (global-config-dir)))
(defn global-config-path
"Fetch config path in a global config context"
[]

View File

@@ -1978,13 +1978,6 @@ Similar to re-frame subscriptions"
(defn get-auth-refresh-token []
(:auth/refresh-token @state))
(defn set-parsing-state!
"Leave for tests"
[m]
(update-state! [:graph/parsing-state (get-current-repo)]
(if (fn? m) m
(fn [old-value] (merge old-value m)))))
(defn http-proxy-enabled-or-val? []
(when-let [{:keys [type protocol host port] :as agent-opts} (sub [:electron/user-cfgs :settings/agent])]
(when (and (not (contains? #{"system"} type))