@geode/opengeodeweb-front 10.0.0 → 10.0.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 (50) hide show
  1. package/app/components/CrsSelector.vue +3 -3
  2. package/app/components/ExtensionSelector.vue +3 -3
  3. package/app/components/FileSelector.vue +1 -2
  4. package/app/components/Inspector/InspectionButton.vue +4 -4
  5. package/app/components/MissingFilesSelector.vue +3 -3
  6. package/app/components/ObjectSelector.vue +5 -4
  7. package/app/components/Viewer/BreadCrumb.vue +1 -1
  8. package/app/components/Viewer/ContextMenu.vue +2 -2
  9. package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +81 -0
  10. package/app/components/Viewer/Grid/2D/CellsOptions.vue +2 -2
  11. package/app/components/Viewer/Grid/3D/CellsOptions.vue +2 -2
  12. package/app/components/Viewer/Options/CellAttributeSelector.vue +52 -0
  13. package/app/components/Viewer/Options/ColoringTypeSelector.vue +15 -1
  14. package/app/components/Viewer/Options/PolygonAttributeSelector.vue +2 -2
  15. package/app/components/Viewer/Options/TextureItem.vue +1 -1
  16. package/app/components/Viewer/Options/VertexAttributeSelector.vue +5 -8
  17. package/app/components/Viewer/TreeObject.vue +2 -2
  18. package/app/composables/project_manager.js +1 -10
  19. package/app/stores/data_base.js +7 -14
  20. package/app/stores/data_style.js +11 -11
  21. package/app/stores/feedback.js +1 -1
  22. package/app/stores/hybrid_viewer.js +1 -1
  23. package/app/stores/menu.js +1 -1
  24. package/app/stores/treeview.js +4 -4
  25. package/app/stores/viewer.js +2 -3
  26. package/app/utils/default_styles.js +43 -7
  27. package/app/utils/file_import_workflow.js +16 -20
  28. package/app/utils/local.js +4 -0
  29. package/internal_stores/mesh/cells.js +176 -0
  30. package/internal_stores/mesh/index.js +9 -4
  31. package/internal_stores/mesh/polygons.js +12 -3
  32. package/package.json +1 -1
  33. package/tests/integration/data/uploads/test.og_psf3d +0 -0
  34. package/tests/integration/data/uploads/test.og_rgd2d +0 -0
  35. package/tests/integration/microservices/back/requirements.txt +1 -1
  36. package/tests/integration/microservices/viewer/requirements.txt +1 -1
  37. package/tests/integration/stores/data_style/mesh/cells.nuxt.test.js +142 -0
  38. package/tests/integration/stores/data_style/mesh/edges.nuxt.test.js +16 -14
  39. package/tests/integration/stores/data_style/mesh/points.nuxt.test.js +15 -14
  40. package/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js +65 -14
  41. package/tests/unit/components/CrsSelector.nuxt.test.js +1 -1
  42. package/tests/unit/components/ExtensionSelector.nuxt.test.js +1 -1
  43. package/tests/unit/components/Inspector/InspectionButton.nuxt.test.js +2 -2
  44. package/tests/unit/components/MissingFilesSelector.nuxt.test.js +1 -1
  45. package/tests/unit/components/ObjectSelector.nuxt.test.js +3 -3
  46. package/tests/unit/components/Step.nuxt.test.js +4 -4
  47. package/tests/unit/components/Stepper.nuxt.test.js +4 -4
  48. package/tests/unit/components/Wrapper.nuxt.test.js +4 -4
  49. package/tests/unit/composables/ProjectManager.nuxt.test.js +15 -18
  50. package/tests/unit/plugins/project_load.nuxt.test.js +6 -6
@@ -57,20 +57,7 @@ describe("Mesh polygons", () => {
57
57
  expect(viewerStore.status).toBe(Status.CONNECTED)
58
58
  })
59
59
  })
