mirror of
https://github.com/logseq/logseq.git
synced 2026-04-27 23:54:55 +00:00
enhance: add title-format support for import
Fixes https://linear.app/logseq/issue/LOG-3219/import-journalpage-title-format-config. Part of https://github.com/logseq/db-test/issues/61
This commit is contained in:
@@ -120,7 +120,8 @@
|
||||
(defn- import-files-to-db
|
||||
"Import specific doc files for dev purposes"
|
||||
[files conn options]
|
||||
(p/let [doc-options (gp-exporter/build-doc-options {:macros {}} (merge default-export-options options))
|
||||
(p/let [doc-options (gp-exporter/build-doc-options (merge {:macros {}} (:user-config options))
|
||||
(merge default-export-options options))
|
||||
files' (mapv #(hash-map :path %) files)
|
||||
_ (gp-exporter/export-doc-files conn files' <read-file doc-options)]
|
||||
{:import-state (:import-state doc-options)}))
|
||||
@@ -524,3 +525,11 @@
|
||||
"Existing page correctly set as class parent")
|
||||
(is (= "Thing" (get-in (d/entity @conn :user.class/CreativeWork) [:logseq.property/parent :block/title]))
|
||||
"New page correctly set as class parent")))
|
||||
|
||||
(deftest-async export-config-file-sets-title-format
|
||||
(p/let [conn (db-test/create-conn)
|
||||
read-file #(p/do! (pr-str {:journal/page-title-format "yyyy-MM-dd"}))
|
||||
_ (gp-exporter/export-config-file conn "logseq/config.edn" read-file {})]
|
||||
(is (= "yyyy-MM-dd"
|
||||
(:logseq.property.journal/title-format (d/entity @conn :logseq.class/Journal)))
|
||||
"title format set correctly by config")))
|
||||
Reference in New Issue
Block a user