@geode/opengeodeweb-front 10.0.4 → 10.0.5-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.
@@ -28,6 +28,12 @@ export const useTreeviewStore = defineStore("treeview", () => {
28
28
  }
29
29
  }
30
30
  items.value.push({ title: geode_object_type, children: [child] })
31
+ items.value.sort((a, b) =>
32
+ a.title.localeCompare(b.title, undefined, {
33
+ numeric: true,
34
+ sensitivity: "base",
35
+ }),
36
+ )
31
37
  selection.value.push(child)
32
38
  }
33
39
 
package/package.json CHANGED
@@ -38,11 +38,11 @@
38
38
  },
39
39
  "description": "OpenSource Vue/Nuxt/Pinia/Vuetify framework for web applications",
40
40
  "type": "module",
41
- "version": "10.0.4",
41
+ "version": "10.0.5-rc.2",
42
42
  "main": "./nuxt.config.js",
43
43
  "dependencies": {
44
- "@geode/opengeodeweb-back": "latest",
45
- "@geode/opengeodeweb-viewer": "latest",
44
+ "@geode/opengeodeweb-back": "next",
45
+ "@geode/opengeodeweb-viewer": "next",
46
46
  "@kitware/vtk.js": "33.3.0",
47
47
  "@mdi/font": "7.4.47",
48
48
  "@pinia/nuxt": "0.11.3",
@@ -5,4 +5,4 @@
5
5
  # pip-compile --output-file=tests/integration/microservices/back/requirements.txt tests/integration/microservices/back/requirements.in
6
6
  #
7
7
 
8
- opengeodeweb-back==5.*,>=5.14.3rc1
8
+ opengeodeweb-back==5.*,>=5.14.3
@@ -1,25 +1,17 @@
1
- import { registerEndpoint, mountSuspended } from "@nuxt/test-utils/runtime"
2
-
1
+ import { mountSuspended } from "@nuxt/test-utils/runtime"
3
2
  import { describe, expect, test, vi } from "vitest"
4
3
  import { setActivePinia } from "pinia"
5
4
  import { createTestingPinia } from "@pinia/testing"
6
- import { createVuetify } from "vuetify"
7
- import * as components from "vuetify/components"
8
- import * as directives from "vuetify/directives"
9
5
 
10
6
  import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
11
-
12
7
  import CrsSelector from "@ogw_front/components/CrsSelector"
13
8
  import { useGeodeStore } from "@ogw_front/stores/geode"
14
9
 
10
+ import { vuetify } from "../../utils"
11
+
15
12
  const crs_selector_schema =
16
13
  schemas.opengeodeweb_back.geographic_coordinate_systems
17
14
 
18
- const vuetify = createVuetify({
19
- components,
20
- directives,
21
- })
22
-
23
15
  describe("CrsSelector", () => {
24
16
  const pinia = createTestingPinia({
25
17
  stubActions: false,
@@ -1,25 +1,16 @@
1
1
  import { describe, expect, test, vi } from "vitest"
2
2
  import { registerEndpoint, mountSuspended } from "@nuxt/test-utils/runtime"
3
-
4
- import { createVuetify } from "vuetify"
5
- import * as components from "vuetify/components"
6
- import * as directives from "vuetify/directives"
7
3
  import { setActivePinia } from "pinia"
8
4
  import { createTestingPinia } from "@pinia/testing"
5
+ import * as components from "vuetify/components"
9
6
 
7
+ import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
10
8
  import ExtensionSelector from "@ogw_front/components/ExtensionSelector"
11
-
12
9
  import { useGeodeStore } from "@ogw_front/stores/geode"
13
-
14
- import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
10
+ import { vuetify } from "../../utils"
15
11
 
16
12
  const schema = schemas.opengeodeweb_back.geode_objects_and_output_extensions
17
13
 
18
- const vuetify = createVuetify({
19
- components,
20
- directives,
21
- })
22
-
23
14
  describe("ExtensionSelector", async () => {
24
15
  const pinia = createTestingPinia({
25
16
  stubActions: false,
@@ -1,18 +1,11 @@
1
1
  import { describe, expect, test, vi } from "vitest"
2
2
  import { mount } from "@vue/test-utils"
3
- import { createVuetify } from "vuetify"
4
- import * as components from "vuetify/components"
5
- import * as directives from "vuetify/directives"
6
3
  import { createTestingPinia } from "@pinia/testing"
7
4
  import { setActivePinia } from "pinia"
8
5
 
9
6
  import FeedBackErrorBanner from "@ogw_front/components/FeedBack/ErrorBanner"
10
7
  import { useFeedbackStore } from "@ogw_front/stores/feedback"
11
-
12
- const vuetify = createVuetify({
13
- components,
14
- directives,
15
- })
8
+ import { vuetify } from "../../../utils"
16
9
 
17
10
  describe("FeedBackErrorBanner", async () => {
18
11
  ;(test(`Test reload`, async () => {
@@ -2,20 +2,13 @@
2
2
  vi.stubGlobal("visualViewport", new EventTarget())
3
3
  import { describe, expect, test, vi } from "vitest"
4
4
  import { mount } from "@vue/test-utils"
5
- import { createVuetify } from "vuetify"
6
5
  import * as components from "vuetify/components"
7
- import * as directives from "vuetify/directives"
8
-
9
6
  import { setActivePinia } from "pinia"
10
7
  import { createTestingPinia } from "@pinia/testing"
11
8
 
12
9
  import FeedBackSnackers from "@ogw_front/components/FeedBack/Snackers"
13
10
  import { useFeedbackStore } from "@ogw_front/stores/feedback"
14
-
15
- const vuetify = createVuetify({
16
- components,
17
- directives,
18
- })
11
+ import { vuetify } from "../../../utils"
19
12
 
20
13
  describe("FeedBackSnackers", async () => {
21
14
  test(`Test delete error`, async () => {
@@ -1,10 +1,7 @@
1
1
  import { describe, expect, test, vi } from "vitest"
2
2
  import { registerEndpoint, mountSuspended } from "@nuxt/test-utils/runtime"
3
3
  import { flushPromises } from "@vue/test-utils"
4
-
5
- import { createVuetify } from "vuetify"
6
4
  import * as components from "vuetify/components"
7
- import * as directives from "vuetify/directives"
8
5
 
9
6
  import { setActivePinia } from "pinia"
10
7
  import { createTestingPinia } from "@pinia/testing"
@@ -14,15 +11,11 @@ import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
14
11
  import FileSelector from "@ogw_front/components/FileSelector"
15
12
  import FileUploader from "@ogw_front/components/FileUploader"
16
13
  import { useGeodeStore } from "@ogw_front/stores/geode"
14
+ import { vuetify } from "../../utils"
17
15
 
18
16
  const allowed_files_schema = schemas.opengeodeweb_back.allowed_files
19
17
  const upload_file_schema = schemas.opengeodeweb_back.upload_file
20
18
 
21
- const vuetify = createVuetify({
22
- components,
23
- directives,
24
- })
25
-
26
19
  describe("FileSelector", async () => {
27
20
  const pinia = createTestingPinia({
28
21
  stubActions: false,
@@ -1,10 +1,7 @@
1
1
  import { describe, expect, test, vi } from "vitest"
2
2
  import { registerEndpoint, mountSuspended } from "@nuxt/test-utils/runtime"
3
3
  import { flushPromises } from "@vue/test-utils"
4
-
5
- import { createVuetify } from "vuetify"
6
4
  import * as components from "vuetify/components"
7
- import * as directives from "vuetify/directives"
8
5
  import { setActivePinia } from "pinia"
9
6
  import { createTestingPinia } from "@pinia/testing"
10
7
 
@@ -13,12 +10,9 @@ import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
13
10
  import FileUploader from "@ogw_front/components/FileUploader"
14
11
  import { useGeodeStore } from "@ogw_front/stores/geode"
15
12
 
16
- const upload_file_schema = schemas.opengeodeweb_back.upload_file
13
+ import { vuetify } from "../../utils"
17
14
 
18
- const vuetify = createVuetify({
19
- components,
20
- directives,
21
- })
15
+ const upload_file_schema = schemas.opengeodeweb_back.upload_file
22
16
 
23
17
  describe("FileUploader", async () => {
24
18
  const pinia = createTestingPinia({
@@ -1,22 +1,16 @@
1
1
  import { describe, expect, test, vi } from "vitest"
2
- import { registerEndpoint, mountSuspended } from "@nuxt/test-utils/runtime"
2
+ import { mountSuspended } from "@nuxt/test-utils/runtime"
3
3
  import { flushPromises } from "@vue/test-utils"
4
-
5
- import { createVuetify } from "vuetify"
6
4
  import * as components from "vuetify/components"
7
- import * as directives from "vuetify/directives"
8
5
  import { setActivePinia } from "pinia"
9
6
  import { createTestingPinia } from "@pinia/testing"
10
7
 
11
8
  import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
12
9
  import InspectorInspectionButton from "@ogw_front/components/Inspector/InspectionButton"
13
10
  import { useGeodeStore } from "@ogw_front/stores/geode"
14
- const schema = schemas.opengeodeweb_back.inspect_file
11
+ import { vuetify } from "../../../utils"
15
12
 
16
- const vuetify = createVuetify({
17
- components,
18
- directives,
19
- })
13
+ const schema = schemas.opengeodeweb_back.inspect_file
20
14
 
21
15
  describe("Inspector/InspectionButton", async () => {
22
16
  const pinia = createTestingPinia({
@@ -1,16 +1,8 @@
1
1
  import { describe, expect, test } from "vitest"
2
2
  import { mountSuspended } from "@nuxt/test-utils/runtime"
3
3
 
4
- import { createVuetify } from "vuetify"
5
- import * as components from "vuetify/components"
6
- import * as directives from "vuetify/directives"
7
-
8
4
  import InspectorResultPanel from "@ogw_front/components/Inspector/ResultPanel"
9
-
10
- const vuetify = createVuetify({
11
- components,
12
- directives,
13
- })
5
+ import { vuetify } from "../../../utils"
14
6
 
15
7
  describe("Inspector/ResultPanel", async () => {
16
8
  test(`Test with issues`, async () => {
@@ -1,22 +1,13 @@
1
1
  import { describe, expect, test, vi } from "vitest"
2
2
  import { flushPromises } from "@vue/test-utils"
3
3
  import { mountSuspended } from "@nuxt/test-utils/runtime"
4
-
5
- import { createVuetify } from "vuetify"
6
- import * as components from "vuetify/components"
7
- import * as directives from "vuetify/directives"
8
-
9
4
  import { setActivePinia } from "pinia"
10
5
  import { createTestingPinia } from "@pinia/testing"
11
6
 
12
7
  import Launcher from "@ogw_front/components/Launcher"
13
8
 
14
9
  import { useInfraStore } from "@ogw_front/stores/infra"
15
-
16
- const vuetify = createVuetify({
17
- components,
18
- directives,
19
- })
10
+ import { vuetify } from "../../utils"
20
11
 
21
12
  // Mock navigator.locks API
22
13
  const mockLockRequest = vi.fn().mockImplementation(async (name, callback) => {
@@ -1,10 +1,7 @@
1
1
  import { describe, expect, test, vi } from "vitest"
2
2
  import { registerEndpoint, mountSuspended } from "@nuxt/test-utils/runtime"
3
3
  import { flushPromises } from "@vue/test-utils"
4
-
5
- import { createVuetify } from "vuetify"
6
4
  import * as components from "vuetify/components"
7
- import * as directives from "vuetify/directives"
8
5
  import { setActivePinia } from "pinia"
9
6
  import { createTestingPinia } from "@pinia/testing"
10
7
 
@@ -14,14 +11,11 @@ import MissingFilesSelector from "@ogw_front/components/MissingFilesSelector"
14
11
  import FileUploader from "@ogw_front/components/FileUploader"
15
12
  import { useGeodeStore } from "@ogw_front/stores/geode"
16
13
 
14
+ import { vuetify } from "../../utils"
15
+
17
16
  const missing_files_schema = schemas.opengeodeweb_back.missing_files
18
17
  const upload_file_schema = schemas.opengeodeweb_back.upload_file
19
18
 
20
- const vuetify = createVuetify({
21
- components,
22
- directives,
23
- })
24
-
25
19
  describe("MissingFilesSelector", async () => {
26
20
  const pinia = createTestingPinia({
27
21
  stubActions: false,
@@ -1,26 +1,17 @@
1
1
  import { describe, expect, test, vi } from "vitest"
2
2
  import { registerEndpoint, mountSuspended } from "@nuxt/test-utils/runtime"
3
3
  import { flushPromises } from "@vue/test-utils"
4
-
5
- import { createVuetify } from "vuetify"
6
4
  import * as components from "vuetify/components"
7
- import * as directives from "vuetify/directives"
8
5
  import { setActivePinia } from "pinia"
9
6
  import { createTestingPinia } from "@pinia/testing"
10
7
 
8
+ import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
11
9
  import ObjectSelector from "@ogw_front/components/ObjectSelector"
12
-
13
10
  import { useGeodeStore } from "@ogw_front/stores/geode"
14
-
15
- import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
11
+ import { vuetify } from "../../utils"
16
12
 
17
13
  const allowed_objects = schemas.opengeodeweb_back.allowed_objects
18
14
 
19
- const vuetify = createVuetify({
20
- components,
21
- directives,
22
- })
23
-
24
15
  describe("ObjectSelector", async () => {
25
16
  const pinia = createTestingPinia({
26
17
  stubActions: false,
@@ -1,20 +1,11 @@
1
1
  import { describe, expect, test, vi } from "vitest"
2
2
  import { mountSuspended, registerEndpoint } from "@nuxt/test-utils/runtime"
3
-
4
- import { createVuetify } from "vuetify"
5
- import * as components from "vuetify/components"
6
- import * as directives from "vuetify/directives"
7
-
8
3
  import { setActivePinia } from "pinia"
9
4
  import { createTestingPinia } from "@pinia/testing"
10
5
 
11
6
  import PackagesVersions from "@ogw_front/components/PackagesVersions"
12
7
  import { useGeodeStore } from "@ogw_front/stores/geode"
13
-
14
- const vuetify = createVuetify({
15
- components,
16
- directives,
17
- })
8
+ import { vuetify } from "../../utils"
18
9
 
19
10
  describe("PackagesVersions", async () => {
20
11
  test(`Mount`, async () => {
@@ -1,17 +1,9 @@
1
1
  import { describe, expect, test } from "vitest"
2
2
  import { mount } from "@vue/test-utils"
3
-
4
- import { createVuetify } from "vuetify"
5
- import * as components from "vuetify/components"
6
- import * as directives from "vuetify/directives"
7
-
8
3
  import Step from "@ogw_front/components/Step"
9
4
  import ObjectSelector from "@ogw_front/components/ObjectSelector"
10
5
 
11
- const vuetify = createVuetify({
12
- components,
13
- directives,
14
- })
6
+ import { vuetify } from "../../utils"
15
7
 
16
8
  global.ResizeObserver = require("resize-observer-polyfill")
17
9
 
@@ -1,18 +1,10 @@
1
1
  import { describe, expect, test } from "vitest"
2
2
  import { mountSuspended } from "@vue/test-utils"
3
3
 
4
- import { createVuetify } from "vuetify"
5
- import * as components from "vuetify/components"
6
- import * as directives from "vuetify/directives"
7
-
8
4
  import Stepper from "@ogw_front/components/Stepper"
9
5
  import ObjectSelector from "@ogw_front/components/ObjectSelector"
10
6
  import { mountSuspended } from "@nuxt/test-utils/runtime"
11
-
12
- const vuetify = createVuetify({
13
- components,
14
- directives,
15
- })
7
+ import { vuetify } from "../../utils"
16
8
 
17
9
  global.ResizeObserver = require("resize-observer-polyfill")
18
10
 
@@ -0,0 +1,66 @@
1
+ import { beforeEach, describe, expect, expectTypeOf, test, vi } from "vitest"
2
+ import { createTestingPinia } from "@pinia/testing"
3
+ import { setActivePinia } from "pinia"
4
+
5
+ import { useTreeviewStore } from "@ogw_front/stores/treeview"
6
+
7
+ beforeEach(async () => {
8
+ const pinia = createTestingPinia({
9
+ stubActions: false,
10
+ createSpy: vi.fn,
11
+ })
12
+ setActivePinia(pinia)
13
+ })
14
+
15
+ describe("Treeview Store", () => {
16
+ describe("state", () => {
17
+ test("initial state", () => {
18
+ const treeviewStore = useTreeviewStore()
19
+ expectTypeOf(treeviewStore.items).toBeArray()
20
+ })
21
+ })
22
+
23
+ describe("actions", () => {
24
+ describe("addItem", () => {
25
+ test("test items sorted", () => {
26
+ const treeviewStore = useTreeviewStore()
27
+
28
+ const testItems = [
29
+ {
30
+ geode_object_type: "BRep",
31
+ name: "test_brep.og_brep",
32
+ id: "1",
33
+ viewer_type: "model",
34
+ },
35
+ {
36
+ geode_object_type: "BRep",
37
+ name: "test_brep_2.og_brep",
38
+ id: "2",
39
+ viewer_type: "model",
40
+ },
41
+ {
42
+ geode_object_type: "EdgedCurve2D",
43
+ name: "test_edgedcurve.og_edc2d",
44
+ id: "2",
45
+ viewer_type: "mesh",
46
+ },
47
+ ]
48
+
49
+ for (let i = 0; i < testItems.length; i++) {
50
+ treeviewStore.addItem(
51
+ testItems[i].geode_object_type,
52
+ testItems[i].name,
53
+ testItems[i].id,
54
+ testItems[i].viewer_type,
55
+ )
56
+ expect(treeviewStore.items.sort()).toBe(treeviewStore.items)
57
+ for (let i = 0; i < treeviewStore.items.length; i++) {
58
+ expect(treeviewStore.items[i].children.sort()).toBe(
59
+ treeviewStore.items[i].children,
60
+ )
61
+ }
62
+ }
63
+ })
64
+ })
65
+ })
66
+ })
package/tests/utils.js ADDED
@@ -0,0 +1,6 @@
1
+ import { createVuetify } from "vuetify"
2
+ import * as components from "vuetify/components"
3
+ import * as directives from "vuetify/directives"
4
+ const vuetify = createVuetify({ components, directives })
5
+
6
+ export { vuetify }
@@ -1,59 +0,0 @@
1
- import { describe, expect, test } from "vitest"
2
- // import { mountSuspended } from "@nuxt/test-utils/runtime"
3
-
4
- // import { createVuetify } from "vuetify"
5
- // import * as components from "vuetify/components"
6
- // import * as directives from "vuetify/directives"
7
-
8
- // // import Wrapper from "@ogw_front/components/Wrapper"
9
- // import ObjectSelector from "@ogw_front/components/ObjectSelector"
10
-
11
- // const vuetify = createVuetify({
12
- // components,
13
- // directives,
14
- // })
15
-
16
- // global.ResizeObserver = require("resize-observer-polyfill")
17
-
18
- // describe("Step", async () => {
19
- // test(`Mount`, async () => {
20
- // const geode_object_type = ref("BRep")
21
- // const files = ref([])
22
- // const stepper_tree = reactive({
23
- // current_step_index: ref(0),
24
- // geode_object_type,
25
- // steps: [
26
- // {
27
- // step_title: "Confirm the data type",
28
- // component: {
29
- // component_name: shallowRef(ObjectSelector),
30
- // component_options: {
31
- // filenames: computed(() => {
32
- // return files.value.map((file) => file.name)
33
- // }),
34
- // key: "",
35
- // },
36
- // },
37
- // chips: computed(() => {
38
- // if (geode_object_type.value === "") {
39
- // return []
40
- // } else {
41
- // return [geode_object_type.value]
42
- // }
43
- // }),
44
- // },
45
- // ],
46
- // })
47
- // // const wrapper = await mountSuspended(Wrapper, {
48
- // // global: {
49
- // // plugins: [vuetify],
50
- // // provide: { stepper_tree },
51
- // // },
52
- // // props: { versions_schema: {} },
53
- // // })
54
- // // expect(wrapper.exists()).toBe(true)
55
- // })
56
- // })
57
- describe("Fake", async () => {
58
- test(`Fake`, async () => {})
59
- })