@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.
Files changed (45) hide show
  1. package/app/components/CrsSelector.vue +3 -3
  2. package/app/components/ExtensionSelector.vue +3 -3
  3. package/app/components/FileSelector.vue +3 -3
  4. package/app/components/FileUploader.vue +4 -4
  5. package/app/components/Inspector/InspectionButton.vue +3 -3
  6. package/app/components/Loading.vue +27 -0
  7. package/app/components/MissingFilesSelector.vue +3 -3
  8. package/app/components/ObjectSelector.vue +3 -3
  9. package/app/components/PackagesVersions.vue +4 -4
  10. package/app/components/Viewer/ObjectTree/Layout.vue +6 -3
  11. package/app/components/Viewer/ObjectTree/Views/GlobalObjects.vue +47 -1
  12. package/app/components/Viewer/ObjectTree/Views/ModelCollections.vue +222 -0
  13. package/app/components/Viewer/ObjectTree/Views/ModelComponents.vue +10 -4
  14. package/app/components/Viewer/Options/AttributeSelector.vue +3 -3
  15. package/app/components/Viewer/Options/TextureItem.vue +4 -4
  16. package/app/composables/model_collections.js +72 -0
  17. package/app/composables/model_components.js +5 -1
  18. package/app/composables/project_manager.js +5 -5
  19. package/app/composables/virtual_tree.js +8 -7
  20. package/app/stores/{geode.js → back.js} +16 -1
  21. package/app/stores/data.js +39 -111
  22. package/app/stores/data_helpers/collections.js +102 -0
  23. package/app/stores/data_helpers/mesh.js +122 -0
  24. package/app/stores/treeview.js +18 -8
  25. package/app/stores/viewer.js +18 -0
  26. package/app/utils/extension.js +0 -2
  27. package/app/utils/import_workflow.js +3 -3
  28. package/internal/stores/hybrid_viewer_camera_animation.js +24 -2
  29. package/package.json +3 -3
  30. package/tests/integration/setup.js +3 -3
  31. package/tests/unit/components/CrsSelector.nuxt.test.js +6 -6
  32. package/tests/unit/components/ExtensionSelector.nuxt.test.js +4 -4
  33. package/tests/unit/components/FileSelector.nuxt.test.js +3 -3
  34. package/tests/unit/components/FileUploader.nuxt.test.js +3 -3
  35. package/tests/unit/components/Inspector/InspectionButton.nuxt.test.js +4 -4
  36. package/tests/unit/components/MissingFilesSelector.nuxt.test.js +4 -4
  37. package/tests/unit/components/ObjectSelector.nuxt.test.js +3 -3
  38. package/tests/unit/components/PackagesVersions.nuxt.test.js +3 -3
  39. package/tests/unit/composables/api_fetch.nuxt.test.js +9 -9
  40. package/tests/unit/composables/project_manager.nuxt.test.js +3 -3
  41. package/tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js +7 -7
  42. package/tests/unit/composables/upload_file.nuxt.test.js +7 -7
  43. package/tests/unit/stores/app.nuxt.test.js +9 -9
  44. package/tests/unit/stores/{geode.nuxt.test.js → back.nuxt.test.js} +43 -43
  45. 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 { useGeodeStore } from "@ogw_front/stores/geode";
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("geode store", () => {
21
+ describe("back store", () => {
22
22
  beforeEach(() => {
23
23
  setupActivePinia();
24
24
  });
25
25
 
26
26
  test("state", () => {
27
- const geodeStore = useGeodeStore();
28
- expectTypeOf(geodeStore.default_local_port).toBeString();
29
- expectTypeOf(geodeStore.request_counter).toBeNumber();
30
- expectTypeOf(geodeStore.status).toBeString();
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 geodeStore = useGeodeStore();
36
+ const backStore = useBackStore();
37
37
  infraStore.app_mode = appMode.CLOUD;
38
- expect(geodeStore.protocol).toBe("https");
38
+ expect(backStore.protocol).toBe("https");
39
39
  });
40
40
 
41
41
  test("app_mode BROWSER/DESKTOP", () => {
42
42
  const infraStore = useInfraStore();
43
- const geodeStore = useGeodeStore();
43
+ const backStore = useBackStore();
44
44
  infraStore.app_mode = appMode.BROWSER;
45
- expect(geodeStore.protocol).toBe("http");
45
+ expect(backStore.protocol).toBe("http");
46
46
  infraStore.app_mode = appMode.DESKTOP;
47
- expect(geodeStore.protocol).toBe("http");
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 geodeStore = useGeodeStore();
54
+ const backStore = useBackStore();
55
55
  infraStore.app_mode = appMode.CLOUD;
56
- expect(geodeStore.port).toBe(PORT_443);
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 geodeStore = useGeodeStore();
61
+ const backStore = useBackStore();
62
62
  infraStore.app_mode = appMode.BROWSER;
63
- expect(geodeStore.port).toBe(geodeStore.default_local_port);
63
+ expect(backStore.port).toBe(backStore.default_local_port);
64
64
  infraStore.app_mode = appMode.DESKTOP;
65
- expect(geodeStore.port).toBe(geodeStore.default_local_port);
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 geodeStore = useGeodeStore();
70
+ const backStore = useBackStore();
71
71
  infraStore.app_mode = appMode.DESKTOP;
72
- geodeStore.default_local_port = PORT_12;
73
- expect(geodeStore.port).toBe(PORT_12);
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 geodeStore = useGeodeStore();
80
+ const backStore = useBackStore();
81
81
  infraStore.app_mode = appMode.BROWSER;
82
82
  infraStore.domain_name = "localhost";
83
- expect(geodeStore.base_url).toBe(`http://localhost:${PORT_5000}`);
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 geodeStore = useGeodeStore();
88
+ const backStore = useBackStore();
89
89
  infraStore.app_mode = appMode.CLOUD;
90
90
  infraStore.domain_name = "example.com";
91
- expect(geodeStore.base_url).toBe(`https://example.com:${PORT_443}/geode`);
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 geodeStore = useGeodeStore();
98
- geodeStore.request_counter = EXPECTED_ONE_REQUEST;
99
- expect(geodeStore.is_busy).toBe(true);
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 geodeStore = useGeodeStore();
104
- geodeStore.request_counter = EXPECTED_NO_REQUEST;
105
- expect(geodeStore.is_busy).toBe(false);
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 geodeStore = useGeodeStore();
120
- geodeStore.base_url = "";
119
+ const backStore = useBackStore();
120
+ backStore.base_url = "";
121
121
  getFakeCall.mockReturnValue({});
122
- await geodeStore.ping();
123
- expect(geodeStore.status).toBe(Status.CONNECTED);
122
+ await backStore.ping();
123
+ expect(backStore.status).toBe(Status.CONNECTED);
124
124
  });
125
125
 
126
126
  test("response_error", async () => {
127
- const geodeStore = useGeodeStore();
128
- geodeStore.base_url = "";
127
+ const backStore = useBackStore();
128
+ backStore.base_url = "";
129
129
  getFakeCall.mockImplementation(() => {
130
130
  throw createError({ status: STATUS_500 });
131
131
  });
132
- await expect(geodeStore.ping()).rejects.toThrow("500");
133
- expect(geodeStore.status).toBe(Status.NOT_CONNECTED);
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 geodeStore = useGeodeStore();
140
- expect(geodeStore.request_counter).toBe(EXPECTED_NO_REQUEST);
141
- await geodeStore.start_request();
142
- expect(geodeStore.request_counter).toBe(EXPECTED_ONE_REQUEST);
143
- await geodeStore.stop_request();
144
- expect(geodeStore.request_counter).toBe(EXPECTED_NO_REQUEST);
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 { useGeodeStore } from "@ogw_front/stores/geode";
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 geodeStore = useGeodeStore();
73
+ const backStore = useBackStore();
74
74
  const viewerStore = useViewerStore();
75
75
 
76
- infraStore.register_microservice(geodeStore, {
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
- geodeStore.$patch({ status: Status.NOT_CONNECTED });
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 geodeStore = useGeodeStore();
94
+ const backStore = useBackStore();
95
95
  const viewerStore = useViewerStore();
96
96
 
97
- infraStore.register_microservice(geodeStore, {
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
- geodeStore.$patch({ status: Status.CONNECTED });
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 geodeStore = useGeodeStore();
115
+ const backStore = useBackStore();
116
116
  const viewerStore = useViewerStore();
117
117
 
118
- infraStore.register_microservice(geodeStore, {
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
- geodeStore.$patch({ status: Status.NOT_CONNECTED });
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 geodeStore = useGeodeStore();
136
+ const backStore = useBackStore();
137
137
  const viewerStore = useViewerStore();
138
138
 
139
- infraStore.register_microservice(geodeStore, {
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
- geodeStore.$patch({ status: Status.CONNECTED });
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 geodeStore = useGeodeStore();
164
+ const backStore = useBackStore();
165
165
  const viewerStore = useViewerStore();
166
166
 
167
- infraStore.register_microservice(geodeStore, {
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
- geodeStore.$patch({ request_counter: 0 });
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 geodeStore = useGeodeStore();
185
+ const backStore = useBackStore();
186
186
  const viewerStore = useViewerStore();
187
187
 
188
- infraStore.register_microservice(geodeStore, {
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
- geodeStore.$patch({ request_counter: 1 });
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 geodeStore = useGeodeStore();
206
+ const backStore = useBackStore();
207
207
  const viewerStore = useViewerStore();
208
208
 
209
- infraStore.register_microservice(geodeStore, {
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
- geodeStore.$patch({ request_counter: 0 });
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("geode true & viewer true", () => {
225
+ test("back false & viewer false", () => {
226
226
  const infraStore = useInfraStore();
227
- const geodeStore = useGeodeStore();
227
+ const backStore = useBackStore();
228
228
  const viewerStore = useViewerStore();
229
229
 
230
- infraStore.register_microservice(geodeStore, {
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
- geodeStore.$patch({ request_counter: 1 });
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 geode microservice", () => {
250
+ test("register back microservice", () => {
251
251
  const infraStore = useInfraStore();
252
- const geodeStore = useGeodeStore();
252
+ const backStore = useBackStore();
253
253
 
254
- infraStore.register_microservice(geodeStore, {
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("geode");
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 geodeStore = useGeodeStore();
266
+ const backStore = useBackStore();
267
267
  const viewerStore = useViewerStore();
268
268
 
269
- infraStore.register_microservice(geodeStore, {
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 geodeStore = useGeodeStore();
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(geodeStore.status).toBe(Status.NOT_CONNECTED);
302
+ expect(backStore.status).toBe(Status.NOT_CONNECTED);
303
303
  expect(viewerStore.status).toBe(Status.NOT_CONNECTED);
304
304
  });
305
305
  });