@geode/opengeodeweb-front 10.6.2 → 10.6.3-rc.1

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 (235) hide show
  1. package/.eslintrc.cjs +1 -1
  2. package/.oxlintrc.json +3 -22
  3. package/app/assets/geode_objects.js +26 -26
  4. package/app/components/Carousel.vue +62 -66
  5. package/app/components/CrsSelector.vue +48 -52
  6. package/app/components/DeleteDialog.vue +21 -37
  7. package/app/components/DragAndDrop.vue +35 -41
  8. package/app/components/ExtensionSelector.vue +50 -63
  9. package/app/components/FeedBack/ErrorBanner.vue +7 -10
  10. package/app/components/FeedBack/Snackers.vue +12 -14
  11. package/app/components/FetchingData.vue +1 -6
  12. package/app/components/FileSelector.vue +41 -47
  13. package/app/components/FileUploader.vue +62 -79
  14. package/app/components/GlassCard.vue +19 -19
  15. package/app/components/HybridRenderingView.vue +37 -38
  16. package/app/components/InfraConnected.vue +3 -3
  17. package/app/components/Inspector/InspectionButton.vue +27 -31
  18. package/app/components/Inspector/ResultPanel.vue +13 -24
  19. package/app/components/Launcher.vue +13 -13
  20. package/app/components/Loading.vue +63 -69
  21. package/app/components/MissingFilesSelector.vue +53 -73
  22. package/app/components/ObjectSelector.vue +81 -99
  23. package/app/components/PackagesVersions.vue +27 -30
  24. package/app/components/Recaptcha.vue +60 -71
  25. package/app/components/RemoteRenderingView.vue +102 -108
  26. package/app/components/Screenshot.vue +36 -42
  27. package/app/components/SearchBar.vue +5 -5
  28. package/app/components/Step.vue +37 -44
  29. package/app/components/Stepper.vue +29 -35
  30. package/app/components/VeaseViewToolbar.vue +69 -78
  31. package/app/components/ViewToolbar.vue +41 -45
  32. package/app/components/Viewer/BreadCrumb.vue +18 -30
  33. package/app/components/Viewer/ContextMenu.vue +176 -179
  34. package/app/components/Viewer/ContextMenuItem.vue +105 -117
  35. package/app/components/Viewer/EdgedCurve/PointsOptions.vue +6 -9
  36. package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +82 -93
  37. package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +84 -99
  38. package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +83 -98
  39. package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +62 -73
  40. package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +84 -108
  41. package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +82 -105
  42. package/app/components/Viewer/Generic/Model/EdgesOptions.vue +19 -23
  43. package/app/components/Viewer/Generic/Model/PointsOptions.vue +26 -30
  44. package/app/components/Viewer/Grid/2D/CellsOptions.vue +5 -5
  45. package/app/components/Viewer/Grid/2D/EdgesOptions.vue +6 -9
  46. package/app/components/Viewer/Grid/2D/PointsOptions.vue +6 -9
  47. package/app/components/Viewer/Grid/3D/CellsOptions.vue +5 -5
  48. package/app/components/Viewer/Grid/3D/EdgesOptions.vue +6 -9
  49. package/app/components/Viewer/Grid/3D/FacetsOptions.vue +5 -5
  50. package/app/components/Viewer/Grid/3D/PointsOptions.vue +6 -9
  51. package/app/components/Viewer/HybridSolid/EdgesOptions.vue +6 -9
  52. package/app/components/Viewer/HybridSolid/PointsOptions.vue +6 -9
  53. package/app/components/Viewer/HybridSolid/PolygonsOptions.vue +6 -9
  54. package/app/components/Viewer/HybridSolid/PolyhedraOptions.vue +6 -9
  55. package/app/components/Viewer/Options/AttributeColorBar.vue +8 -8
  56. package/app/components/Viewer/Options/AttributeSelector.vue +73 -78
  57. package/app/components/Viewer/Options/ColorMapList.vue +115 -140
  58. package/app/components/Viewer/Options/ColorMapPicker.vue +128 -142
  59. package/app/components/Viewer/Options/ColorPicker.vue +9 -9
  60. package/app/components/Viewer/Options/ColoringTypeSelector.vue +77 -91
  61. package/app/components/Viewer/Options/TextureItem.vue +54 -58
  62. package/app/components/Viewer/Options/TexturesSelector.vue +22 -26
  63. package/app/components/Viewer/Options/VisibilitySwitch.vue +1 -1
  64. package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +61 -68
  65. package/app/components/Viewer/PolygonalSurface/EdgesOptions.vue +6 -9
  66. package/app/components/Viewer/PolygonalSurface/PointsOptions.vue +6 -9
  67. package/app/components/Viewer/PolygonalSurface/SpecificPolygonsOptions.vue +83 -103
  68. package/app/components/Viewer/Solid/EdgesOptions.vue +6 -9
  69. package/app/components/Viewer/Solid/PointsOptions.vue +6 -9
  70. package/app/components/Viewer/Solid/PolygonsOptions.vue +6 -9
  71. package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +82 -105
  72. package/app/components/Viewer/TetrahedralSolid/TetrahedraOptions.vue +5 -5
  73. package/app/components/Viewer/TetrahedralSolid/TrianglesOptions.vue +5 -5
  74. package/app/components/Viewer/Tree/ObjectTree.vue +80 -89
  75. package/app/components/Viewer/TreeComponent.vue +43 -49
  76. package/app/components/Viewer/TreeObject.vue +48 -50
  77. package/app/components/Viewer/TriangulatedSurface/EdgesOptions.vue +6 -9
  78. package/app/components/Viewer/TriangulatedSurface/PointsOptions.vue +5 -5
  79. package/app/components/Viewer/TriangulatedSurface/TrianglesOptions.vue +5 -5
  80. package/app/components/Wrapper.vue +8 -8
  81. package/app/components/ZScaling.vue +18 -27
  82. package/app/composables/project_manager.js +57 -67
  83. package/app/composables/run_function_when_microservices_connected.js +8 -8
  84. package/app/plugins/auto_store_register.js +11 -13
  85. package/app/stores/app.js +118 -138
  86. package/app/stores/data.js +52 -68
  87. package/app/stores/data_style.js +36 -36
  88. package/app/stores/feedback.js +17 -20
  89. package/app/stores/geode.js +54 -55
  90. package/app/stores/hybrid_viewer.js +164 -177
  91. package/app/stores/infra.js +45 -55
  92. package/app/stores/lambda.js +26 -26
  93. package/app/stores/menu.js +78 -85
  94. package/app/stores/treeview.js +57 -65
  95. package/app/stores/viewer.js +92 -104
  96. package/app/utils/colormap.js +3 -3
  97. package/app/utils/config.js +16 -22
  98. package/app/utils/default_styles.js +50 -62
  99. package/app/utils/extension.js +44 -44
  100. package/app/utils/file_import_workflow.js +50 -64
  101. package/app/utils/local/app_mode.js +2 -2
  102. package/app/utils/local/cleanup.js +66 -72
  103. package/app/utils/local/microservices.js +61 -71
  104. package/app/utils/local/path.js +16 -19
  105. package/app/utils/local/scripts.js +22 -22
  106. package/app/utils/recaptcha.js +6 -6
  107. package/app/utils/server.js +21 -24
  108. package/app/utils/status.js +2 -2
  109. package/app/utils/treeview.js +4 -4
  110. package/app/utils/validate_schema.js +7 -7
  111. package/commitlint.config.js +2 -2
  112. package/eslint.config.js +4 -4
  113. package/internal/database/database.js +38 -46
  114. package/internal/database/extended_database.js +9 -10
  115. package/internal/database/tables/data.js +2 -3
  116. package/internal/database/tables/model_components.js +1 -1
  117. package/internal/database/tables/model_components_relation.js +1 -1
  118. package/internal/stores/data_style/mesh/cells/cell.js +47 -63
  119. package/internal/stores/data_style/mesh/cells/color.js +11 -16
  120. package/internal/stores/data_style/mesh/cells/common.js +6 -6
  121. package/internal/stores/data_style/mesh/cells/index.js +37 -47
  122. package/internal/stores/data_style/mesh/cells/textures.js +11 -12
  123. package/internal/stores/data_style/mesh/cells/vertex.js +47 -58
  124. package/internal/stores/data_style/mesh/cells/visibility.js +11 -16
  125. package/internal/stores/data_style/mesh/edges/color.js +11 -16
  126. package/internal/stores/data_style/mesh/edges/common.js +6 -6
  127. package/internal/stores/data_style/mesh/edges/edge.js +47 -63
  128. package/internal/stores/data_style/mesh/edges/index.js +38 -52
  129. package/internal/stores/data_style/mesh/edges/vertex.js +47 -58
  130. package/internal/stores/data_style/mesh/edges/visibility.js +11 -16
  131. package/internal/stores/data_style/mesh/edges/width.js +11 -16
  132. package/internal/stores/data_style/mesh/index.js +34 -34
  133. package/internal/stores/data_style/mesh/points/color.js +11 -16
  134. package/internal/stores/data_style/mesh/points/common.js +6 -6
  135. package/internal/stores/data_style/mesh/points/index.js +35 -49
  136. package/internal/stores/data_style/mesh/points/size.js +11 -16
  137. package/internal/stores/data_style/mesh/points/vertex.js +47 -58
  138. package/internal/stores/data_style/mesh/points/visibility.js +11 -16
  139. package/internal/stores/data_style/mesh/polygons/color.js +11 -16
  140. package/internal/stores/data_style/mesh/polygons/common.js +6 -6
  141. package/internal/stores/data_style/mesh/polygons/index.js +36 -45
  142. package/internal/stores/data_style/mesh/polygons/polygon.js +45 -56
  143. package/internal/stores/data_style/mesh/polygons/textures.js +11 -16
  144. package/internal/stores/data_style/mesh/polygons/vertex.js +47 -58
  145. package/internal/stores/data_style/mesh/polygons/visibility.js +11 -16
  146. package/internal/stores/data_style/mesh/polyhedra/color.js +11 -16
  147. package/internal/stores/data_style/mesh/polyhedra/common.js +6 -6
  148. package/internal/stores/data_style/mesh/polyhedra/index.js +29 -42
  149. package/internal/stores/data_style/mesh/polyhedra/polyhedron.js +43 -47
  150. package/internal/stores/data_style/mesh/polyhedra/vertex.js +47 -58
  151. package/internal/stores/data_style/mesh/polyhedra/visibility.js +11 -17
  152. package/internal/stores/data_style/model/blocks/color.js +21 -24
  153. package/internal/stores/data_style/model/blocks/common.js +6 -6
  154. package/internal/stores/data_style/model/blocks/index.js +13 -17
  155. package/internal/stores/data_style/model/blocks/visibility.js +21 -24
  156. package/internal/stores/data_style/model/corners/color.js +21 -24
  157. package/internal/stores/data_style/model/corners/common.js +6 -6
  158. package/internal/stores/data_style/model/corners/index.js +14 -18
  159. package/internal/stores/data_style/model/corners/visibility.js +21 -25
  160. package/internal/stores/data_style/model/edges/common.js +4 -4
  161. package/internal/stores/data_style/model/edges/index.js +7 -7
  162. package/internal/stores/data_style/model/edges/visibility.js +11 -15
  163. package/internal/stores/data_style/model/index.js +84 -100
  164. package/internal/stores/data_style/model/lines/color.js +21 -24
  165. package/internal/stores/data_style/model/lines/common.js +6 -6
  166. package/internal/stores/data_style/model/lines/index.js +13 -17
  167. package/internal/stores/data_style/model/lines/visibility.js +21 -24
  168. package/internal/stores/data_style/model/points/common.js +4 -4
  169. package/internal/stores/data_style/model/points/index.js +9 -9
  170. package/internal/stores/data_style/model/points/size.js +11 -11
  171. package/internal/stores/data_style/model/points/visibility.js +11 -15
  172. package/internal/stores/data_style/model/surfaces/color.js +21 -24
  173. package/internal/stores/data_style/model/surfaces/common.js +6 -6
  174. package/internal/stores/data_style/model/surfaces/index.js +14 -22
  175. package/internal/stores/data_style/model/surfaces/visibility.js +18 -22
  176. package/internal/stores/data_style/state.js +11 -11
  177. package/internal/utils/api_fetch.js +24 -34
  178. package/internal/utils/upload_file.js +19 -24
  179. package/internal/utils/viewer_call.js +23 -36
  180. package/nuxt.config.js +7 -11
  181. package/package.json +3 -3
  182. package/scripts/generate_geode_objects.js +14 -16
  183. package/server/api/app/kill.post.js +4 -4
  184. package/server/api/app/project_folder_path.post.js +11 -11
  185. package/server/api/app/run_back.post.js +12 -12
  186. package/server/api/app/run_viewer.post.js +12 -12
  187. package/server/api/extensions/run.post.js +34 -41
  188. package/server/api/extensions/upload.put.js +48 -62
  189. package/tests/integration/setup.js +43 -53
  190. package/tests/integration/stores/data_style/mesh/cells.nuxt.test.js +90 -116
  191. package/tests/integration/stores/data_style/mesh/edges.nuxt.test.js +81 -107
  192. package/tests/integration/stores/data_style/mesh/index.nuxt.test.js +38 -41
  193. package/tests/integration/stores/data_style/mesh/points.nuxt.test.js +85 -101
  194. package/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js +89 -113
  195. package/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js +81 -105
  196. package/tests/integration/stores/data_style/model/blocks.nuxt.test.js +56 -73
  197. package/tests/integration/stores/data_style/model/corners.nuxt.test.js +59 -76
  198. package/tests/integration/stores/data_style/model/edges.nuxt.test.js +39 -42
  199. package/tests/integration/stores/data_style/model/index.nuxt.test.js +31 -34
  200. package/tests/integration/stores/data_style/model/lines.nuxt.test.js +60 -73
  201. package/tests/integration/stores/data_style/model/points.nuxt.test.js +52 -55
  202. package/tests/integration/stores/data_style/model/surfaces.nuxt.test.js +59 -80
  203. package/tests/integration/stores/viewer.nuxt.test.js +35 -38
  204. package/tests/setup_indexeddb.js +2 -2
  205. package/tests/unit/components/CrsSelector.nuxt.test.js +28 -28
  206. package/tests/unit/components/ExtensionSelector.nuxt.test.js +33 -35
  207. package/tests/unit/components/FeedBack/ErrorsBanner.nuxt.test.js +23 -23
  208. package/tests/unit/components/FeedBack/Snackers.nuxt.test.js +18 -18
  209. package/tests/unit/components/FileSelector.nuxt.test.js +57 -59
  210. package/tests/unit/components/FileUploader.nuxt.test.js +35 -39
  211. package/tests/unit/components/Inspector/InspectionButton.nuxt.test.js +28 -28
  212. package/tests/unit/components/Inspector/ResultPanel.nuxt.test.js +22 -27
  213. package/tests/unit/components/Launcher.nuxt.test.js +20 -22
  214. package/tests/unit/components/MissingFilesSelector.nuxt.test.js +37 -37
  215. package/tests/unit/components/ObjectSelector.nuxt.test.js +62 -62
  216. package/tests/unit/components/PackagesVersions.nuxt.test.js +16 -16
  217. package/tests/unit/components/Step.nuxt.test.js +18 -19
  218. package/tests/unit/components/Stepper.nuxt.test.js +18 -18
  219. package/tests/unit/composables/api_fetch.nuxt.test.js +34 -36
  220. package/tests/unit/composables/project_manager.nuxt.test.js +93 -112
  221. package/tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js +36 -36
  222. package/tests/unit/composables/upload_file.nuxt.test.js +27 -29
  223. package/tests/unit/plugins/project_load.nuxt.test.js +31 -33
  224. package/tests/unit/stores/app.nuxt.test.js +90 -92
  225. package/tests/unit/stores/feedback.nuxt.test.js +47 -57
  226. package/tests/unit/stores/geode.nuxt.test.js +111 -115
  227. package/tests/unit/stores/infra.nuxt.test.js +148 -148
  228. package/tests/unit/stores/lambda.nuxt.test.js +72 -74
  229. package/tests/unit/stores/treeview.nuxt.test.js +19 -21
  230. package/tests/unit/stores/viewer.nuxt.test.js +109 -122
  231. package/tests/unit/utils/recaptcha.nuxt.test.js +25 -29
  232. package/tests/unit/utils/validate_schema.nuxt.test.js +17 -17
  233. package/tests/utils.js +11 -11
  234. package/tests/vitest.config.js +9 -9
  235. package/vuetify_config.js +2 -2
