@geode/opengeodeweb-front 10.20.1 → 10.21.0-rc.2
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/app/components/CrsSelector.vue +3 -3
- package/app/components/ExtensionSelector.vue +3 -3
- package/app/components/FileSelector.vue +3 -3
- package/app/components/FileUploader.vue +4 -4
- package/app/components/Inspector/InspectionButton.vue +3 -3
- package/app/components/Loading.vue +27 -0
- package/app/components/MissingFilesSelector.vue +3 -3
- package/app/components/ObjectSelector.vue +3 -3
- package/app/components/PackagesVersions.vue +4 -4
- package/app/components/Viewer/ObjectTree/Layout.vue +6 -3
- package/app/components/Viewer/ObjectTree/Views/GlobalObjects.vue +47 -1
- package/app/components/Viewer/ObjectTree/Views/ModelCollections.vue +222 -0
- package/app/components/Viewer/ObjectTree/Views/ModelComponents.vue +10 -4
- package/app/components/Viewer/Options/AttributeSelector.vue +3 -3
- package/app/components/Viewer/Options/TextureItem.vue +4 -4
- package/app/composables/model_collections.js +72 -0
- package/app/composables/model_components.js +5 -1
- package/app/composables/project_manager.js +5 -5
- package/app/composables/virtual_tree.js +8 -7
- package/app/stores/{geode.js → back.js} +16 -1
- package/app/stores/data.js +39 -111
- package/app/stores/data_helpers/collections.js +102 -0
- package/app/stores/data_helpers/mesh.js +122 -0
- package/app/stores/treeview.js +18 -8
- package/app/stores/viewer.js +18 -0
- package/app/utils/extension.js +0 -2
- package/app/utils/import_workflow.js +3 -3
- package/internal/stores/hybrid_viewer_camera_animation.js +24 -2
- package/package.json +3 -3
- package/tests/integration/setup.js +3 -3
- package/tests/unit/components/CrsSelector.nuxt.test.js +6 -6
- package/tests/unit/components/ExtensionSelector.nuxt.test.js +4 -4
- package/tests/unit/components/FileSelector.nuxt.test.js +3 -3
- package/tests/unit/components/FileUploader.nuxt.test.js +3 -3
- package/tests/unit/components/Inspector/InspectionButton.nuxt.test.js +4 -4
- package/tests/unit/components/MissingFilesSelector.nuxt.test.js +4 -4
- package/tests/unit/components/ObjectSelector.nuxt.test.js +3 -3
- package/tests/unit/components/PackagesVersions.nuxt.test.js +3 -3
- package/tests/unit/composables/api_fetch.nuxt.test.js +9 -9
- package/tests/unit/composables/project_manager.nuxt.test.js +3 -3
- package/tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js +7 -7
- package/tests/unit/composables/upload_file.nuxt.test.js +7 -7
- package/tests/unit/stores/app.nuxt.test.js +9 -9
- package/tests/unit/stores/{geode.nuxt.test.js → back.nuxt.test.js} +43 -43
- package/tests/unit/stores/infra.nuxt.test.js +34 -34
|
@@ -7,7 +7,7 @@ import { registerEndpoint } from "@nuxt/test-utils/runtime";
|
|
|
7
7
|
import { Status } from "@ogw_front/utils/status";
|
|
8
8
|
import { appMode } from "@ogw_front/utils/local/app_mode";
|
|
9
9
|
import { setupActivePinia } from "@ogw_tests/utils";
|
|
10
|
-
import {
|
|
10
|
+
import { useBackStore } from "@ogw_front/stores/back";
|
|
11
11
|
import { useInfraStore } from "@ogw_front/stores/infra";
|
|
12
12
|
|
|
13
13
|
// CONSTANTS
|
|
@@ -18,91 +18,91 @@ const STATUS_500 = 500;
|
|
|
18
18
|
const EXPECTED_ONE_REQUEST = 1;
|
|
19
19
|
const EXPECTED_NO_REQUEST = 0;
|
|
20
20
|
|
|
21
|
-
describe("
|
|
21
|
+
describe("back store", () => {
|
|
22
22
|
beforeEach(() => {
|
|
23
23
|
setupActivePinia();
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
test("state", () => {
|
|
27
|
-
const
|
|
28
|
-
expectTypeOf(
|
|
29
|
-
expectTypeOf(
|
|
30
|
-
expectTypeOf(
|
|
27
|
+
const backStore = useBackStore();
|
|
28
|
+
expectTypeOf(backStore.default_local_port).toBeString();
|
|
29
|
+
expectTypeOf(backStore.request_counter).toBeNumber();
|
|
30
|
+
expectTypeOf(backStore.status).toBeString();
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
describe("protocol", () => {
|
|
34
34
|
test("app_mode CLOUD", () => {
|
|
35
35
|
const infraStore = useInfraStore();
|
|
36
|
-
const
|
|
36
|
+
const backStore = useBackStore();
|
|
37
37
|
infraStore.app_mode = appMode.CLOUD;
|
|
38
|
-
expect(
|
|
38
|
+
expect(backStore.protocol).toBe("https");
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
test("app_mode BROWSER/DESKTOP", () => {
|
|
42
42
|
const infraStore = useInfraStore();
|
|
43
|
-
const
|
|
43
|
+
const backStore = useBackStore();
|
|
44
44
|
infraStore.app_mode = appMode.BROWSER;
|
|
45
|
-
expect(
|
|
45
|
+
expect(backStore.protocol).toBe("http");
|
|
46
46
|
infraStore.app_mode = appMode.DESKTOP;
|
|
47
|
-
expect(
|
|
47
|
+
expect(backStore.protocol).toBe("http");
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
50
|
|
|
51
51
|
describe("port", () => {
|
|
52
52
|
test("app_mode CLOUD", () => {
|
|
53
53
|
const infraStore = useInfraStore();
|
|
54
|
-
const
|
|
54
|
+
const backStore = useBackStore();
|
|
55
55
|
infraStore.app_mode = appMode.CLOUD;
|
|
56
|
-
expect(
|
|
56
|
+
expect(backStore.port).toBe(PORT_443);
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
test("app_mode BROWSER/DESKTOP", () => {
|
|
60
60
|
const infraStore = useInfraStore();
|
|
61
|
-
const
|
|
61
|
+
const backStore = useBackStore();
|
|
62
62
|
infraStore.app_mode = appMode.BROWSER;
|
|
63
|
-
expect(
|
|
63
|
+
expect(backStore.port).toBe(backStore.default_local_port);
|
|
64
64
|
infraStore.app_mode = appMode.DESKTOP;
|
|
65
|
-
expect(
|
|
65
|
+
expect(backStore.port).toBe(backStore.default_local_port);
|
|
66
66
|
});
|
|
67
67
|
|
|
68
68
|
test("override default_local_port", () => {
|
|
69
69
|
const infraStore = useInfraStore();
|
|
70
|
-
const
|
|
70
|
+
const backStore = useBackStore();
|
|
71
71
|
infraStore.app_mode = appMode.DESKTOP;
|
|
72
|
-
|
|
73
|
-
expect(
|
|
72
|
+
backStore.default_local_port = PORT_12;
|
|
73
|
+
expect(backStore.port).toBe(PORT_12);
|
|
74
74
|
});
|
|
75
75
|
});
|
|
76
76
|
|
|
77
77
|
describe("base_url", () => {
|
|
78
78
|
test("app_mode BROWSER", () => {
|
|
79
79
|
const infraStore = useInfraStore();
|
|
80
|
-
const
|
|
80
|
+
const backStore = useBackStore();
|
|
81
81
|
infraStore.app_mode = appMode.BROWSER;
|
|
82
82
|
infraStore.domain_name = "localhost";
|
|
83
|
-
expect(
|
|
83
|
+
expect(backStore.base_url).toBe(`http://localhost:${PORT_5000}`);
|
|
84
84
|
});
|
|
85
85
|
|
|
86
86
|
test("app_mode CLOUD", () => {
|
|
87
87
|
const infraStore = useInfraStore();
|
|
88
|
-
const
|
|
88
|
+
const backStore = useBackStore();
|
|
89
89
|
infraStore.app_mode = appMode.CLOUD;
|
|
90
90
|
infraStore.domain_name = "example.com";
|
|
91
|
-
expect(
|
|
91
|
+
expect(backStore.base_url).toBe(`https://example.com:${PORT_443}/geode`);
|
|
92
92
|
});
|
|
93
93
|
});
|
|
94
94
|
|
|
95
95
|
describe("is_busy", () => {
|
|
96
96
|
test("is_busy", () => {
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
expect(
|
|
97
|
+
const backStore = useBackStore();
|
|
98
|
+
backStore.request_counter = EXPECTED_ONE_REQUEST;
|
|
99
|
+
expect(backStore.is_busy).toBe(true);
|
|
100
100
|
});
|
|
101
101
|
|
|
102
102
|
test("not is_busy", () => {
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
expect(
|
|
103
|
+
const backStore = useBackStore();
|
|
104
|
+
backStore.request_counter = EXPECTED_NO_REQUEST;
|
|
105
|
+
expect(backStore.is_busy).toBe(false);
|
|
106
106
|
});
|
|
107
107
|
});
|
|
108
108
|
});
|
|
@@ -116,32 +116,32 @@ describe("geode store actions", () => {
|
|
|
116
116
|
|
|
117
117
|
describe("ping", () => {
|
|
118
118
|
test("response", async () => {
|
|
119
|
-
const
|
|
120
|
-
|
|
119
|
+
const backStore = useBackStore();
|
|
120
|
+
backStore.base_url = "";
|
|
121
121
|
getFakeCall.mockReturnValue({});
|
|
122
|
-
await
|
|
123
|
-
expect(
|
|
122
|
+
await backStore.ping();
|
|
123
|
+
expect(backStore.status).toBe(Status.CONNECTED);
|
|
124
124
|
});
|
|
125
125
|
|
|
126
126
|
test("response_error", async () => {
|
|
127
|
-
const
|
|
128
|
-
|
|
127
|
+
const backStore = useBackStore();
|
|
128
|
+
backStore.base_url = "";
|
|
129
129
|
getFakeCall.mockImplementation(() => {
|
|
130
130
|
throw createError({ status: STATUS_500 });
|
|
131
131
|
});
|
|
132
|
-
await expect(
|
|
133
|
-
expect(
|
|
132
|
+
await expect(backStore.ping()).rejects.toThrow("500");
|
|
133
|
+
expect(backStore.status).toBe(Status.NOT_CONNECTED);
|
|
134
134
|
});
|
|
135
135
|
});
|
|
136
136
|
|
|
137
137
|
describe("request counter", () => {
|
|
138
138
|
test("increment/decrement", async () => {
|
|
139
|
-
const
|
|
140
|
-
expect(
|
|
141
|
-
await
|
|
142
|
-
expect(
|
|
143
|
-
await
|
|
144
|
-
expect(
|
|
139
|
+
const backStore = useBackStore();
|
|
140
|
+
expect(backStore.request_counter).toBe(EXPECTED_NO_REQUEST);
|
|
141
|
+
await backStore.start_request();
|
|
142
|
+
expect(backStore.request_counter).toBe(EXPECTED_ONE_REQUEST);
|
|
143
|
+
await backStore.stop_request();
|
|
144
|
+
expect(backStore.request_counter).toBe(EXPECTED_NO_REQUEST);
|
|
145
145
|
});
|
|
146
146
|
});
|
|
147
147
|
});
|
|
@@ -6,7 +6,7 @@ import { registerEndpoint } from "@nuxt/test-utils/runtime";
|
|
|
6
6
|
import { Status } from "@ogw_front/utils/status";
|
|
7
7
|
import { appMode } from "@ogw_front/utils/local/app_mode";
|
|
8
8
|
import { setupActivePinia } from "@ogw_tests/utils";
|
|
9
|
-
import {
|
|
9
|
+
import { useBackStore } from "@ogw_front/stores/back";
|
|
10
10
|
import { useInfraStore } from "@ogw_front/stores/infra";
|
|
11
11
|
import { useViewerStore } from "@ogw_front/stores/viewer";
|
|
12
12
|
|
|
@@ -70,10 +70,10 @@ describe("infra store", () => {
|
|
|
70
70
|
|
|
71
71
|
test("geode false & viewer false", () => {
|
|
72
72
|
const infraStore = useInfraStore();
|
|
73
|
-
const
|
|
73
|
+
const backStore = useBackStore();
|
|
74
74
|
const viewerStore = useViewerStore();
|
|
75
75
|
|
|
76
|
-
infraStore.register_microservice(
|
|
76
|
+
infraStore.register_microservice(backStore, {
|
|
77
77
|
request: vi.fn(),
|
|
78
78
|
connect: vi.fn(),
|
|
79
79
|
launch: vi.fn(),
|
|
@@ -84,17 +84,17 @@ describe("infra store", () => {
|
|
|
84
84
|
launch: vi.fn(),
|
|
85
85
|
});
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
backStore.$patch({ status: Status.NOT_CONNECTED });
|
|
88
88
|
viewerStore.$patch({ status: Status.NOT_CONNECTED });
|
|
89
89
|
expect(infraStore.microservices_connected).toBe(false);
|
|
90
90
|
});
|
|
91
91
|
|
|
92
92
|
test("geode true & viewer false", () => {
|
|
93
93
|
const infraStore = useInfraStore();
|
|
94
|
-
const
|
|
94
|
+
const backStore = useBackStore();
|
|
95
95
|
const viewerStore = useViewerStore();
|
|
96
96
|
|
|
97
|
-
infraStore.register_microservice(
|
|
97
|
+
infraStore.register_microservice(backStore, {
|
|
98
98
|
request: vi.fn(),
|
|
99
99
|
connect: vi.fn(),
|
|
100
100
|
launch: vi.fn(),
|
|
@@ -105,17 +105,17 @@ describe("infra store", () => {
|
|
|
105
105
|
launch: vi.fn(),
|
|
106
106
|
});
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
backStore.$patch({ status: Status.CONNECTED });
|
|
109
109
|
viewerStore.$patch({ status: Status.NOT_CONNECTED });
|
|
110
110
|
expect(infraStore.microservices_connected).toBe(false);
|
|
111
111
|
});
|
|
112
112
|
|
|
113
113
|
test("geode false & viewer true", () => {
|
|
114
114
|
const infraStore = useInfraStore();
|
|
115
|
-
const
|
|
115
|
+
const backStore = useBackStore();
|
|
116
116
|
const viewerStore = useViewerStore();
|
|
117
117
|
|
|
118
|
-
infraStore.register_microservice(
|
|
118
|
+
infraStore.register_microservice(backStore, {
|
|
119
119
|
request: vi.fn(),
|
|
120
120
|
connect: vi.fn(),
|
|
121
121
|
launch: vi.fn(),
|
|
@@ -126,17 +126,17 @@ describe("infra store", () => {
|
|
|
126
126
|
launch: vi.fn(),
|
|
127
127
|
});
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
backStore.$patch({ status: Status.NOT_CONNECTED });
|
|
130
130
|
viewerStore.$patch({ status: Status.CONNECTED });
|
|
131
131
|
expect(infraStore.microservices_connected).toBe(false);
|
|
132
132
|
});
|
|
133
133
|
|
|
134
134
|
test("geode true & viewer true", () => {
|
|
135
135
|
const infraStore = useInfraStore();
|
|
136
|
-
const
|
|
136
|
+
const backStore = useBackStore();
|
|
137
137
|
const viewerStore = useViewerStore();
|
|
138
138
|
|
|
139
|
-
infraStore.register_microservice(
|
|
139
|
+
infraStore.register_microservice(backStore, {
|
|
140
140
|
request: vi.fn(),
|
|
141
141
|
connect: vi.fn(),
|
|
142
142
|
launch: vi.fn(),
|
|
@@ -147,7 +147,7 @@ describe("infra store", () => {
|
|
|
147
147
|
launch: vi.fn(),
|
|
148
148
|
});
|
|
149
149
|
|
|
150
|
-
|
|
150
|
+
backStore.$patch({ status: Status.CONNECTED });
|
|
151
151
|
viewerStore.$patch({ status: Status.CONNECTED });
|
|
152
152
|
expect(infraStore.microservices_connected).toBe(true);
|
|
153
153
|
});
|
|
@@ -161,10 +161,10 @@ describe("infra store", () => {
|
|
|
161
161
|
|
|
162
162
|
test("geode false & viewer false", () => {
|
|
163
163
|
const infraStore = useInfraStore();
|
|
164
|
-
const
|
|
164
|
+
const backStore = useBackStore();
|
|
165
165
|
const viewerStore = useViewerStore();
|
|
166
166
|
|
|
167
|
-
infraStore.register_microservice(
|
|
167
|
+
infraStore.register_microservice(backStore, {
|
|
168
168
|
request: vi.fn(),
|
|
169
169
|
connect: vi.fn(),
|
|
170
170
|
launch: vi.fn(),
|
|
@@ -175,17 +175,17 @@ describe("infra store", () => {
|
|
|
175
175
|
launch: vi.fn(),
|
|
176
176
|
});
|
|
177
177
|
|
|
178
|
-
|
|
178
|
+
backStore.$patch({ request_counter: 0 });
|
|
179
179
|
viewerStore.$patch({ request_counter: 0 });
|
|
180
180
|
expect(infraStore.microservices_busy).toBe(false);
|
|
181
181
|
});
|
|
182
182
|
|
|
183
183
|
test("geode true & viewer false", () => {
|
|
184
184
|
const infraStore = useInfraStore();
|
|
185
|
-
const
|
|
185
|
+
const backStore = useBackStore();
|
|
186
186
|
const viewerStore = useViewerStore();
|
|
187
187
|
|
|
188
|
-
infraStore.register_microservice(
|
|
188
|
+
infraStore.register_microservice(backStore, {
|
|
189
189
|
request: vi.fn(),
|
|
190
190
|
connect: vi.fn(),
|
|
191
191
|
launch: vi.fn(),
|
|
@@ -196,17 +196,17 @@ describe("infra store", () => {
|
|
|
196
196
|
launch: vi.fn(),
|
|
197
197
|
});
|
|
198
198
|
|
|
199
|
-
|
|
199
|
+
backStore.$patch({ request_counter: 1 });
|
|
200
200
|
viewerStore.$patch({ request_counter: 0 });
|
|
201
201
|
expect(infraStore.microservices_busy).toBe(true);
|
|
202
202
|
});
|
|
203
203
|
|
|
204
204
|
test("geode false & viewer true", () => {
|
|
205
205
|
const infraStore = useInfraStore();
|
|
206
|
-
const
|
|
206
|
+
const backStore = useBackStore();
|
|
207
207
|
const viewerStore = useViewerStore();
|
|
208
208
|
|
|
209
|
-
infraStore.register_microservice(
|
|
209
|
+
infraStore.register_microservice(backStore, {
|
|
210
210
|
request: vi.fn(),
|
|
211
211
|
connect: vi.fn(),
|
|
212
212
|
launch: vi.fn(),
|
|
@@ -217,17 +217,17 @@ describe("infra store", () => {
|
|
|
217
217
|
launch: vi.fn(),
|
|
218
218
|
});
|
|
219
219
|
|
|
220
|
-
|
|
220
|
+
backStore.$patch({ request_counter: 0 });
|
|
221
221
|
viewerStore.$patch({ request_counter: 1 });
|
|
222
222
|
expect(infraStore.microservices_busy).toBe(true);
|
|
223
223
|
});
|
|
224
224
|
|
|
225
|
-
test("
|
|
225
|
+
test("back false & viewer false", () => {
|
|
226
226
|
const infraStore = useInfraStore();
|
|
227
|
-
const
|
|
227
|
+
const backStore = useBackStore();
|
|
228
228
|
const viewerStore = useViewerStore();
|
|
229
229
|
|
|
230
|
-
infraStore.register_microservice(
|
|
230
|
+
infraStore.register_microservice(backStore, {
|
|
231
231
|
request: vi.fn(),
|
|
232
232
|
connect: vi.fn(),
|
|
233
233
|
launch: vi.fn(),
|
|
@@ -238,7 +238,7 @@ describe("infra store", () => {
|
|
|
238
238
|
launch: vi.fn(),
|
|
239
239
|
});
|
|
240
240
|
|
|
241
|
-
|
|
241
|
+
backStore.$patch({ request_counter: 1 });
|
|
242
242
|
viewerStore.$patch({ request_counter: 1 });
|
|
243
243
|
expect(infraStore.microservices_busy).toBe(true);
|
|
244
244
|
});
|
|
@@ -247,26 +247,26 @@ describe("infra store", () => {
|
|
|
247
247
|
|
|
248
248
|
describe("actions", () => {
|
|
249
249
|
describe("register_microservice", () => {
|
|
250
|
-
test("register
|
|
250
|
+
test("register back microservice", () => {
|
|
251
251
|
const infraStore = useInfraStore();
|
|
252
|
-
const
|
|
252
|
+
const backStore = useBackStore();
|
|
253
253
|
|
|
254
|
-
infraStore.register_microservice(
|
|
254
|
+
infraStore.register_microservice(backStore, {
|
|
255
255
|
request: vi.fn(),
|
|
256
256
|
connect: vi.fn(),
|
|
257
257
|
launch: vi.fn(),
|
|
258
258
|
});
|
|
259
259
|
|
|
260
260
|
expect(infraStore.microservices).toHaveLength(1);
|
|
261
|
-
expect(infraStore.microservices[0].$id).toBe("
|
|
261
|
+
expect(infraStore.microservices[0].$id).toBe("back");
|
|
262
262
|
});
|
|
263
263
|
|
|
264
264
|
test("register multiple microservices", () => {
|
|
265
265
|
const infraStore = useInfraStore();
|
|
266
|
-
const
|
|
266
|
+
const backStore = useBackStore();
|
|
267
267
|
const viewerStore = useViewerStore();
|
|
268
268
|
|
|
269
|
-
infraStore.register_microservice(
|
|
269
|
+
infraStore.register_microservice(backStore, {
|
|
270
270
|
request: vi.fn(),
|
|
271
271
|
connect: vi.fn(),
|
|
272
272
|
launch: vi.fn(),
|
|
@@ -286,7 +286,7 @@ describe("infra store", () => {
|
|
|
286
286
|
describe("create_backend", () => {
|
|
287
287
|
test("with end-point", async () => {
|
|
288
288
|
const infraStore = useInfraStore();
|
|
289
|
-
const
|
|
289
|
+
const backStore = useBackStore();
|
|
290
290
|
const viewerStore = useViewerStore();
|
|
291
291
|
|
|
292
292
|
infraStore.app_mode = appMode.CLOUD;
|
|
@@ -299,7 +299,7 @@ describe("infra store", () => {
|
|
|
299
299
|
expect(infraStore.status).toBe(Status.CREATED);
|
|
300
300
|
expect(infraStore.domain_name).toBe(url);
|
|
301
301
|
|
|
302
|
-
expect(
|
|
302
|
+
expect(backStore.status).toBe(Status.NOT_CONNECTED);
|
|
303
303
|
expect(viewerStore.status).toBe(Status.NOT_CONNECTED);
|
|
304
304
|
});
|
|
305
305
|
});
|