@geode/opengeodeweb-front 10.4.0-rc.2 → 10.4.0
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/stores/data.js +37 -25
- package/app/utils/file_import_workflow.js +1 -1
- package/internal/database/tables/model_components.js +1 -1
- package/package.json +3 -3
- package/tests/integration/microservices/back/requirements.txt +1 -1
- package/tests/integration/microservices/viewer/requirements.txt +1 -1
package/app/stores/data.js
CHANGED
|
@@ -34,27 +34,32 @@ export const useDataStore = defineStore("data", () => {
|
|
|
34
34
|
|
|
35
35
|
async function formatedMeshComponents(id) {
|
|
36
36
|
const items = await database.model_components.where({ id }).toArray()
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
.toArray()
|
|
44
|
-
|
|
45
|
-
return {
|
|
46
|
-
id: type,
|
|
47
|
-
title: type,
|
|
48
|
-
children: meshComponents.map((meshComponent) => ({
|
|
49
|
-
id: meshComponent.geode_id,
|
|
50
|
-
title: meshComponent.name,
|
|
51
|
-
category: meshComponent.type,
|
|
52
|
-
})),
|
|
53
|
-
}
|
|
54
|
-
}),
|
|
55
|
-
)
|
|
37
|
+
const componentTitles = {
|
|
38
|
+
Corner: "Corners",
|
|
39
|
+
Line: "Lines",
|
|
40
|
+
Surface: "Surfaces",
|
|
41
|
+
Block: "Blocks",
|
|
42
|
+
}
|
|
56
43
|
|
|
57
|
-
|
|
44
|
+
const componentsByType = items.reduce((accumulator, item) => {
|
|
45
|
+
if (componentTitles[item.type]) {
|
|
46
|
+
if (!accumulator[item.type]) accumulator[item.type] = []
|
|
47
|
+
accumulator[item.type].push(item)
|
|
48
|
+
}
|
|
49
|
+
return accumulator
|
|
50
|
+
}, {})
|
|
51
|
+
|
|
52
|
+
return Object.keys(componentTitles)
|
|
53
|
+
.filter((type) => componentsByType[type])
|
|
54
|
+
.map((type) => ({
|
|
55
|
+
id: type,
|
|
56
|
+
title: componentTitles[type],
|
|
57
|
+
children: componentsByType[type].map((meshComponent) => ({
|
|
58
|
+
id: meshComponent.geode_id,
|
|
59
|
+
title: meshComponent.name,
|
|
60
|
+
category: meshComponent.type,
|
|
61
|
+
})),
|
|
62
|
+
}))
|
|
58
63
|
}
|
|
59
64
|
|
|
60
65
|
async function meshComponentType(id, geode_id) {
|
|
@@ -109,15 +114,22 @@ export const useDataStore = defineStore("data", () => {
|
|
|
109
114
|
await database.model_components.where({ id }).delete()
|
|
110
115
|
}
|
|
111
116
|
|
|
112
|
-
async function
|
|
117
|
+
async function fetchModelComponents(id) {
|
|
113
118
|
const geodeStore = useGeodeStore()
|
|
114
119
|
return await geodeStore.request(
|
|
115
|
-
back_model_schemas.
|
|
120
|
+
back_model_schemas.model_components,
|
|
116
121
|
{ id },
|
|
117
122
|
{
|
|
118
123
|
response_function: async (response) => {
|
|
119
|
-
const
|
|
120
|
-
|
|
124
|
+
const allComponents = [
|
|
125
|
+
...response.mesh_components.map(
|
|
126
|
+
({ boundaries, internals, ...component }) => component,
|
|
127
|
+
),
|
|
128
|
+
...response.collection_components.map(
|
|
129
|
+
({ items, ...component }) => component,
|
|
130
|
+
),
|
|
131
|
+
].map((component) => ({ ...component, id }))
|
|
132
|
+
await addModelComponents(allComponents)
|
|
121
133
|
},
|
|
122
134
|
},
|
|
123
135
|
)
|
|
@@ -178,7 +190,7 @@ export const useDataStore = defineStore("data", () => {
|
|
|
178
190
|
addItem,
|
|
179
191
|
deleteItem,
|
|
180
192
|
updateItem,
|
|
181
|
-
|
|
193
|
+
fetchModelComponents,
|
|
182
194
|
getCornersGeodeIds,
|
|
183
195
|
getLinesGeodeIds,
|
|
184
196
|
getSurfacesGeodeIds,
|
|
@@ -50,7 +50,7 @@ async function importItem(item) {
|
|
|
50
50
|
await dataStyleStore.addDataStyle(item.id, item.geode_object_type)
|
|
51
51
|
|
|
52
52
|
if (item.viewer_type === "model") {
|
|
53
|
-
await dataStore.
|
|
53
|
+
await dataStore.fetchModelComponents(item.id)
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
await dataStyleStore.applyDefaultStyle(item.id)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geode/opengeodeweb-front",
|
|
3
|
-
"version": "10.4.0
|
|
3
|
+
"version": "10.4.0",
|
|
4
4
|
"description": "OpenSource Vue/Nuxt/Pinia/Vuetify framework for web applications",
|
|
5
5
|
"homepage": "https://github.com/Geode-solutions/OpenGeodeWeb-Front",
|
|
6
6
|
"bugs": {
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"build": ""
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@geode/opengeodeweb-back": "
|
|
35
|
-
"@geode/opengeodeweb-viewer": "
|
|
34
|
+
"@geode/opengeodeweb-back": "latest",
|
|
35
|
+
"@geode/opengeodeweb-viewer": "latest",
|
|
36
36
|
"@kitware/vtk.js": "33.3.0",
|
|
37
37
|
"@mdi/font": "7.4.47",
|
|
38
38
|
"@pinia/nuxt": "0.11.3",
|