@@ -1,108 +1,95 @@
1
1
  // Third party imports
2
- import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"
3
- import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" with { type: "json" }
2
+ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
3
+ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" with { type: "json" };
4
4
 
5
5
  // Local imports
6
- import { Status } from "@ogw_front/utils/status"
7
- import { cleanupBackend } from "@ogw_front/utils/local/cleanup"
8
- import { setupIntegrationTests } from "@ogw_tests/integration/setup"
9
- import { useDataStore } from "@ogw_front/stores/data"
10
- import { useDataStyleStore } from "@ogw_front/stores/data_style"
11
- import { useViewerStore } from "@ogw_front/stores/viewer"
6
+ import { Status } from "@ogw_front/utils/status";
7
+ import { cleanupBackend } from "@ogw_front/utils/local/cleanup";
8
+ import { setupIntegrationTests } from "@ogw_tests/integration/setup";
9
+ import { useDataStore } from "@ogw_front/stores/data";
10
+ import { useDataStyleStore } from "@ogw_front/stores/data_style";
11
+ import { useViewerStore } from "@ogw_front/stores/viewer";
12
12
 
13
13
  // Local constants
14
- const INTERVAL_TIMEOUT = 20_000
15
- const model_lines_schemas = viewer_schemas.opengeodeweb_viewer.model.lines
16
- const file_name = "test.og_brep"
17
- const geode_object = "BRep"
14
+ const INTERVAL_TIMEOUT = 20_000;
15
+ const model_lines_schemas = viewer_schemas.opengeodeweb_viewer.model.lines;
16
+ const file_name = "test.og_brep";
17
+ const geode_object = "BRep";
18
18
 
