@@ -8,6 +8,7 @@ import { useAppStore } from "@ogw_front/stores/app";
88import { useBackStore } from "@ogw_front/stores/back" ;
99import { useDataStore } from "@ogw_front/stores/data" ;
1010import { useDataStyleStore } from "@ogw_front/stores/data_style" ;
11+ import { useFeedbackStore } from "@ogw_front/stores/feedback" ;
1112import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer" ;
1213import { useTreeviewStore } from "@ogw_front/stores/treeview" ;
1314import { useViewerStore } from "@ogw_front/stores/viewer" ;
@@ -16,6 +17,7 @@ async function exportProject() {
1617 console . log ( "[export triggered]" ) ;
1718 const appStore = useAppStore ( ) ;
1819 const backStore = useBackStore ( ) ;
20+ const feedbackStore = useFeedbackStore ( ) ;
1921 const snapshot = await appStore . exportStores ( ) ;
2022 const schema = back_schemas . opengeodeweb_back . export_project ;
2123 const defaultName = "project.vease" ;
@@ -26,6 +28,7 @@ async function exportProject() {
2628 body : { snapshot, filename : defaultName } ,
2729 } ) ;
2830 fileDownload ( result , defaultName ) ;
31+ feedbackStore . add_success ( "Project exported successfully" ) ;
2932 return { result } ;
3033}
3134
@@ -73,23 +76,20 @@ async function importProject(file) {
7376 await client2 . getConnection ( ) . getSession ( ) . call ( "opengeodeweb_viewer.import_project" , [ { } ] ) ;
7477 }
7578
76- await treeviewStore . importStores ( snapshot . treeview || { } ) ;
79+ await treeviewStore . importStores ( snapshot . treeview ) ;
80+ await dataStore . importStores ( snapshot . data ) ;
7781 await hybridViewerStore . initHybridViewer ( ) ;
78- await hybridViewerStore . importStores ( snapshot . hybridViewer || { } ) ;
7982
8083 const items = snapshot ?. data ?. items || [ ] ;
81-
8284 await importWorkflowFromSnapshot ( items ) ;
83- await hybridViewerStore . importStores ( snapshot . hybridViewer || { } ) ;
84- {
85- await dataStyleStore . importStores ( snapshot . dataStyle || { } ) ;
86- }
87- {
88- await dataStyleStore . applyAllStylesFromState ( ) ;
89- }
85+ await hybridViewerStore . importStores ( snapshot . hybridViewer ) ;
86+ await dataStyleStore . importStores ( snapshot . dataStyle ) ;
87+ await dataStyleStore . applyAllStylesFromState ( ) ;
9088
9189 treeviewStore . finalizeImportSelection ( ) ;
9290 treeviewStore . isImporting = false ;
91+ const feedbackStore = useFeedbackStore ( ) ;
92+ feedbackStore . add_success ( "Project imported successfully" ) ;
9393}
9494
9595export { exportProject , importProject } ;
0 commit comments