mirror of
https://github.com/logseq/logseq.git
synced 2026-06-01 19:01:22 +00:00
fix: view edn export fails for group by
Fixes https://github.com/logseq/db-test/issues/300
This commit is contained in:
@@ -482,7 +482,7 @@
|
||||
(:name column))))))
|
||||
(shui/dropdown-menu-item
|
||||
{:key "export-edn"
|
||||
:on-click #(db-export-handler/export-view-nodes-data rows)}
|
||||
:on-click #(db-export-handler/export-view-nodes-data rows {:group-by? (some? group-by-property-ident)})}
|
||||
"Export EDN"))))))
|
||||
|
||||
(defn- get-column-size
|
||||
|
||||
@@ -23,10 +23,12 @@
|
||||
(notification/show! "Copied block's data!" :success)))
|
||||
(notification/show! "No block found" :warning)))
|
||||
|
||||
(defn export-view-nodes-data [node-ids]
|
||||
(defn export-view-nodes-data [rows {:keys [group-by?]}]
|
||||
(p/let [result (state/<invoke-db-worker :thread-api/export-edn
|
||||
(state/get-current-repo)
|
||||
{:export-type :view-nodes :node-ids node-ids})
|
||||
{:export-type :view-nodes
|
||||
:rows rows
|
||||
:group-by? group-by?})
|
||||
pull-data (with-out-str (pprint/pprint result))]
|
||||
(when-not (= :export-edn-error result)
|
||||
(.writeText js/navigator.clipboard pull-data)
|
||||
|
||||
@@ -681,6 +681,7 @@
|
||||
(sqlite-export/build-export @conn options)
|
||||
(catch :default e
|
||||
(js/console.error "export-edn error: " e)
|
||||
(js/console.error "Stack:\n" (.-stack e))
|
||||
(worker-util/post-message :notification
|
||||
["An unexpected error occurred during export. See the javascript console for details."
|
||||
:error])
|
||||
|
||||
Reference in New Issue
Block a user