19
19
  let id = "",
20
- projectFolderPath = ""
20
+ projectFolderPath = "";
21
21
 
22
22
  beforeEach(async () => {
23
- ;({ id, projectFolderPath } = await setupIntegrationTests(
24
- file_name,
25
- geode_object,
26
- ))
27
- }, INTERVAL_TIMEOUT)
23
+ ({ id, projectFolderPath } = await setupIntegrationTests(file_name, geode_object));
24
+ }, INTERVAL_TIMEOUT);
28
25
  afterEach(async () => {
29
- console.log("afterEach model lines kill", projectFolderPath)
30
- await cleanupBackend(projectFolderPath)
31
- })
26
+ console.log("afterEach model lines kill", projectFolderPath);
27
+ await cleanupBackend(projectFolderPath);
28
+ });
32
29
 
33
30
  describe("Model lines", () => {
34
31
  describe("Lines visibility", () => {
35
32
  test("Visibility false", async () => {
36
- console.log("FROM TEST MODEL LINES")
37
- const dataStyleStore = useDataStyleStore()
38
- const viewerStore = useViewerStore()
39
- const dataStore = useDataStore()
40
- const line_ids = await dataStore.getLinesGeodeIds(id)
41
- const lines_viewer_ids = await dataStore.getMeshComponentsViewerIds(
42
- id,
43
- line_ids,
44
- )
45
- const visibility = false
46
- const spy = vi.spyOn(viewerStore, "request")
47
- spy.mockClear()
48
- const result = dataStyleStore.setModelLinesVisibility(
49
- id,
50
- line_ids,
51
- visibility,
52
- )
53
- expect(result).toBeInstanceOf(Promise)
54
- await result
33
+ console.log("FROM TEST MODEL LINES");
34
+ const dataStyleStore = useDataStyleStore();
35
+ const viewerStore = useViewerStore();
36
+ const dataStore = useDataStore();
37
+ const line_ids = await dataStore.getLinesGeodeIds(id);
38
+ const lines_viewer_ids = await dataStore.getMeshComponentsViewerIds(id, line_ids);
39
+ const visibility = false;
40
+ const spy = vi.spyOn(viewerStore, "request");
41
+ spy.mockClear();
42
+ const result = dataStyleStore.setModelLinesVisibility(id, line_ids, visibility);
43
+ expect(result).toBeInstanceOf(Promise);
44
+ await result;
55
45
  expect(spy).toHaveBeenCalledWith(
56
46
  model_lines_schemas.visibility,
57
47
  { id, block_ids: lines_viewer_ids, visibility },
58
48
  {
59
49
  response_function: expect.any(Function),
60
50
  },
61
- )
51
+ );
62
52
  for (const line_id of line_ids) {
63
- expect(dataStyleStore.modelLineVisibility(id, line_id)).toBe(visibility)
53
+ expect(dataStyleStore.modelLineVisibility(id, line_id)).toBe(visibility);
64
54
  }
65
- expect(viewerStore.status).toBe(Status.CONNECTED)
66
- })
67
- })
55
+ expect(viewerStore.status).toBe(Status.CONNECTED);
56
+ });
57
+ });
68
58
 