60
- describe("Polygons active coloring", () => {
61
- test("test coloring", async () => {
62
- const dataStyleStore = useDataStyleStore()
63
- const viewerStore = useViewerStore()
64
- const coloringTypes = ["color"]
65
- for (let i = 0; i < coloringTypes.length; i++) {
66
- dataStyleStore.setMeshPolygonsActiveColoring(id, coloringTypes[i])
67
- expect(dataStyleStore.meshPolygonsActiveColoring(id)).toBe(
68
- coloringTypes[i],
69
- )
70
- expect(viewerStore.status).toBe(Status.CONNECTED)
71
- }
72
- })
73
- })
60
+
74
61
  describe("Polygons color", () => {
75
62
  test("Color red", async () => {
76
63
  const dataStyleStore = useDataStyleStore()
@@ -91,4 +78,68 @@ describe("Mesh polygons", () => {
91
78
  expect(viewerStore.status).toBe(Status.CONNECTED)
92
79
  })
93
80
  })
81
+
82
+ describe("Polygons vertex attribute", () => {
83
+ test("Coloring vertex attribute", async () => {
84
+ const dataStyleStore = useDataStyleStore()
85
+ const viewerStore = useViewerStore()
86
+ const vertex_attribute = { name: "points" }
87
+ const spy = vi.spyOn(composables, "viewer_call")
88
+ await dataStyleStore.setMeshPolygonsVertexAttribute(id, vertex_attribute)
89
+ expect(spy).toHaveBeenCalledWith(
90
+ {
91
+ schema: mesh_polygons_schemas.vertex_attribute,
92
+ params: { id, ...vertex_attribute },
93
+ },
94
+ {
95
+ response_function: expect.any(Function),
96
+ },
97
+ )
98
+ expect(dataStyleStore.meshPolygonsVertexAttribute(id)).toStrictEqual(
99
+ vertex_attribute,
100
+ )
101
+ expect(viewerStore.status).toBe(Status.CONNECTED)
102
+ })
103
+ })
104
+
105
+ describe("Polygons polygon attribute", () => {
106
+ test("Coloring polygon attribute", async () => {
107
+ const dataStyleStore = useDataStyleStore()
108
+ const viewerStore = useViewerStore()
109
+ const polygon_attribute = { name: "test_attribute" }
110
+ const spy = vi.spyOn(composables, "viewer_call")
111
+ await dataStyleStore.setMeshPolygonsPolygonAttribute(
112
+ id,
113
+ polygon_attribute,
114
+ )
115
+ expect(spy).toHaveBeenCalledWith(
116
+ {
117
+ schema: mesh_polygons_schemas.polygon_attribute,
118
+ params: { id, ...polygon_attribute },
119
+ },
120
+ {
121
+ response_function: expect.any(Function),
122
+ },
123
+ )
124
+ expect(dataStyleStore.meshPolygonsPolygonAttribute(id)).toStrictEqual(
125
+ polygon_attribute,
126
+ )
127
+ expect(viewerStore.status).toBe(Status.CONNECTED)
128
+ })
129
+ })
130
+
131
+ describe("Polygons active coloring", () => {
132
+ test("test coloring", async () => {
133
+ const dataStyleStore = useDataStyleStore()
134
+ const viewerStore = useViewerStore()
135
+ const coloringTypes = ["color", "vertex", "polygon"]
136
+ for (let i = 0; i < coloringTypes.length; i++) {
137
+ dataStyleStore.setMeshPolygonsActiveColoring(id, coloringTypes[i])
138
+ expect(dataStyleStore.meshPolygonsActiveColoring(id)).toBe(
139
+ coloringTypes[i],
140
+ )
141
+ expect(viewerStore.status).toBe(Status.CONNECTED)
142
+ }
143
+ })
144
+ })
94
145
  })
@@ -46,7 +46,7 @@ describe("CrsSelector.vue", () => {
46
46
  global: {
47
47
  plugins: [vuetify, pinia],
48
48
  },
49
- props: { input_geode_object: "BRep", key_to_update },
49
+ props: { geode_object_type: "BRep", key_to_update },
50
50
  })
51
51
  const td = await wrapper.find("td")
52
52
  await wrapper.vm.$nextTick()
@@ -43,7 +43,7 @@ describe("ExtensionSelector.vue", async () => {
43
43
  global: {
44
44
  plugins: [vuetify, pinia],
45
45
  },
46
- props: { input_geode_object: "BRep", filenames: ["test.toto"] },
46
+ props: { geode_object_type: "BRep", filenames: ["test.toto"] },
47
47
  })
48
48
  await nextTick()
49
49
  expect(wrapper.exists()).toBe(true)
@@ -50,14 +50,14 @@ describe("Inspector/InspectionButton.vue", async () => {
50
50
  inspection_result,
51
51
  }),
52
52
  })
53
- const input_geode_object = "BRep"
53
+ const geode_object_type = "BRep"
54
54
  const filename = "test.txt"
55
55
 
