@geode/opengeodeweb-front 10.0.0 → 10.0.1-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.
- package/app/components/CrsSelector.vue +3 -3
- package/app/components/ExtensionSelector.vue +3 -3
- package/app/components/FileSelector.vue +1 -2
- package/app/components/Inspector/InspectionButton.vue +4 -4
- package/app/components/MissingFilesSelector.vue +3 -3
- package/app/components/ObjectSelector.vue +5 -4
- package/app/components/Viewer/BreadCrumb.vue +1 -1
- package/app/components/Viewer/ContextMenu.vue +2 -2
- package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +81 -0
- package/app/components/Viewer/Grid/2D/CellsOptions.vue +2 -2
- package/app/components/Viewer/Grid/3D/CellsOptions.vue +2 -2
- package/app/components/Viewer/Options/CellAttributeSelector.vue +52 -0
- package/app/components/Viewer/Options/ColoringTypeSelector.vue +15 -1
- package/app/components/Viewer/Options/PolygonAttributeSelector.vue +2 -2
- package/app/components/Viewer/Options/TextureItem.vue +1 -1
- package/app/components/Viewer/Options/VertexAttributeSelector.vue +5 -8
- package/app/components/Viewer/TreeObject.vue +2 -2
- package/app/composables/project_manager.js +1 -10
- package/app/stores/data_base.js +7 -14
- package/app/stores/data_style.js +11 -11
- package/app/stores/feedback.js +1 -1
- package/app/stores/hybrid_viewer.js +1 -1
- package/app/stores/menu.js +1 -1
- package/app/stores/treeview.js +4 -4
- package/app/stores/viewer.js +2 -3
- package/app/utils/default_styles.js +43 -7
- package/app/utils/file_import_workflow.js +16 -20
- package/app/utils/local.js +4 -0
- package/internal_stores/mesh/cells.js +176 -0
- package/internal_stores/mesh/index.js +9 -4
- package/internal_stores/mesh/polygons.js +12 -3
- package/package.json +3 -3
- package/tests/integration/data/uploads/test.og_psf3d +0 -0
- package/tests/integration/data/uploads/test.og_rgd2d +0 -0
- package/tests/integration/microservices/back/requirements.txt +1 -1
- package/tests/integration/microservices/viewer/requirements.txt +1 -1
- package/tests/integration/stores/data_style/mesh/cells.nuxt.test.js +142 -0
- package/tests/integration/stores/data_style/mesh/edges.nuxt.test.js +16 -14
- package/tests/integration/stores/data_style/mesh/points.nuxt.test.js +15 -14
- package/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js +65 -14
- package/tests/unit/components/CrsSelector.nuxt.test.js +1 -1
- package/tests/unit/components/ExtensionSelector.nuxt.test.js +1 -1
- package/tests/unit/components/Inspector/InspectionButton.nuxt.test.js +2 -2
- package/tests/unit/components/MissingFilesSelector.nuxt.test.js +1 -1
- package/tests/unit/components/ObjectSelector.nuxt.test.js +3 -3
- package/tests/unit/components/Step.nuxt.test.js +4 -4
- package/tests/unit/components/Stepper.nuxt.test.js +4 -4
- package/tests/unit/components/Wrapper.nuxt.test.js +4 -4
- package/tests/unit/composables/ProjectManager.nuxt.test.js +15 -18
- package/tests/unit/plugins/project_load.nuxt.test.js +6 -6
|
@@ -57,20 +57,6 @@ describe("Mesh points", () => {
|
|
|
57
57
|
})
|
|
58
58
|
})
|
|
59
59
|
|
|
60
|
-
describe("Points 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.setMeshPointsActiveColoring(id, coloringTypes[i])
|
|
67
|
-
expect(dataStyleStore.meshPointsActiveColoring(id)).toBe(
|
|
68
|
-
coloringTypes[i],
|
|
69
|
-
)
|
|
70
|
-
expect(viewerStore.status).toBe(Status.CONNECTED)
|
|
71
|
-
}
|
|
72
|
-
})
|
|
73
|
-
})
|
|
74
60
|
describe("Points color", () => {
|
|
75
61
|
test("Color red", async () => {
|
|
76
62
|
const dataStyleStore = useDataStyleStore()
|
|
@@ -92,6 +78,21 @@ describe("Mesh points", () => {
|
|
|
92
78
|
})
|
|
93
79
|
})
|
|
94
80
|
|
|
81
|
+
describe("Points active coloring", () => {
|
|
82
|
+
test("test coloring", async () => {
|
|
83
|
+
const dataStyleStore = useDataStyleStore()
|
|
84
|
+
const viewerStore = useViewerStore()
|
|
85
|
+
const coloringTypes = ["color"]
|
|
86
|
+
for (let i = 0; i < coloringTypes.length; i++) {
|
|
87
|
+
dataStyleStore.setMeshPointsActiveColoring(id, coloringTypes[i])
|
|
88
|
+
expect(dataStyleStore.meshPointsActiveColoring(id)).toBe(
|
|
89
|
+
coloringTypes[i],
|
|
90
|
+
)
|
|
91
|
+
expect(viewerStore.status).toBe(Status.CONNECTED)
|
|
92
|
+
}
|
|
93
|
+
})
|
|
94
|
+
})
|
|
95
|
+
|
|
95
96
|
describe("Points size", () => {
|
|
96
97
|
test("Size 20", async () => {
|
|
97
98
|
const dataStyleStore = useDataStyleStore()
|
|
@@ -57,20 +57,7 @@ describe("Mesh polygons", () => {
|
|
|
57
57
|
expect(viewerStore.status).toBe(Status.CONNECTED)
|
|
58
58
|
})
|
|
59
59
|
})
|
|
60
|
-
|
|
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: {
|
|
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: {
|
|
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
|
|
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: {
|
|
60
|
+
props: { geode_object_type, filename },
|
|
61
61
|
})
|
|
62
62
|
|
|
63
63
|
expect(wrapper.exists()).toBe(true)
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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 (
|
|
38
|
+
if (geode_object_type.value === "") {
|
|
39
39
|
return []
|
|
40
40
|
} else {
|
|
41
|
-
return [
|
|
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
|
|
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
|
-
|
|
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 (
|
|
39
|
+
if (geode_object_type.value === "") {
|
|
40
40
|
return []
|
|
41
41
|
} else {
|
|
42
|
-
return [
|
|
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
|
|
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
|
-
//
|
|
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 (
|
|
38
|
+
// if (geode_object_type.value === "") {
|
|
39
39
|
// return []
|
|
40
40
|
// } else {
|
|
41
|
-
// return [
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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 } =
|
|
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 } =
|
|
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 } =
|
|
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
|
-
|
|
245
|
-
|
|
246
|
-
|
|
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
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
},
|