69
59
  describe("Lines color", () => {
70
60
  test("Color red", async () => {
71
- const dataStyleStore = useDataStyleStore()
72
- const viewerStore = useViewerStore()
73
- const dataStore = useDataStore()
74
- const line_ids = await dataStore.getLinesGeodeIds(id)
75
- const lines_viewer_ids = await dataStore.getMeshComponentsViewerIds(
76
- id,
77
- line_ids,
78
- )
79
- const color = { r: 255, g: 0, b: 0 }
80
- const spy = vi.spyOn(viewerStore, "request")
81
- spy.mockClear()
82
- const result = dataStyleStore.setModelLinesColor(id, line_ids, color)
83
- expect(result).toBeInstanceOf(Promise)
84
- await result
61
+ const dataStyleStore = useDataStyleStore();
62
+ const viewerStore = useViewerStore();
63
+ const dataStore = useDataStore();
64
+ const line_ids = await dataStore.getLinesGeodeIds(id);
65
+ const lines_viewer_ids = await dataStore.getMeshComponentsViewerIds(id, line_ids);
66
+ const color = { r: 255, g: 0, b: 0 };
67
+ const spy = vi.spyOn(viewerStore, "request");
68
+ spy.mockClear();
69
+ const result = dataStyleStore.setModelLinesColor(id, line_ids, color);
70
+ expect(result).toBeInstanceOf(Promise);
71
+ await result;
85
72
  expect(spy).toHaveBeenCalledWith(
86
73
  model_lines_schemas.color,
87
74
  { id, block_ids: lines_viewer_ids, color },
88
75
  {
89
76
  response_function: expect.any(Function),
90
77
  },
91
- )
78
+ );
92
79
  for (const line_id of line_ids) {
93
- expect(dataStyleStore.modelLineColor(id, line_id)).toStrictEqual(color)
80
+ expect(dataStyleStore.modelLineColor(id, line_id)).toStrictEqual(color);
94
81
  }
95
- expect(viewerStore.status).toBe(Status.CONNECTED)
96
- })
97
- })
82
+ expect(viewerStore.status).toBe(Status.CONNECTED);
83
+ });
84
+ });
98
85
  describe("Lines style", () => {
99
86
  test("Lines apply style", async () => {
100
- const dataStyleStore = useDataStyleStore()
101
- const viewerStore = useViewerStore()
102
- const result = dataStyleStore.applyModelLinesStyle(id)
103
- expect(result).toBeInstanceOf(Promise)
104
- await result
105
- expect(viewerStore.status).toBe(Status.CONNECTED)
106
- })
107
- })
108
- })
87
+ const dataStyleStore = useDataStyleStore();
88
+ const viewerStore = useViewerStore();
89
+ const result = dataStyleStore.applyModelLinesStyle(id);
90
+ expect(result).toBeInstanceOf(Promise);
91
+ await result;
92
+ expect(viewerStore.status).toBe(Status.CONNECTED);
93
+ });
94
+ });
95
+ });
@@ -1,87 +1,84 @@
1
1
  // Third party imports