56
56
  const wrapper = await mountSuspended(InspectorInspectionButton, {
57
57
  global: {
58
58
  plugins: [vuetify, pinia],
59
59
  },
60
- props: { input_geode_object, filename },
60
+ props: { geode_object_type, filename },
61
61
  })
62
62
 
63
63
  expect(wrapper.exists()).toBe(true)
@@ -45,7 +45,7 @@ describe("MissingFilesSelector.vue", async () => {
45
45
  },
46
46
  props: {
47
47
  multiple: false,
48
- input_geode_object: "BRep",
48
+ geode_object_type: "BRep",
49
49
  filenames: ["fake_file.txt"],
50
50
  },
51
51
  })
@@ -50,7 +50,7 @@ describe("ObjectSelector.vue", async () => {
50
50
  expect(wrapper.emitted()).toHaveProperty("update_values")
51
51
  expect(wrapper.emitted().update_values).toHaveLength(1)
52
52
  expect(wrapper.emitted().update_values[0][0]).toEqual({
53
- input_geode_object: geode_object_1,
53
+ geode_object_type: geode_object_1,
54
54
  })
55
55
  })
56
56
 
@@ -83,7 +83,7 @@ describe("ObjectSelector.vue", async () => {
83
83
  expect(wrapper.emitted()).toHaveProperty("update_values")
84
84
  expect(wrapper.emitted().update_values).toHaveLength(1)
85
85
  expect(wrapper.emitted().update_values[0][0]).toEqual({
86
- input_geode_object: geode_object_1,
86
+ geode_object_type: geode_object_1,
87
87
  })
88
88
  })
89
89
 
@@ -112,7 +112,7 @@ describe("ObjectSelector.vue", async () => {
112
112
  expect(wrapper.emitted()).toHaveProperty("update_values")
113
113
  expect(wrapper.emitted().update_values).toHaveLength(1)
114
114
  expect(wrapper.emitted().update_values[0][0]).toEqual({
115
- input_geode_object: geode_object_1,
115
+ geode_object_type: geode_object_1,
116
116
  })
117
117
  })
118
118
  })
@@ -17,11 +17,11 @@ global.ResizeObserver = require("resize-observer-polyfill")
17
17
 
