diff --git a/app/components/CrsSelector.vue b/app/components/CrsSelector.vue index 5d35f627..1bf34f31 100644 --- a/app/components/CrsSelector.vue +++ b/app/components/CrsSelector.vue @@ -70,7 +70,7 @@ toggle_loading() await geodeStore.request(schema, params, { response_function: (response) => { - crs_list.value = response._data.crs_list + crs_list.value = response.crs_list }, }) toggle_loading() diff --git a/app/components/ExtensionSelector.vue b/app/components/ExtensionSelector.vue index e324e9af..64efabe8 100644 --- a/app/components/ExtensionSelector.vue +++ b/app/components/ExtensionSelector.vue @@ -90,7 +90,7 @@ geodeStore.request(schema, params, { request_error_function: () => reject(), response_function: (response) => { - resolve(response._data.geode_objects_and_output_extensions) + resolve(response.geode_objects_and_output_extensions) }, response_error_function: () => reject(), }) diff --git a/app/components/FileSelector.vue b/app/components/FileSelector.vue index 081eeaeb..d3e206ff 100644 --- a/app/components/FileSelector.vue +++ b/app/components/FileSelector.vue @@ -58,7 +58,7 @@ toggle_loading() const geodeStore = useGeodeStore() const response = await geodeStore.request(schema, {}) - accept.value = response.data.value.extensions + accept.value = response.extensions .map((extension) => "." + extension) .join(",") toggle_loading() diff --git a/app/components/Inspector/InspectionButton.vue b/app/components/Inspector/InspectionButton.vue index 00a20435..73c15376 100644 --- a/app/components/Inspector/InspectionButton.vue +++ b/app/components/Inspector/InspectionButton.vue @@ -39,7 +39,7 @@ await geodeStore.request(schema, params, { response_function: (response) => { emit("update_values", { - inspection_result: [response._data.inspection_result], + inspection_result: [response.inspection_result], }) emit("increment_step") }, diff --git a/app/components/MissingFilesSelector.vue b/app/components/MissingFilesSelector.vue index de3a3cad..a7ebfe22 100644 --- a/app/components/MissingFilesSelector.vue +++ b/app/components/MissingFilesSelector.vue @@ -89,7 +89,7 @@ return new Promise((resolve, reject) => { geodeStore.request(schema, params, { request_error_function: () => reject(), - response_function: (response) => resolve(response._data), + response_function: (response) => resolve(response), response_error_function: () => reject(), }) }) diff --git a/app/components/ObjectSelector.vue b/app/components/ObjectSelector.vue index e419ae43..27c020f6 100644 --- a/app/components/ObjectSelector.vue +++ b/app/components/ObjectSelector.vue @@ -115,9 +115,7 @@ return geodeStore.request(schema, { filename }) }) const responses = await Promise.all(promise_array) - const allowed_objects_list = responses.map( - (r) => r.data.value.allowed_objects, - ) + const allowed_objects_list = responses.map((r) => r.allowed_objects) const all_keys = [...new Set(allowed_objects_list.flatMap(Object.keys))] const common_keys = all_keys.filter((key) => allowed_objects_list.every((obj) => key in obj), diff --git a/app/components/PackagesVersions.vue b/app/components/PackagesVersions.vue index 6d2b1440..8a98839e 100644 --- a/app/components/PackagesVersions.vue +++ b/app/components/PackagesVersions.vue @@ -35,7 +35,7 @@ {}, { response_function: (response) => { - packages_versions.value = response._data.versions + packages_versions.value = response.versions }, }, ) diff --git a/app/components/Viewer/Options/CellAttributeSelector.vue b/app/components/Viewer/Options/CellAttributeSelector.vue index 19a49234..cd0c3153 100644 --- a/app/components/Viewer/Options/CellAttributeSelector.vue +++ b/app/components/Viewer/Options/CellAttributeSelector.vue @@ -44,7 +44,7 @@ }, { response_function: (response) => { - cell_attribute_names.value = response._data.cell_attribute_names + cell_attribute_names.value = response.cell_attribute_names }, }, ) diff --git a/app/components/Viewer/Options/PolygonAttributeSelector.vue b/app/components/Viewer/Options/PolygonAttributeSelector.vue index efd930c8..0c24c1b6 100644 --- a/app/components/Viewer/Options/PolygonAttributeSelector.vue +++ b/app/components/Viewer/Options/PolygonAttributeSelector.vue @@ -44,7 +44,7 @@ }, { response_function: (response) => { - polygon_attribute_names.value = response._data.polygon_attribute_names + polygon_attribute_names.value = response.polygon_attribute_names }, }, ) diff --git a/app/components/Viewer/Options/PolyhedronAttributeSelector.vue b/app/components/Viewer/Options/PolyhedronAttributeSelector.vue index 6bf2cd27..b4e86a39 100644 --- a/app/components/Viewer/Options/PolyhedronAttributeSelector.vue +++ b/app/components/Viewer/Options/PolyhedronAttributeSelector.vue @@ -46,8 +46,7 @@ { id: props.id }, { response_function: (response) => { - polyhedron_attribute_names.value = - response._data.polyhedron_attribute_names + polyhedron_attribute_names.value = response.polyhedron_attribute_names }, }, ) diff --git a/app/components/Viewer/Options/TextureItem.vue b/app/components/Viewer/Options/TextureItem.vue index 3cd558aa..a1d77878 100644 --- a/app/components/Viewer/Options/TextureItem.vue +++ b/app/components/Viewer/Options/TextureItem.vue @@ -67,7 +67,7 @@ { id: props.id }, { response_function: (response) => { - texture_coordinates.value = response._data.texture_coordinates + texture_coordinates.value = response.texture_coordinates }, }, ) @@ -86,7 +86,7 @@ }, { response_function: async (response) => { - texture_id.value = response._data.id + texture_id.value = response.id }, }, ) diff --git a/app/components/Viewer/Options/VertexAttributeSelector.vue b/app/components/Viewer/Options/VertexAttributeSelector.vue index 39cb021b..3dcc5036 100644 --- a/app/components/Viewer/Options/VertexAttributeSelector.vue +++ b/app/components/Viewer/Options/VertexAttributeSelector.vue @@ -41,7 +41,7 @@ { id: props.id }, { response_function: (response) => { - vertex_attribute_names.value = response._data.vertex_attribute_names + vertex_attribute_names.value = response.vertex_attribute_names }, }, ) diff --git a/app/components/Viewer/TreeComponent.vue b/app/components/Viewer/TreeComponent.vue index b339d67a..a4d721b5 100644 --- a/app/components/Viewer/TreeComponent.vue +++ b/app/components/Viewer/TreeComponent.vue @@ -26,9 +26,9 @@ const props = defineProps({ id: { type: String, required: true } }) - const items = dataStore.formatedMeshComponents(props.id) - const mesh_components_selection = ref( - dataStyleStore.visibleMeshComponents(props.id), + const items = await dataStore.formatedMeshComponents(props.id) + const mesh_components_selection = dataStyleStore.visibleMeshComponents( + props.id, ) watch( @@ -37,79 +37,23 @@ if (!previous) previous = [] else { const { added, removed } = compareSelections(current, previous) - - const [added_corners, added_lines, added_surfaces, added_blocks] = - sortMeshComponents(added) - const [ - removed_corners, - removed_lines, - removed_surfaces, - removed_blocks, - ] = sortMeshComponents(removed) - if (added_corners.length > 0) { - dataStyleStore.setModelCornersVisibility( - props.id, - added_corners, - true, - ) - } - if (added_lines.length > 0) { - dataStyleStore.setModelLinesVisibility(props.id, added_lines, true) - } - if (added_surfaces.length > 0) { - dataStyleStore.setModelSurfacesVisibility( - props.id, - added_surfaces, - true, - ) - } - if (added_blocks.length > 0) { - dataStyleStore.setModelBlocksVisibility(props.id, added_blocks, true) - } - if (removed_corners.length > 0) { - dataStyleStore.setModelCornersVisibility( - props.id, - removed_corners, - false, - ) + if (added.length > 0) { + dataStyleStore + .setModelMeshComponentVisibility(props.id, added, true) + .then(() => { + hybridViewerStore.remoteRender() + }) + } else if (removed.length > 0) { + dataStyleStore + .setModelMeshComponentVisibility(props.id, removed, false) + .then(() => { + hybridViewerStore.remoteRender() + }) } - if (removed_lines.length > 0) { - dataStyleStore.setModelLinesVisibility(props.id, removed_lines, false) - } - if (removed_surfaces.length > 0) { - dataStyleStore.setModelSurfacesVisibility( - props.id, - removed_surfaces, - false, - ) - } - if (removed_blocks.length > 0) { - dataStyleStore.setModelBlocksVisibility( - props.id, - removed_blocks, - false, - ) - } - hybridViewerStore.remoteRender() } }, { immediate: true, deep: true }, ) - - function sortMeshComponents(items) { - var corner_ids = [], - line_ids = [], - surface_ids = [], - block_ids = [] - for (const item of items) { - const item_type = dataStore.meshComponentType(props.id, item) - if (item_type === "corner") corner_ids.push(item) - else if (item_type === "line") line_ids.push(item) - else if (item_type === "surface") surface_ids.push(item) - else if (item_type === "block") block_ids.push(item) - } - return [corner_ids, line_ids, surface_ids, block_ids] - }