2
- import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"
3
- import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" with { type: "json" }
2
+ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
3
+ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" with { type: "json" };
4
4
 
5
5
  // Local imports
6
- import { Status } from "@ogw_front/utils/status"
7
- import { cleanupBackend } from "@ogw_front/utils/local/cleanup"
8
- import { setupIntegrationTests } from "@ogw_tests/integration/setup"
9
- import { useDataStyleStore } from "@ogw_front/stores/data_style"
10
- import { useViewerStore } from "@ogw_front/stores/viewer"
6
+ import { Status } from "@ogw_front/utils/status";
7
+ import { cleanupBackend } from "@ogw_front/utils/local/cleanup";
8
+ import { setupIntegrationTests } from "@ogw_tests/integration/setup";
9
+ import { useDataStyleStore } from "@ogw_front/stores/data_style";
10
+ import { useViewerStore } from "@ogw_front/stores/viewer";
11
11
 
12
12
  // Local constants
13
- const INTERVAL_TIMEOUT = 20_000
14
- const model_points_schemas = viewer_schemas.opengeodeweb_viewer.model.points
15
- const file_name = "test.og_brep"
16
- const geode_object = "BRep"
13
+ const INTERVAL_TIMEOUT = 20_000;
14
+ const model_points_schemas = viewer_schemas.opengeodeweb_viewer.model.points;
15
+ const file_name = "test.og_brep";
16
+ const geode_object = "BRep";
17
17
 
18
18
  let id = "",
19
- projectFolderPath = ""
19
+ projectFolderPath = "";
20
20
 
21
21
  beforeEach(async () => {
22
- ;({ id, projectFolderPath } = await setupIntegrationTests(
23
- file_name,
24
- geode_object,
25
- ))
26
- }, INTERVAL_TIMEOUT)
22
+ ({ id, projectFolderPath } = await setupIntegrationTests(file_name, geode_object));
23
+ }, INTERVAL_TIMEOUT);
27
24
 
28
25
  afterEach(async () => {
29
- console.log("afterEach model points kill", projectFolderPath)
30
- await cleanupBackend(projectFolderPath)
31
- })
26
+ console.log("afterEach model points kill", projectFolderPath);
27
+ await cleanupBackend(projectFolderPath);
28
+ });
32
29
 