18
18
  describe("Step.vue", async () => {
19
19
  test(`BRep`, async () => {
20
- const input_geode_object = ref("BRep")
20
+ const geode_object_type = ref("BRep")
21
21
  const files = ref([])
22
22
  const stepper_tree = reactive({
23
23
  current_step_index: ref(0),
24
- input_geode_object,
24
+ geode_object_type,
25
25
  steps: [
26
26
  {
27
27
  step_title: "Confirm the data type",
@@ -35,10 +35,10 @@ describe("Step.vue", async () => {
35
35
  },
36
36
  },
37
37
  chips: computed(() => {
38
- if (input_geode_object.value === "") {
38
+ if (geode_object_type.value === "") {
39
39
  return []
40
40
  } else {
41
- return [input_geode_object.value]
41
+ return [geode_object_type.value]
42
42
  }
43
43
  }),
44
44
  },
@@ -18,11 +18,11 @@ global.ResizeObserver = require("resize-observer-polyfill")
18
18
 
19
19
  describe("Stepper.vue", async () => {
20
20
  test(`Mount`, async () => {
21
- const input_geode_object = ref("BRep")
21
+ const geode_object_type = ref("BRep")
22
22
  const files = ref([])
23
23
  const stepper_tree = reactive({
24
24
  current_step_index: ref(0),
25
- input_geode_object,
25
+ geode_object_type,
26
26
  steps: [
27
27
  {
28
28
  step_title: "Confirm the data type",
@@ -36,10 +36,10 @@ describe("Stepper.vue", async () => {
36
36
  },
37
37
  },
38
38
  chips: computed(() => {
39
- if (input_geode_object.value === "") {
39
+ if (geode_object_type.value === "") {
40
40
  return []
41
41
  } else {
42
- return [input_geode_object.value]
42
+ return [geode_object_type.value]
43
43
  }
44
44
  }),
45
45
  },
@@ -17,11 +17,11 @@ import { describe, expect, test } from "vitest"
17
17
 
18
18
  // describe("Step.vue", async () => {
19
19
  // test(`Mount`, async () => {
20
- // const input_geode_object = ref("BRep")
20
+ // const geode_object_type = ref("BRep")
21
21
  // const files = ref([])
22
22
  // const stepper_tree = reactive({
23
23
  // current_step_index: ref(0),
24
- // input_geode_object,
24
+ // geode_object_type,
25
25
  // steps: [
26
26
  // {
27
27
  // step_title: "Confirm the data type",
@@ -35,10 +35,10 @@ import { describe, expect, test } from "vitest"
35
35
  // },
36
36
  // },
37
37
  // chips: computed(() => {
38
- // if (input_geode_object.value === "") {
38
+ // if (geode_object_type.value === "") {
39
39
  // return []
40
40
  // } else {
41
- // return [input_geode_object.value]
41
+ // return [geode_object_type.value]
42
42
  // }
43
43
  // }),
44
44
  // },
@@ -11,12 +11,12 @@ const snapshotMock = {
11
11
  dataBase: {
12
12
  db: {
13
13
  abc123: {
14
- object_type: "mesh",
15
- geode_object: "PointSet2D",
16
- native_filename: "native.ext",
17
- viewable_filename: "viewable.ext",
18
- displayed_name: "My Data",
19
- vtk_js: { binary_light_viewable: "VGxpZ2h0RGF0YQ==" },
14
+ viewer_type: "mesh",
15
+ geode_object_type: "PointSet2D",
16
+ native_file: "native.ext",
17
+ viewable_file: "viewable.ext",
18
+ name: "My Data",
19
+ binary_light_viewable: "VGxpZ2h0RGF0YQ==",
20
20
  },
21
21
  },
22
22
  },
@@ -94,9 +94,8 @@ const hybridViewerStoreMock = {
94
94
  if (snapshot?.zScale != null)
95
95
  hybridViewerStoreMock.setZScaling(snapshot.zScale)
96
96
  if (snapshot?.camera_options) {
97
- const { viewer_call } = await import(
98
- "@ogw_front/composables/viewer_call.js"
99
- )
97
+ const { viewer_call } =
98
+ await import("@ogw_front/composables/viewer_call.js")
100
99
  viewer_call({
101
100
  schema: { $id: "opengeodeweb_viewer/viewer.update_camera" },
102
101
  params: { camera_options: snapshot.camera_options },
@@ -191,9 +190,8 @@ describe("ProjectManager composable (compact)", () => {
191
190
  (v) => typeof v === "function" && v.mockClear && v.mockClear(),
192
191
  )
193
192
  }
194
- const { viewer_call } = await import(
195
- "@ogw_front/composables/viewer_call.js"
196
- )
193
+ const { viewer_call } =
194
+ await import("@ogw_front/composables/viewer_call.js")
197
195
  viewer_call.mockClear()
198
196
  })
199
197
 
@@ -215,9 +213,8 @@ describe("ProjectManager composable (compact)", () => {
215
213
 
216
214
  await importProjectFile(file)
217
215
 
218
- const { viewer_call } = await import(
219
- "@ogw_front/composables/viewer_call.js"
220
- )
216
+ const { viewer_call } =
217
+ await import("@ogw_front/composables/viewer_call.js")
221
218
 
222
219
  expect(infraStoreMock.create_connection).toHaveBeenCalled()
223
220
  expect(viewerStoreMock.ws_connect).toHaveBeenCalled()
@@ -241,9 +238,9 @@ describe("ProjectManager composable (compact)", () => {
241
238
  expect(dataBaseStoreMock.addItem).toHaveBeenCalledWith(
242
239
  "abc123",
243
240
  expect.objectContaining({
244
- object_type: "mesh",
245
- geode_object: "PointSet2D",
246
- displayed_name: "My Data",
241
+ viewer_type: "mesh",
242
+ geode_object_type: "PointSet2D",
243
+ name: "My Data",
247
244
  }),
248
245
  )
249
246
  expect(treeviewStoreMock.addItem).toHaveBeenCalledWith(
@@ -52,12 +52,12 @@ describe("Project import", () => {
52
52
  dataBase: {
53
53
  db: {
54
54
  abc123: {
55
- object_type: "mesh",
56
- geode_object: "PointSet2D",
57
- native_filename: "native.ext",
58
- viewable_filename: "viewable.ext",
59
- displayed_name: "My Data",
60
- vtk_js: { binary_light_viewable: "VGxpZ2h0RGF0YQ==" },
55
+ viewer_type: "mesh",
56
+ geode_object_type: "PointSet2D",
57
+ native_file: "native.ext",
58
+ viewable_file: "viewable.ext",
59
+ name: "My Data",
60
+ binary_light_viewable: "VGxpZ2h0RGF0YQ==",
61
61
  },
62
62
  },
63
63
  },