Skip to content

Commit 5f3e0c6

Browse files
committed
Merge branch 'feat/save_and_load' of https://github.com/Geode-solutions/OpenGeodeWeb-Front into feat/save_and_load
2 parents f4ef491 + 5b2b4f3 commit 5f3e0c6

File tree

6 files changed

+20
-10
lines changed

6 files changed

+20
-10
lines changed

plugins/projectManager.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ export default defineNuxtPlugin(() => {
77

88
async function exportProject() {
99
const snapshot = appStore.save()
10-
const blob = new Blob([JSON.stringify(snapshot)], { type: "application/json" })
10+
const blob = new Blob([JSON.stringify(snapshot)], {
11+
type: "application/json",
12+
})
1113
const url = URL.createObjectURL(blob)
1214
const a = document.createElement("a")
1315
a.href = url
@@ -25,7 +27,7 @@ export default defineNuxtPlugin(() => {
2527

2628
return {
2729
provide: {
28-
project: { export: exportProject, importFile: importProjectFile }
29-
}
30+
project: { export: exportProject, importFile: importProjectFile },
31+
},
3032
}
31-
})
33+
})

stores/app_store.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ export const useAppStore = defineStore("app", () => {
4848
const notFoundStores = []
4949

5050
for (const store of stores) {
51-
if (!store.load)
52-
continue
51+
if (!store.load) continue
5352

5453
const storeId = store.$id
5554

stores/treeview.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@ export const useTreeviewStore = defineStore("treeview", () => {
1212
const selectedTree = ref(null)
1313

1414
/** Functions **/
15-
function addItem(geodeObject, displayed_name, id, object_type, autoSelect = true) {
15+
function addItem(
16+
geodeObject,
17+
displayed_name,
18+
id,
19+
object_type,
20+
autoSelect = true,
21+
) {
1622
dataStyleStore.addDataStyle(id, geodeObject, object_type)
1723
const child = { title: displayed_name, id, object_type }
1824
for (let i = 0; i < items.value.length; i++) {

tests/unit/ProjectManager.nuxt.test.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ describe("ProjectManager plugin", () => {
6060
const snapshot = JSON.parse(raw)
6161
await mockInfraStore.create_connection()
6262
viewer_call({})
63-
console.log("[TEST] viewer_call:", viewer_call.mock?.calls, viewer_call.mock?.calls?.length || 0)
63+
console.log(
64+
"[TEST] viewer_call:",
65+
viewer_call.mock?.calls,
66+
viewer_call.mock?.calls?.length || 0,
67+
)
6468
await mockAppStore.load(snapshot)
6569
}
6670

tests/unit/stores/Appstore.nuxt.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ describe("App Store", () => {
135135
userStore: { some: "data" },
136136
geodeStore: { other: "data" },
137137
}
138-
138+
139139
await appStore.load(snapshot)
140140
expect(userStore.load).toHaveBeenCalledTimes(1)
141141
expect(geodeStore.load).toHaveBeenCalledTimes(1)

tests/unit/stores/ProjectLoad.nuxt.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ vi.mock("@/stores/hybrid_viewer.js", () => ({
2323
}),
2424
}))
2525

26-
2726
beforeEach(() => setActivePinia(createPinia()))
2827

2928
describe("Project load", () => {

0 commit comments

Comments
 (0)