33
30
  describe("Model points", () => {
34
31
  describe("Points visibility", () => {
35
32
  test("Visibility true", async () => {
36
- const dataStyleStore = useDataStyleStore()
37
- const viewerStore = useViewerStore()
38
- const visibility = true
39
- const spy = vi.spyOn(viewerStore, "request")
40
- spy.mockClear()
41
- const result = dataStyleStore.setModelPointsVisibility(id, visibility)
42
- expect(result).toBeInstanceOf(Promise)
43
- await result
33
+ const dataStyleStore = useDataStyleStore();
34
+ const viewerStore = useViewerStore();
35
+ const visibility = true;
36
+ const spy = vi.spyOn(viewerStore, "request");
37
+ spy.mockClear();
38
+ const result = dataStyleStore.setModelPointsVisibility(id, visibility);
39
+ expect(result).toBeInstanceOf(Promise);
40
+ await result;
44
41
  expect(spy).toHaveBeenCalledWith(
45
42
  model_points_schemas.visibility,
46
43
  { id, visibility },
47
44
  {
48
45
  response_function: expect.any(Function),
49
46
  },
50
- )
51
- expect(dataStyleStore.modelPointsVisibility(id)).toBe(visibility)
52
- expect(viewerStore.status).toBe(Status.CONNECTED)
53
- })
54
- })
47
+ );
48
+ expect(dataStyleStore.modelPointsVisibility(id)).toBe(visibility);
49
+ expect(viewerStore.status).toBe(Status.CONNECTED);
50
+ });
51
+ });
55
52
 
56
53
  describe("Points size", () => {
57
54
  test("Size 20", async () => {
58
- const dataStyleStore = useDataStyleStore()
59
- const viewerStore = useViewerStore()
60
- const size = 20
61
- const spy = vi.spyOn(viewerStore, "request")
62
- spy.mockClear()
63
- const result = dataStyleStore.setModelPointsSize(id, size)
64
- expect(result).toBeInstanceOf(Promise)
65
- await result
55
+ const dataStyleStore = useDataStyleStore();
56
+ const viewerStore = useViewerStore();
57
+ const size = 20;
58
+ const spy = vi.spyOn(viewerStore, "request");
59
+ spy.mockClear();
60
+ const result = dataStyleStore.setModelPointsSize(id, size);
61
+ expect(result).toBeInstanceOf(Promise);
62
+ await result;
66
63
  expect(spy).toHaveBeenCalledWith(
67
64
  model_points_schemas.size,
68
65
  { id, size },
69
66
  {
70
67
  response_function: expect.any(Function),
71
68
  },
72
- )
73
- expect(dataStyleStore.modelPointsSize(id)).toBe(size)
74
- expect(viewerStore.status).toBe(Status.CONNECTED)
75
- })
76
- })
69
+ );
70
+ expect(dataStyleStore.modelPointsSize(id)).toBe(size);
71
+ expect(viewerStore.status).toBe(Status.CONNECTED);
72
+ });
73
+ });
77
74
  describe("Points style", () => {
78
75
  test("Points apply style", async () => {
79
- const dataStyleStore = useDataStyleStore()
80
- const viewerStore = useViewerStore()
81
- const result = dataStyleStore.applyModelPointsStyle(id)
82
- expect(result).toBeInstanceOf(Promise)
83
- await result
84
- expect(viewerStore.status).toBe(Status.CONNECTED)
85
- })
86
- })
87
- })
76
+ const dataStyleStore = useDataStyleStore();
77
+ const viewerStore = useViewerStore();
78
+ const result = dataStyleStore.applyModelPointsStyle(id);
79
+ expect(result).toBeInstanceOf(Promise);
80
+ await result;
81
+ expect(viewerStore.status).toBe(Status.CONNECTED);
82
+ });
83
+ });
84
+ });
@@ -1,115 +1,94 @@
1
1
  // Third party imports
2
- import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"
3
- import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" with { type: "json" }
2
+ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
3
+ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" with { type: "json" };
4
4
 
5
5
  // Local imports
6
- import { Status } from "@ogw_front/utils/status"
7
- import { cleanupBackend } from "@ogw_front/utils/local/cleanup"
8
- import { setupIntegrationTests } from "@ogw_tests/integration/setup"
9
- import { useDataStore } from "@ogw_front/stores/data"
10
- import { useDataStyleStore } from "@ogw_front/stores/data_style"
11
- import { useViewerStore } from "@ogw_front/stores/viewer"
6
+ import { Status } from "@ogw_front/utils/status";
7
+ import { cleanupBackend } from "@ogw_front/utils/local/cleanup";
8
+ import { setupIntegrationTests } from "@ogw_tests/integration/setup";
9
+ import { useDataStore } from "@ogw_front/stores/data";
10
+ import { useDataStyleStore } from "@ogw_front/stores/data_style";
11
+ import { useViewerStore } from "@ogw_front/stores/viewer";
12
12
 
13
13
  // Local constants
14
- const INTERVAL_TIMEOUT = 20_000
15
- const model_surfaces_schemas = viewer_schemas.opengeodeweb_viewer.model.surfaces
16
- const file_name = "test.og_brep"
17
- const geode_object = "BRep"
14
+ const INTERVAL_TIMEOUT = 20_000;
15
+ const model_surfaces_schemas = viewer_schemas.opengeodeweb_viewer.model.surfaces;
16
+ const file_name = "test.og_brep";
17
+ const geode_object = "BRep";
18
18
 
