@geode/opengeodeweb-front 10.27.1-rc.1 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geode/opengeodeweb-front",
3
- "version": "10.27.1-rc.1",
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": {
@@ -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
- });