@geode/opengeodeweb-front 9.0.3 → 9.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/RemoteRenderingView.vue +23 -0
- package/package.json +6 -6
- package/stores/geode.js +22 -24
- package/test/components/CrsSelector.nuxt.test.js +1 -1
- package/test/stores/Geode.nuxt.test.js +21 -23
- package/test/stores/Infra.nuxt.test.js +2 -2
- package/test/stores/Viewer.nuxt.test.js +3 -3
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
<ClientOnly>
|
|
3
3
|
<div style="position: relative; width: 100%; height: 100%">
|
|
4
4
|
<view-toolbar />
|
|
5
|
+
<div
|
|
6
|
+
style="
|
|
7
|
+
position: absolute;
|
|
8
|
+
z-index: 2;
|
|
9
|
+
left: 0;
|
|
10
|
+
top: 0;
|
|
11
|
+
background-color: transparent;
|
|
12
|
+
border-radius: 16px;
|
|
13
|
+
"
|
|
14
|
+
>
|
|
15
|
+
<slot name="tree-object"></slot>
|
|
16
|
+
</div>
|
|
5
17
|
<v-col
|
|
6
18
|
ref="viewer"
|
|
7
19
|
style="
|
|
@@ -103,3 +115,14 @@
|
|
|
103
115
|
view.render()
|
|
104
116
|
}
|
|
105
117
|
</script>
|
|
118
|
+
|
|
119
|
+
<style scoped>
|
|
120
|
+
.list {
|
|
121
|
+
position: absolute;
|
|
122
|
+
z-index: 2;
|
|
123
|
+
left: 0;
|
|
124
|
+
top: 0;
|
|
125
|
+
background-color: transparent;
|
|
126
|
+
border-radius: 16px;
|
|
127
|
+
}
|
|
128
|
+
</style>
|
package/package.json
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
"geode_objects": "node scripts/generate_geode_objects.js && prettier ./assets/geode_objects.js --write"
|
|
8
8
|
},
|
|
9
9
|
"devDependencies": {
|
|
10
|
-
"@nuxt/test-utils": "^3.14.
|
|
11
|
-
"@pinia/testing": "^0.1.
|
|
12
|
-
"@vitejs/plugin-vue": "^5.1.
|
|
10
|
+
"@nuxt/test-utils": "^3.14.3",
|
|
11
|
+
"@pinia/testing": "^0.1.6",
|
|
12
|
+
"@vitejs/plugin-vue": "^5.1.4",
|
|
13
13
|
"@vitest/coverage-v8": "^1.6.0",
|
|
14
14
|
"@vue/test-utils": "^2.4.6",
|
|
15
15
|
"eslint": "^8.57.0",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"eslint-plugin-vuetify": "^2.4.0",
|
|
22
22
|
"happy-dom": "^14.12.0",
|
|
23
23
|
"jsdom": "^24.1.0",
|
|
24
|
-
"nuxt": "^3.
|
|
24
|
+
"nuxt": "^3.13.2",
|
|
25
25
|
"playwright-core": "^1.44.1",
|
|
26
26
|
"prettier": "3.3.2",
|
|
27
27
|
"resize-observer-polyfill": "^1.5.1",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"vite-plugin-vuetify": "^2.0.3",
|
|
30
30
|
"vitest": "^1.6.0",
|
|
31
31
|
"vitest-environment-nuxt": "^1.0.0",
|
|
32
|
-
"vuetify": "^3.
|
|
32
|
+
"vuetify": "^3.7.2",
|
|
33
33
|
"wslink": "1.12.4"
|
|
34
34
|
},
|
|
35
35
|
"overrides": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"description": "OpenSource Vue/Vuetify framework for web applications",
|
|
39
39
|
"type": "module",
|
|
40
|
-
"version": "9.0.
|
|
40
|
+
"version": "9.0.4",
|
|
41
41
|
"main": "./nuxt.config.js",
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@geode/opengeodeweb-back": "5.1.0",
|
package/stores/geode.js
CHANGED
|
@@ -10,20 +10,18 @@ export const use_geode_store = defineStore("geode", {
|
|
|
10
10
|
protocol() {
|
|
11
11
|
if (use_infra_store().is_cloud) {
|
|
12
12
|
return "https"
|
|
13
|
-
} else {
|
|
14
|
-
return "http"
|
|
15
13
|
}
|
|
14
|
+
return "http"
|
|
16
15
|
},
|
|
17
16
|
port() {
|
|
18
17
|
if (use_infra_store().is_cloud) {
|
|
19
18
|
return "443"
|
|
20
|
-
} else {
|
|
21
|
-
return this.default_local_port
|
|
22
19
|
}
|
|
20
|
+
return this.default_local_port
|
|
23
21
|
},
|
|
24
22
|
base_url() {
|
|
25
23
|
const infra_store = use_infra_store()
|
|
26
|
-
|
|
24
|
+
let geode_url = `${this.protocol}://${infra_store.domain_name}:${this.port}`
|
|
27
25
|
if (infra_store.is_cloud) {
|
|
28
26
|
if (infra_store.ID == "") {
|
|
29
27
|
throw new Error("ID must not be empty in cloud mode")
|
|
@@ -44,26 +42,26 @@ export const use_geode_store = defineStore("geode", {
|
|
|
44
42
|
}
|
|
45
43
|
}, 10 * 1000)
|
|
46
44
|
},
|
|
47
|
-
|
|
45
|
+
do_ping() {
|
|
46
|
+
const geode_store = this
|
|
48
47
|
const feedback_store = use_feedback_store()
|
|
49
|
-
return
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
})
|
|
48
|
+
return useFetch(back_schemas.opengeodeweb_back.ping.$id, {
|
|
49
|
+
baseURL: this.base_url,
|
|
50
|
+
method: back_schemas.opengeodeweb_back.ping.methods[0],
|
|
51
|
+
onRequestError({ error }) {
|
|
52
|
+
feedback_store.server_error = true
|
|
53
|
+
geode_store.is_running = false
|
|
54
|
+
},
|
|
55
|
+
onResponse({ response }) {
|
|
56
|
+
if (response.ok) {
|
|
57
|
+
feedback_store.server_error = false
|
|
58
|
+
geode_store.is_running = true
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
onResponseError({ response }) {
|
|
62
|
+
feedback_store.server_error = true
|
|
63
|
+
geode_store.is_running = false
|
|
64
|
+
},
|
|
67
65
|
})
|
|
68
66
|
},
|
|
69
67
|
start_request() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { setActivePinia } from "pinia"
|
|
2
2
|
import { createTestingPinia } from "@pinia/testing"
|
|
3
|
-
import { describe, test, expect, expectTypeOf, beforeEach } from "vitest"
|
|
3
|
+
import { describe, test, expect, expectTypeOf, beforeEach, vi } from "vitest"
|
|
4
4
|
import { registerEndpoint } from "@nuxt/test-utils/runtime"
|
|
5
5
|
import back_schemas from "@geode/opengeodeweb-back/schemas.json"
|
|
6
6
|
|
|
@@ -20,7 +20,7 @@ describe("Geode Store", () => {
|
|
|
20
20
|
})
|
|
21
21
|
|
|
22
22
|
describe("state", () => {
|
|
23
|
-
test("initial state",
|
|
23
|
+
test("initial state", () => {
|
|
24
24
|
expectTypeOf(geode_store.default_local_port).toBeString()
|
|
25
25
|
expectTypeOf(geode_store.request_counter).toBeNumber()
|
|
26
26
|
expectTypeOf(geode_store.is_running).toBeBoolean()
|
|
@@ -52,8 +52,8 @@ describe("Geode Store", () => {
|
|
|
52
52
|
|
|
53
53
|
test("test override default_local_port", () => {
|
|
54
54
|
infra_store.is_cloud = false
|
|
55
|
-
geode_store.default_local_port = "
|
|
56
|
-
expect(geode_store.port).toBe("
|
|
55
|
+
geode_store.default_local_port = "12"
|
|
56
|
+
expect(geode_store.port).toBe("12")
|
|
57
57
|
})
|
|
58
58
|
})
|
|
59
59
|
|
|
@@ -63,8 +63,7 @@ describe("Geode Store", () => {
|
|
|
63
63
|
infra_store.domain_name = "localhost"
|
|
64
64
|
expect(geode_store.base_url).toBe("http://localhost:5000")
|
|
65
65
|
})
|
|
66
|
-
|
|
67
|
-
test("test is_cloud true", async () => {
|
|
66
|
+
test("test is_cloud true", () => {
|
|
68
67
|
infra_store.is_cloud = true
|
|
69
68
|
infra_store.ID = "123456"
|
|
70
69
|
infra_store.domain_name = "example.com"
|
|
@@ -72,8 +71,7 @@ describe("Geode Store", () => {
|
|
|
72
71
|
"https://example.com:443/123456/geode",
|
|
73
72
|
)
|
|
74
73
|
})
|
|
75
|
-
|
|
76
|
-
test("test is_cloud true, ID empty", async () => {
|
|
74
|
+
test("test is_cloud true, ID empty", () => {
|
|
77
75
|
infra_store.is_cloud = true
|
|
78
76
|
infra_store.ID = ""
|
|
79
77
|
infra_store.domain_name = "example.com"
|
|
@@ -97,28 +95,28 @@ describe("Geode Store", () => {
|
|
|
97
95
|
|
|
98
96
|
describe("actions", () => {
|
|
99
97
|
describe("do_ping", () => {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
try {
|
|
103
|
-
await geode_store.do_ping()
|
|
104
|
-
} catch (e) {
|
|
105
|
-
console.log("e", e)
|
|
106
|
-
}
|
|
107
|
-
expect(geode_store.is_running).toBe(false)
|
|
108
|
-
expect(feedback_store.server_error).toBe(true)
|
|
109
|
-
})
|
|
98
|
+
const getFakeCall = vi.fn()
|
|
99
|
+
registerEndpoint(back_schemas.opengeodeweb_back.ping.$id, getFakeCall)
|
|
110
100
|
|
|
111
101
|
test("response", async () => {
|
|
112
102
|
geode_store.base_url = ""
|
|
113
|
-
|
|
114
|
-
registerEndpoint(back_schemas.opengeodeweb_back.ping.$id, {
|
|
115
|
-
method: "POST",
|
|
116
|
-
handler: () => ({}),
|
|
117
|
-
})
|
|
103
|
+
getFakeCall.mockImplementation(() => ({}))
|
|
118
104
|
await geode_store.do_ping()
|
|
119
105
|
expect(geode_store.is_running).toBe(true)
|
|
120
106
|
expect(feedback_store.server_error).toBe(false)
|
|
121
107
|
})
|
|
108
|
+
test("response_error", async () => {
|
|
109
|
+
geode_store.base_url = ""
|
|
110
|
+
getFakeCall.mockImplementation(() => {
|
|
111
|
+
throw createError({
|
|
112
|
+
status: 500,
|
|
113
|
+
})
|
|
114
|
+
})
|
|
115
|
+
|
|
116
|
+
await geode_store.do_ping()
|
|
117
|
+
expect(geode_store.is_running).toBe(false)
|
|
118
|
+
expect(feedback_store.server_error).toBe(true)
|
|
119
|
+
})
|
|
122
120
|
})
|
|
123
121
|
|
|
124
122
|
describe("start_request", () => {
|
|
@@ -105,14 +105,14 @@ describe("Infra Store", () => {
|
|
|
105
105
|
})
|
|
106
106
|
|
|
107
107
|
describe("actions", () => {
|
|
108
|
-
describe("create_connexion",
|
|
108
|
+
describe("create_connexion", () => {
|
|
109
109
|
test("test without end-point", async () => {
|
|
110
110
|
await infra_store.create_connexion()
|
|
111
111
|
expect(infra_store.is_connexion_launched).toBe(true)
|
|
112
112
|
expect(feedback_store.server_error).toBe(true)
|
|
113
113
|
})
|
|
114
114
|
})
|
|
115
|
-
describe("create_backend",
|
|
115
|
+
describe("create_backend", () => {
|
|
116
116
|
test("test without end-point", async () => {
|
|
117
117
|
await infra_store.create_backend()
|
|
118
118
|
expect(geode_store.is_running).toBe(false)
|
|
@@ -64,7 +64,7 @@ describe("Viewer Store", () => {
|
|
|
64
64
|
expect(viewer_store.base_url).toBe("ws://localhost:1234/ws")
|
|
65
65
|
})
|
|
66
66
|
|
|
67
|
-
test("test is_cloud true",
|
|
67
|
+
test("test is_cloud true", () => {
|
|
68
68
|
infra_store.is_cloud = true
|
|
69
69
|
infra_store.ID = "123456"
|
|
70
70
|
infra_store.domain_name = "example.com"
|
|
@@ -73,7 +73,7 @@ describe("Viewer Store", () => {
|
|
|
73
73
|
)
|
|
74
74
|
})
|
|
75
75
|
|
|
76
|
-
test("test is_cloud true, ID empty",
|
|
76
|
+
test("test is_cloud true, ID empty", () => {
|
|
77
77
|
infra_store.is_cloud = true
|
|
78
78
|
infra_store.ID = ""
|
|
79
79
|
infra_store.domain_name = "example.com"
|
|
@@ -95,7 +95,7 @@ describe("Viewer Store", () => {
|
|
|
95
95
|
})
|
|
96
96
|
describe("actions", () => {
|
|
97
97
|
// MISSING TEST ws_connect()
|
|
98
|
-
describe("toggle_picking_mode",
|
|
98
|
+
describe("toggle_picking_mode", () => {
|
|
99
99
|
test("test true", async () => {
|
|
100
100
|
await viewer_store.toggle_picking_mode(true)
|
|
101
101
|
expect(viewer_store.picking_mode).toBe(true)
|