19
19
  let id = "",
20
- projectFolderPath = ""
20
+ projectFolderPath = "";
21
21
 
22
22
  beforeEach(async () => {
23
- ;({ id, projectFolderPath } = await setupIntegrationTests(
24
- file_name,
25
- geode_object,
26
- ))
27
- }, INTERVAL_TIMEOUT)
23
+ ({ id, projectFolderPath } = await setupIntegrationTests(file_name, geode_object));
24
+ }, INTERVAL_TIMEOUT);
28
25
 
29
26
  afterEach(async () => {
30
- console.log("afterEach model surfaces kill", projectFolderPath)
31
- await cleanupBackend(projectFolderPath)
32
- })
27
+ console.log("afterEach model surfaces kill", projectFolderPath);
28
+ await cleanupBackend(projectFolderPath);
29
+ });
33
30
  describe("model surfaces", () => {
34
31
  describe("surfaces visibility", () => {
35
32
  test("visibility true", async () => {
36
- const dataStyleStore = useDataStyleStore()
37
- const viewerStore = useViewerStore()
38
- const dataStore = useDataStore()
39
- const surface_ids = await dataStore.getSurfacesGeodeIds(id)
40
- const surface_viewer_ids = await dataStore.getMeshComponentsViewerIds(
41
- id,
42
- surface_ids,
43
- )
44
- const visibility = true
45
- const spy = vi.spyOn(viewerStore, "request")
46
- spy.mockClear() // Clear calls from setup (applyDefaultStyle)
47
- const result = dataStyleStore.setModelSurfacesVisibility(
48
- id,
49
- surface_ids,
50
- visibility,
51
- )
52
- expect(result).toBeInstanceOf(Promise)
53
- await result
33
+ const dataStyleStore = useDataStyleStore();
34
+ const viewerStore = useViewerStore();
35
+ const dataStore = useDataStore();
36
+ const surface_ids = await dataStore.getSurfacesGeodeIds(id);
37
+ const surface_viewer_ids = await dataStore.getMeshComponentsViewerIds(id, surface_ids);
38
+ const visibility = true;
39
+ const spy = vi.spyOn(viewerStore, "request");
40
+ spy.mockClear();
41
+ const result = dataStyleStore.setModelSurfacesVisibility(id, surface_ids, visibility);
42
+ expect(result).toBeInstanceOf(Promise);
43
+ await result;
54
44
  expect(spy).toHaveBeenCalledWith(
55
45
  model_surfaces_schemas.visibility,
56
46
  { id, block_ids: surface_viewer_ids, visibility },
57
47
  {
58
48
  response_function: expect.any(Function),
59
49
  },
60
- )
50
+ );
61
51
  for (const surface_id of surface_ids) {
62
- expect(dataStyleStore.modelSurfaceVisibility(id, surface_id)).toBe(
63
- visibility,
64
- )
52
+ expect(dataStyleStore.modelSurfaceVisibility(id, surface_id)).toBe(visibility);
65
53
  }
66
- expect(viewerStore.status).toBe(Status.CONNECTED)
67
- })
68
- })
54
+ expect(viewerStore.status).toBe(Status.CONNECTED);
55
+ });
56
+ });
69
57
 
70
58
  describe("surfaces color", () => {
71
59
  test("color red", async () => {
72
- const dataStyleStore = useDataStyleStore()
73
- const viewerStore = useViewerStore()
74
- const dataStore = useDataStore()
75
- const surface_ids = await dataStore.getSurfacesGeodeIds(id)
76
- const surface_viewer_ids = await dataStore.getMeshComponentsViewerIds(
77
- id,
78
- surface_ids,
79
- )
80
- const color = { r: 255, g: 0, b: 0 }
81
- const spy = vi.spyOn(viewerStore, "request")
82
- spy.mockClear() // Clear calls from setup (applyDefaultStyle)
83
- const result = dataStyleStore.setModelSurfacesColor(
84
- id,
85
- surface_ids,
86
- color,
87
- )
88
- expect(result).toBeInstanceOf(Promise)
89
- await result
60
+ const dataStyleStore = useDataStyleStore();
61
+ const viewerStore = useViewerStore();
62
+ const dataStore = useDataStore();
63
+ const surface_ids = await dataStore.getSurfacesGeodeIds(id);
64
+ const surface_viewer_ids = await dataStore.getMeshComponentsViewerIds(id, surface_ids);
65
+ const color = { r: 255, g: 0, b: 0 };
66
+ const spy = vi.spyOn(viewerStore, "request");
67
+ spy.mockClear();
68
+ const result = dataStyleStore.setModelSurfacesColor(id, surface_ids, color);
69
+ expect(result).toBeInstanceOf(Promise);
70
+ await result;
90
71
  expect(spy).toHaveBeenCalledWith(
91
72
  model_surfaces_schemas.color,
92
73
  { id, block_ids: surface_viewer_ids, color },
93
74
  {
94
75
  response_function: expect.any(Function),
95
76
  },
96
- )
77
+ );
97
78
  for (const surface_id of surface_ids) {
98
- expect(dataStyleStore.modelSurfaceColor(id, surface_id)).toStrictEqual(
99
- color,
100
- )
79
+ expect(dataStyleStore.modelSurfaceColor(id, surface_id)).toStrictEqual(color);
101
80
  }
102
- expect(viewerStore.status).toBe(Status.CONNECTED)
103
- })
104
- })
81
+ expect(viewerStore.status).toBe(Status.CONNECTED);
82
+ });
83
+ });
105
84
  describe("Surfaces style", () => {
106
85
  test("Surfaces apply style", async () => {
107
- const dataStyleStore = useDataStyleStore()
108
- const viewerStore = useViewerStore()
109
- const result = dataStyleStore.applyModelSurfacesStyle(id)
110
- expect(result).toBeInstanceOf(Promise)
111
- await result
112
- expect(viewerStore.status).toBe(Status.CONNECTED)
113
- })
114
- })
115
- })
86
+ const dataStyleStore = useDataStyleStore();
87
+ const viewerStore = useViewerStore();
88
+ const result = dataStyleStore.applyModelSurfacesStyle(id);
89
+ expect(result).toBeInstanceOf(Promise);
90
+ await result;
91
+ expect(viewerStore.status).toBe(Status.CONNECTED);
92
+ });
93
+ });
94
+ });
@@ -1,28 +1,28 @@
1
1
  // Global imports
