Browse Source

fix: importing property value that changes

from :date to :node. Should fix
https://github.com/logseq/db-test/issues/748
Gabriel Horner 2 weeks ago
parent
commit
4cc8ef3ce4

+ 2 - 0
deps/graph-parser/src/logseq/graph_parser/exporter.cljs

@@ -612,6 +612,8 @@
       ;; Change to :node as dates can be pages but pages can't be dates
       (= {:from :date :to :node} type-change)
       (do
+        (swap! upstream-properties assoc prop {:schema {:logseq.property/type :node}
+                                               :from-type :date})
         (swap! property-schemas assoc-in [prop :logseq.property/type] :node)
         (update-page-or-date-values page-names-to-uuids val))
 

+ 0 - 2
deps/graph-parser/test/resources/exporter-test-graph/journals/2024_02_16.md

@@ -1,8 +1,6 @@
 - test :dates
   startedAt:: [[Feb 6th, 2024]]
   finishedAt:: [[Feb 7th, 2024]]
-- test :date -> :node
-  finishedAt:: [[Gabriel]]
 - MEETING TITLE
   template:: meeting
   participants:: TODO

+ 3 - 1
deps/graph-parser/test/resources/exporter-test-graph/journals/2024_02_23.md

@@ -1,3 +1,5 @@
 - The Creator
   type:: [[Movie]]
-  testTagClass:: #Movie
+  testTagClass:: #Movie
+- test :date -> :node
+  finishedAt:: [[Gabriel]]