@geode/opengeodeweb-front 10.27.0 → 10.27.1-rc.2
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/utils/local/cleanup.js +12 -11
- package/app/utils/local/microservices.js +1 -1
- package/package.json +3 -3
- package/app/components/Inspector/InspectionButton.vue +0 -48
- package/app/components/Inspector/ResultPanel.vue +0 -46
- package/tests/unit/components/Inspector/InspectionButton.nuxt.test.js +0 -58
- package/tests/unit/components/Inspector/ResultPanel.nuxt.test.js +0 -56
|
@@ -32,6 +32,9 @@ async function deleteFolderRecursive(folderPath) {
|
|
|
32
32
|
console.log("Retrying delete folder");
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
+
throw new Error(
|
|
36
|
+
`Failed to delete folder ${folderPath} after ${MAX_DELETE_FOLDER_RETRIES} retries`,
|
|
37
|
+
);
|
|
35
38
|
}
|
|
36
39
|
|
|
37
40
|
function killHttpMicroservice(microservice) {
|
|
@@ -102,7 +105,7 @@ function killWebsocketMicroservice(microservice) {
|
|
|
102
105
|
});
|
|
103
106
|
}
|
|
104
107
|
|
|
105
|
-
async function killMicroservice(microservice
|
|
108
|
+
async function killMicroservice(microservice) {
|
|
106
109
|
if (microservice.type === "back") {
|
|
107
110
|
await killHttpMicroservice(microservice);
|
|
108
111
|
} else if (microservice.type === "viewer") {
|
|
@@ -110,20 +113,18 @@ async function killMicroservice(microservice, microservices) {
|
|
|
110
113
|
} else {
|
|
111
114
|
throw new Error(`Unknown microservice type: ${microservice.type}`);
|
|
112
115
|
}
|
|
113
|
-
|
|
114
|
-
if (microservices) {
|
|
115
|
-
const index = microservices.indexOf(microservice);
|
|
116
|
-
if (index !== -1) {
|
|
117
|
-
microservices.splice(index, 1);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
116
|
}
|
|
121
117
|
|
|
122
|
-
function killMicroservices(microservices) {
|
|
118
|
+
async function killMicroservices(microservices) {
|
|
123
119
|
console.log("killMicroservices", { microservices });
|
|
124
|
-
|
|
125
|
-
microservices.map((microservice) => killMicroservice(microservice
|
|
120
|
+
const results = await Promise.allSettled(
|
|
121
|
+
microservices.map((microservice) => killMicroservice(microservice)),
|
|
126
122
|
);
|
|
123
|
+
const killed = microservices.filter((_, index) => results[index].status === "fulfilled");
|
|
124
|
+
for (let i = 0; i < killed.length; i += 1) {
|
|
125
|
+
const microservice = microservices[i];
|
|
126
|
+
microservices.splice(microservices.indexOf(microservice), 1);
|
|
127
|
+
}
|
|
127
128
|
}
|
|
128
129
|
|
|
129
130
|
function projectMicroservices(projectFolderPath) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geode/opengeodeweb-front",
|
|
3
|
-
"version": "10.27.
|
|
3
|
+
"version": "10.27.1-rc.2",
|
|
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": {
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"build": ""
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@geode/opengeodeweb-back": "
|
|
38
|
-
"@geode/opengeodeweb-viewer": "
|
|
37
|
+
"@geode/opengeodeweb-back": "next",
|
|
38
|
+
"@geode/opengeodeweb-viewer": "next",
|
|
39
39
|
"@google-cloud/run": "3.2.0",
|
|
40
40
|
"@kitware/vtk.js": "33.3.0",
|
|
41
41
|
"@mdi/font": "7.4.47",
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json";
|
|
3
|
-
import { useBackStore } from "@ogw_front/stores/back";
|
|
4
|
-
|
|
5
|
-
const schema = schemas.opengeodeweb_back.inspect_file;
|
|
6
|
-
|
|
7
|
-
const emit = defineEmits(["update_values", "increment_step", "decrement_step"]);
|
|
8
|
-
const { geodeObjectType, filename } = defineProps({
|
|
9
|
-
geodeObjectType: { type: String, required: true },
|
|
10
|
-
filename: { type: String, required: true },
|
|
11
|
-
});
|
|
12
|
-
const loading = ref(false);
|
|
13
|
-
const toggle_loading = useToggle(loading);
|
|
14
|
-
|
|
15
|
-
async function get_inspection_results() {
|
|
16
|
-
toggle_loading();
|
|
17
|
-
const params = {
|
|
18
|
-
geode_object_type: geodeObjectType,
|
|
19
|
-
filename,
|
|
20
|
-
};
|
|
21
|
-
const backStore = useBackStore();
|
|
22
|
-
|
|
23
|
-
await backStore.request(
|
|
24
|
-
{ schema, params },
|
|
25
|
-
{
|
|
26
|
-
response_function: (response) => {
|
|
27
|
-
emit("update_values", {
|
|
28
|
-
inspection_result: [response.inspection_result],
|
|
29
|
-
});
|
|
30
|
-
emit("increment_step");
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
);
|
|
34
|
-
toggle_loading();
|
|
35
|
-
}
|
|
36
|
-
</script>
|
|
37
|
-
|
|
38
|
-
<template>
|
|
39
|
-
<div class="pa-0">
|
|
40
|
-
<v-btn :loading="loading" color="primary" @click="get_inspection_results()">
|
|
41
|
-
Inspect
|
|
42
|
-
<template #loader>
|
|
43
|
-
<v-progress-circular indeterminate size="20" color="white" width="3" />
|
|
44
|
-
</template>
|
|
45
|
-
</v-btn>
|
|
46
|
-
<v-btn variant="text" @click="emit('decrement_step')">Cancel</v-btn>
|
|
47
|
-
</div>
|
|
48
|
-
</template>
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import InspectorResultPanel from "@ogw_front/components/Inspector/ResultPanel";
|
|
3
|
-
|
|
4
|
-
const { inspectionResult } = defineProps({
|
|
5
|
-
inspectionResult: { type: Array, required: true },
|
|
6
|
-
});
|
|
7
|
-
const opened_panels = ref([]);
|
|
8
|
-
|
|
9
|
-
onMounted(() => {
|
|
10
|
-
opened_panels.value = inspectionResult
|
|
11
|
-
.map((result, i) => (result.nb_issues > 0 ? i : -1))
|
|
12
|
-
.filter((index) => index !== -1);
|
|
13
|
-
});
|
|
14
|
-
</script>
|
|
15
|
-
|
|
16
|
-
<template>
|
|
17
|
-
<v-container class="pa-2">
|
|
18
|
-
<v-expansion-panels v-model="opened_panels" multiple elevation="5">
|
|
19
|
-
<v-expansion-panel v-for="(result, index) in inspectionResult" :key="index" class="card">
|
|
20
|
-
<v-expansion-panel-title>
|
|
21
|
-
<v-row align="center">
|
|
22
|
-
<v-col cols="auto">
|
|
23
|
-
<v-icon v-if="result.nb_issues == 0" color="primary" size="25">
|
|
24
|
-
mdi-check-circle-outline
|
|
25
|
-
</v-icon>
|
|
26
|
-
<v-icon v-else color="error" size="25"> mdi-close-circle </v-icon>
|
|
27
|
-
</v-col>
|
|
28
|
-
<v-col>
|
|
29
|
-
{{ result.title }}
|
|
30
|
-
</v-col>
|
|
31
|
-
</v-row>
|
|
32
|
-
</v-expansion-panel-title>
|
|
33
|
-
<v-expansion-panel-text>
|
|
34
|
-
<InspectorResultPanel v-if="result.children" :inspectionResult="result.children" />
|
|
35
|
-
<v-container v-if="result.issues">
|
|
36
|
-
<v-col>
|
|
37
|
-
<v-row v-for="(issue, index) in result.issues" :key="index" class="pa-0">
|
|
38
|
-
{{ issue }}
|
|
39
|
-
</v-row>
|
|
40
|
-
</v-col>
|
|
41
|
-
</v-container>
|
|
42
|
-
</v-expansion-panel-text>
|
|
43
|
-
</v-expansion-panel>
|
|
44
|
-
</v-expansion-panels>
|
|
45
|
-
</v-container>
|
|
46
|
-
</template>
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
// Third party imports
|
|
2
|
-
import * as components from "vuetify/components";
|
|
3
|
-
import { describe, expect, test, vi } from "vitest";
|
|
4
|
-
import { flushPromises } from "@vue/test-utils";
|
|
5
|
-
import { mountSuspended } from "@nuxt/test-utils/runtime";
|
|
6
|
-
|
|
7
|
-
// Local imports
|
|
8
|
-
import { setupActivePinia, vuetify } from "@ogw_tests/utils";
|
|
9
|
-
import InspectorInspectionButton from "@ogw_front/components/Inspector/InspectionButton";
|
|
10
|
-
import { useBackStore } from "@ogw_front/stores/back";
|
|
11
|
-
|
|
12
|
-
describe("inspector inspection button", () => {
|
|
13
|
-
const pinia = setupActivePinia();
|
|
14
|
-
const backStore = useBackStore();
|
|
15
|
-
backStore.base_url = "/";
|
|
16
|
-
|
|
17
|
-
test("with issues", async () => {
|
|
18
|
-
const inspection_result = {
|
|
19
|
-
title: "Brep inspection",
|
|
20
|
-
nb_issues: 3,
|
|
21
|
-
children: [
|
|
22
|
-
{
|
|
23
|
-
title: "Brep inspection",
|
|
24
|
-
nb_issues: 2,
|
|
25
|
-
issues: ["issue 1", "issue 2"],
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
title: "Brep inspection",
|
|
29
|
-
nb_issues: 1,
|
|
30
|
-
issues: ["issue 1"],
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
};
|
|
34
|
-
backStore.request = vi.fn((request, callbacks) => {
|
|
35
|
-
callbacks?.response_function?.({ inspection_result });
|
|
36
|
-
return Promise.resolve({ inspection_result });
|
|
37
|
-
});
|
|
38
|
-
const geode_object_type = "BRep";
|
|
39
|
-
const filename = "test.txt";
|
|
40
|
-
const wrapper = await mountSuspended(InspectorInspectionButton, {
|
|
41
|
-
global: {
|
|
42
|
-
plugins: [vuetify, pinia],
|
|
43
|
-
},
|
|
44
|
-
props: { geode_object_type, filename },
|
|
45
|
-
});
|
|
46
|
-
expect(wrapper.exists()).toBe(true);
|
|
47
|
-
const v_btn = await wrapper.findComponent(components.VBtn);
|
|
48
|
-
await v_btn.trigger("click");
|
|
49
|
-
await flushPromises();
|
|
50
|
-
|
|
51
|
-
expect(wrapper.emitted()).toHaveProperty("update_values");
|
|
52
|
-
expect(wrapper.emitted().update_values).toHaveLength(1);
|
|
53
|
-
expect(wrapper.emitted().update_values[0][0]).toStrictEqual({
|
|
54
|
-
inspection_result: [inspection_result],
|
|
55
|
-
});
|
|
56
|
-
expect(wrapper.emitted()).toHaveProperty("increment_step");
|
|
57
|
-
});
|
|
58
|
-
});
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
// Third party imports
|
|
2
|
-
import { describe, expect, test } from "vitest";
|
|
3
|
-
import { mountSuspended } from "@nuxt/test-utils/runtime";
|
|
4
|
-
|
|
5
|
-
// Local imports
|
|
6
|
-
import InspectorResultPanel from "@ogw_front/components/Inspector/ResultPanel";
|
|
7
|
-
import { vuetify } from "@ogw_tests/utils";
|
|
8
|
-
|
|
9
|
-
describe("inspector result panel", () => {
|
|
10
|
-
test("with issues", async () => {
|
|
11
|
-
const inspection_result = [
|
|
12
|
-
{
|
|
13
|
-
title: "Brep inspection",
|
|
14
|
-
nb_issues: 26,
|
|
15
|
-
children: [],
|
|
16
|
-
},
|
|
17
|
-
];
|
|
18
|
-
|
|
19
|
-
const wrapper = await mountSuspended(InspectorResultPanel, {
|
|
20
|
-
global: {
|
|
21
|
-
plugins: [vuetify],
|
|
22
|
-
},
|
|
23
|
-
props: { inspectionResult: inspection_result },
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
expect(wrapper.exists()).toBe(true);
|
|
27
|
-
expect(wrapper.componentVM.inspectionResult).toStrictEqual(inspection_result);
|
|
28
|
-
|
|
29
|
-
const child_result_panel_wrapper = await wrapper.findComponent(InspectorResultPanel);
|
|
30
|
-
expect(child_result_panel_wrapper.exists()).toBe(true);
|
|
31
|
-
expect(child_result_panel_wrapper.componentVM.inspectionResult).toStrictEqual(
|
|
32
|
-
inspection_result[0].children,
|
|
33
|
-
);
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
test("without issues", async () => {
|
|
37
|
-
const inspection_result = [
|
|
38
|
-
{
|
|
39
|
-
title: "Brep inspection",
|
|
40
|
-
nb_issues: 0,
|
|
41
|
-
},
|
|
42
|
-
];
|
|
43
|
-
const wrapper = await mountSuspended(InspectorResultPanel, {
|
|
44
|
-
global: {
|
|
45
|
-
plugins: [vuetify],
|
|
46
|
-
},
|
|
47
|
-
props: { inspectionResult: inspection_result },
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
expect(wrapper.exists()).toBe(true);
|
|
51
|
-
|
|
52
|
-
console.log({ wrapper });
|
|
53
|
-
|
|
54
|
-
expect(wrapper.componentVM.inspectionResult).toStrictEqual(inspection_result);
|
|
55
|
-
});
|
|
56
|
-
});
|