2
2
 
3
3
  // Third party imports
4
- import { afterEach, beforeEach, describe, expect, test } from "vitest"
5
- import opengeodeweb_viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
4
+ import { afterEach, beforeEach, describe, expect, test } from "vitest";
5
+ import opengeodeweb_viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json";
6
6
 
7
7
  // Local imports
8
- import { Status } from "@ogw_front/utils/status"
9
- import { cleanupBackend } from "@ogw_front/utils/local/cleanup"
10
- import { runMicroservices } from "@ogw_tests/integration/setup"
11
- import { setupActivePinia } from "@ogw_tests/utils"
12
- import { useViewerStore } from "@ogw_front/stores/viewer"
8
+ import { Status } from "@ogw_front/utils/status";
9
+ import { cleanupBackend } from "@ogw_front/utils/local/cleanup";
10
+ import { runMicroservices } from "@ogw_tests/integration/setup";
11
+ import { setupActivePinia } from "@ogw_tests/utils";
12
+ import { useViewerStore } from "@ogw_front/stores/viewer";
13
13
 
14
- const CONNECT_TIMEOUT = 25_000
14
+ const CONNECT_TIMEOUT = 25_000;
15
15
 
16
- let projectFolderPath = ""
16
+ let projectFolderPath = "";
17
17
 
18
18
  beforeEach(async () => {
19
- setupActivePinia()
20
- ;({ projectFolderPath } = await runMicroservices())
21
- })
19
+ setupActivePinia();
20
+ ({ projectFolderPath } = await runMicroservices());
21
+ });
22
22
 
23
23
  afterEach(async () => {
24
- await cleanupBackend(projectFolderPath)
25
- })
24
+ await cleanupBackend(projectFolderPath);
25
+ });
26
26
 
27
27
  describe("Viewer Store", () => {
28
28
  describe("actions", () => {
@@ -30,44 +30,41 @@ describe("Viewer Store", () => {
30
30
  test(
31
31
  "ws_connect",
32
32
  async () => {
33
- const viewerStore = useViewerStore()
34
- await viewerStore.ws_connect()
35
- expect(viewerStore.status).toBe(Status.CONNECTED)
33
+ const viewerStore = useViewerStore();
34
+ await viewerStore.ws_connect();
35
+ expect(viewerStore.status).toBe(Status.CONNECTED);
36
36
  },
37
37
  CONNECT_TIMEOUT,
38
- )
39
- })
38
+ );
39
+ });
40
40
  describe("connect", () => {
41
41
  test(
42
42
  "connect",
43
43
  async () => {
44
- const viewerStore = useViewerStore()
45
- await viewerStore.connect()
46
- expect(viewerStore.status).toBe(Status.CONNECTED)
44
+ const viewerStore = useViewerStore();
45
+ await viewerStore.connect();
46
+ expect(viewerStore.status).toBe(Status.CONNECTED);
47
47
  },
48
48
  CONNECT_TIMEOUT,
49
- )
50
- })
49
+ );
50
+ });
51
51
 
52
52
  describe("request", () => {
53
53
  test(
54
54
  "request",
55
- async () => {
56
- const schema =
57
- opengeodeweb_viewer_schemas.opengeodeweb_viewer.viewer.render
58
- const viewerStore = useViewerStore()
59
- const timeout = 1
60
- const params = {}
55
+ () => {
56
+ const schema = opengeodeweb_viewer_schemas.opengeodeweb_viewer.viewer.render;
57
+ const viewerStore = useViewerStore();
58
+ const timeout = 1;
59
+ const params = {};
61
60
  expect(() =>
62
61
  viewerStore
63
62
  .request(schema, params, {}, timeout)
64
- .rejects.toThrow(
65
- `${schema.$id}: Timed out after ${timeout}ms, ${schema} ${params}`,
66
- ),
67
- )
63
+ .rejects.toThrow(`${schema.$id}: Timed out after ${timeout}ms, ${schema} ${params}`),
64
+ );
68
65
  },
69
66
  CONNECT_TIMEOUT,
70
- )
71
- })
72
- })
73
- })
67
+ );
68
+ });
69
+ });
70
+ });
@@ -1,4 +1,4 @@
1
- import { setup } from "vitest-indexeddb"
1
+ import { setup } from "vitest-indexeddb";
2
2
 
3
3
  // oxlint-disable-next-line jest/require-hook
4
- setup()
4
+ setup();