@geode/opengeodeweb-front 9.11.0-rc.9 → 9.11.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/.github/workflows/test.yml +0 -23
- package/components/FeedBack/ErrorBanner.vue +1 -1
- package/components/FeedBack/Snackers.vue +1 -1
- package/components/HybridRenderingView.vue +12 -38
- package/components/Launcher.vue +1 -1
- package/components/PackagesVersions.vue +1 -1
- package/components/Recaptcha.vue +1 -1
- package/components/RemoteRenderingView.vue +1 -1
- package/components/Viewer/BreadCrumb.vue +1 -1
- package/components/Viewer/Tree/ObjectTree.vue +1 -1
- package/components/Viewer/TreeObject.vue +1 -1
- package/components/Wrapper.vue +1 -1
- package/composables/api_fetch.js +2 -2
- package/composables/run_function_when_microservices_connected.js +1 -1
- package/composables/upload_file.js +2 -2
- package/composables/viewer_call.js +38 -38
- package/internal_stores/mesh/edges.js +52 -49
- package/internal_stores/mesh/index.js +14 -20
- package/internal_stores/mesh/points.js +7 -9
- package/internal_stores/mesh/polygons.js +7 -9
- package/internal_stores/mesh/polyhedra.js +6 -8
- package/internal_stores/model/blocks.js +1 -1
- package/internal_stores/model/corners.js +1 -1
- package/internal_stores/model/edges.js +8 -1
- package/internal_stores/model/index.js +1 -1
- package/internal_stores/model/lines.js +2 -2
- package/internal_stores/model/points.js +2 -2
- package/internal_stores/model/surfaces.js +1 -1
- package/package.json +6 -13
- package/stores/data_base.js +1 -9
- package/stores/data_style.js +6 -7
- package/stores/feedback.js +1 -1
- package/stores/geode.js +5 -5
- package/stores/hybrid_viewer.js +1 -1
- package/stores/infra.js +10 -10
- package/stores/treeview.js +1 -1
- package/stores/viewer.js +6 -5
- package/{tests/unit → test}/components/CrsSelector.nuxt.test.js +3 -6
- package/{tests/unit → test}/components/ExtensionSelector.nuxt.test.js +3 -6
- package/{tests/unit → test}/components/FeedBack/ErrorsBanner.nuxt.test.js +3 -10
- package/{tests/unit → test}/components/FeedBack/Snackers.nuxt.test.js +21 -24
- package/{tests/unit → test}/components/FileSelector.nuxt.test.js +2 -5
- package/{tests/unit → test}/components/FileUploader.nuxt.test.js +3 -6
- package/{tests/unit → test}/components/Inspector/InspectionButton.nuxt.test.js +3 -6
- package/{tests/unit → test}/components/Launcher.nuxt.test.js +2 -9
- package/{tests/unit → test}/components/MissingFilesSelector.nuxt.test.js +3 -6
- package/{tests/unit → test}/components/ObjectSelector.nuxt.test.js +3 -6
- package/{tests/unit → test}/components/PackagesVersions.nuxt.test.js +3 -5
- package/{tests/unit → test}/components/Stepper.nuxt.test.js +0 -1
- package/{tests/unit → test}/components/Wrapper.nuxt.test.js +1 -1
- package/{tests/unit → test}/composables/api_fetch.nuxt.test.js +2 -3
- package/{tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js → test/composables/run_function_when_microservices_connected.test.js} +5 -18
- package/{tests/unit → test}/composables/upload_file.nuxt.test.js +8 -7
- package/{tests/unit → test}/stores/Feedback.nuxt.test.js +8 -12
- package/{tests/unit → test}/stores/Geode.nuxt.test.js +10 -33
- package/{tests/unit → test}/stores/Infra.nuxt.test.js +25 -58
- package/{tests/unit → test}/stores/Viewer.nuxt.test.js +20 -101
- package/{tests/unit → test}/utils/validate_schema.nuxt.test.js +0 -3
- package/vitest.config.js +13 -0
- package/geode-opengeodeweb-back-5.10.0-rc.8.tgz +0 -0
- package/geode-opengeodeweb-viewer-1.11.0-rc.4.tgz +0 -0
- package/tests/integration/data/fake_id/edged_curve.vtp +0 -20
- package/tests/integration/microservices/back/requirements.in +0 -1
- package/tests/integration/microservices/back/requirements.txt +0 -75
- package/tests/integration/microservices/viewer/requirements.in +0 -1
- package/tests/integration/microservices/viewer/requirements.txt +0 -87
- package/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js +0 -138
- package/tests/vitest.config.js +0 -33
- package/utils/default_styles.js +0 -246
- package/utils/local.js +0 -180
- /package/{tests/unit → test}/components/Inspector/ResultPanel.nuxt.test.js +0 -0
- /package/{tests/unit → test}/components/Step.nuxt.test.js +0 -0
|
@@ -27,7 +27,7 @@ export function useMeshPolyhedraStyle() {
|
|
|
27
27
|
|
|
28
28
|
/** Actions **/
|
|
29
29
|
function setPolyhedraVisibility(id, visibility) {
|
|
30
|
-
|
|
30
|
+
viewer_call(
|
|
31
31
|
{
|
|
32
32
|
schema: mesh_polyhedra_schemas.visibility,
|
|
33
33
|
params: { id, visibility },
|
|
@@ -60,7 +60,7 @@ export function useMeshPolyhedraStyle() {
|
|
|
60
60
|
)
|
|
61
61
|
}
|
|
62
62
|
function setPolyhedraColor(id, color) {
|
|
63
|
-
|
|
63
|
+
viewer_call(
|
|
64
64
|
{
|
|
65
65
|
schema: mesh_polyhedra_schemas.color,
|
|
66
66
|
params: { id, color },
|
|
@@ -78,7 +78,7 @@ export function useMeshPolyhedraStyle() {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
function setPolyhedraVertexAttribute(id, vertex_attribute) {
|
|
81
|
-
|
|
81
|
+
viewer_call(
|
|
82
82
|
{
|
|
83
83
|
schema: mesh_polyhedra_schemas.vertex_attribute,
|
|
84
84
|
params: { id, ...vertex_attribute },
|
|
@@ -96,7 +96,7 @@ export function useMeshPolyhedraStyle() {
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
function setPolyhedraPolyhedronAttribute(id, polyhedron_attribute) {
|
|
99
|
-
|
|
99
|
+
viewer_call(
|
|
100
100
|
{
|
|
101
101
|
schema: mesh_polyhedra_schemas.polyhedron_attribute,
|
|
102
102
|
params: { id, ...polyhedron_attribute },
|
|
@@ -115,10 +115,8 @@ export function useMeshPolyhedraStyle() {
|
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
function applyPolyhedraStyle(id, style) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
setPolyhedraActiveColoring(id, style.coloring.active),
|
|
121
|
-
])
|
|
118
|
+
setPolyhedraVisibility(id, style.visibility)
|
|
119
|
+
setPolyhedraActiveColoring(id, style.coloring.active)
|
|
122
120
|
}
|
|
123
121
|
|
|
124
122
|
return {
|
|
@@ -15,7 +15,7 @@ export function useBlocksStyle() {
|
|
|
15
15
|
/** Actions **/
|
|
16
16
|
function setBlockVisibility(id, block_ids, visibility) {
|
|
17
17
|
const block_flat_indexes = dataBaseStore.getFlatIndexes(id, block_ids)
|
|
18
|
-
|
|
18
|
+
viewer_call(
|
|
19
19
|
{
|
|
20
20
|
schema: blocks_schemas.visibility,
|
|
21
21
|
params: { id, block_ids: block_flat_indexes, visibility },
|
|
@@ -14,7 +14,7 @@ export function useCornersStyle() {
|
|
|
14
14
|
/** Actions **/
|
|
15
15
|
function setCornerVisibility(id, corner_ids, visibility) {
|
|
16
16
|
const corner_flat_indexes = dataBaseStore.getFlatIndexes(id, corner_ids)
|
|
17
|
-
|
|
17
|
+
viewer_call(
|
|
18
18
|
{
|
|
19
19
|
schema: corners_schemas.visibility,
|
|
20
20
|
params: { id, block_ids: corner_flat_indexes, visibility },
|
|
@@ -9,7 +9,14 @@ export function useModelEdgesStyle() {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
function setModelEdgesVisibility(id, visibility) {
|
|
12
|
-
|
|
12
|
+
if (!dataStyleStore.styles[id]) {
|
|
13
|
+
dataStyleStore.styles[id] = {}
|
|
14
|
+
}
|
|
15
|
+
if (!dataStyleStore.styles[id].edges) {
|
|
16
|
+
dataStyleStore.styles[id].edges = {}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
viewer_call(
|
|
13
20
|
{
|
|
14
21
|
schema: model_edges_schemas.visibility,
|
|
15
22
|
params: { id, visibility },
|
|
@@ -18,7 +18,7 @@ export function useLinesStyle() {
|
|
|
18
18
|
/** Actions **/
|
|
19
19
|
function setLineVisibility(id, line_ids, visibility) {
|
|
20
20
|
const line_flat_indexes = dataBaseStore.getFlatIndexes(id, line_ids)
|
|
21
|
-
|
|
21
|
+
viewer_call(
|
|
22
22
|
{
|
|
23
23
|
schema: lines_schemas.visibility,
|
|
24
24
|
params: { id, block_ids: line_flat_indexes, visibility },
|
|
@@ -38,7 +38,7 @@ export function useLinesStyle() {
|
|
|
38
38
|
|
|
39
39
|
function setLineColor(id, line_ids, color) {
|
|
40
40
|
const line_flat_indexes = dataBaseStore.getFlatIndexes(id, line_ids)
|
|
41
|
-
|
|
41
|
+
viewer_call(
|
|
42
42
|
{
|
|
43
43
|
schema: lines_schemas.color,
|
|
44
44
|
params: { id, block_ids: line_flat_indexes, color },
|
|
@@ -12,7 +12,7 @@ export function useModelPointsStyle() {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
function setModelPointsVisibility(id, visibility) {
|
|
15
|
-
|
|
15
|
+
viewer_call(
|
|
16
16
|
{
|
|
17
17
|
schema: model_points_schemas.visibility,
|
|
18
18
|
params: { id, visibility },
|
|
@@ -27,7 +27,7 @@ export function useModelPointsStyle() {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
function setModelPointsSize(id, size) {
|
|
30
|
-
|
|
30
|
+
viewer_call(
|
|
31
31
|
{
|
|
32
32
|
schema: model_points_schemas.size,
|
|
33
33
|
params: { id, size },
|
|
@@ -14,7 +14,7 @@ export function useSurfacesStyle() {
|
|
|
14
14
|
/** Actions **/
|
|
15
15
|
function setSurfaceVisibility(id, surface_ids, visibility) {
|
|
16
16
|
const surface_flat_indexes = dataBaseStore.getFlatIndexes(id, surface_ids)
|
|
17
|
-
|
|
17
|
+
viewer_call(
|
|
18
18
|
{
|
|
19
19
|
schema: surfaces_schemas.visibility,
|
|
20
20
|
params: { id, block_ids: surface_flat_indexes, visibility },
|
package/package.json
CHANGED
|
@@ -2,19 +2,16 @@
|
|
|
2
2
|
"name": "@geode/opengeodeweb-front",
|
|
3
3
|
"scripts": {
|
|
4
4
|
"lint": "eslint --fix --ext .js,.vue --ignore-path .gitignore .",
|
|
5
|
-
"test": "
|
|
6
|
-
"
|
|
7
|
-
"test:unit": "npm run tests --project unit",
|
|
8
|
-
"test:integration": "npm run tests --project integration",
|
|
5
|
+
"test": "vitest",
|
|
6
|
+
"coverage": "vitest run --coverage",
|
|
9
7
|
"geode_objects": "node scripts/generate_geode_objects.js && prettier ./assets/geode_objects.js --write",
|
|
10
8
|
"build": ""
|
|
11
9
|
},
|
|
12
10
|
"devDependencies": {
|
|
13
|
-
"@nuxt/test-utils": "3.
|
|
11
|
+
"@nuxt/test-utils": "3.18.0",
|
|
14
12
|
"@pinia/testing": "0.1.7",
|
|
15
13
|
"@vitejs/plugin-vue": "5.2.3",
|
|
16
14
|
"@vue/test-utils": "2.4.6",
|
|
17
|
-
"electron": "36.4.0",
|
|
18
15
|
"eslint": "9.26.0",
|
|
19
16
|
"eslint-plugin-import": "2.31.0",
|
|
20
17
|
"eslint-plugin-nuxt": "4.0.0",
|
|
@@ -24,15 +21,13 @@
|
|
|
24
21
|
"eslint-plugin-vuetify": "2.5.2",
|
|
25
22
|
"happy-dom": "17.4.6",
|
|
26
23
|
"jsdom": "26.1.0",
|
|
27
|
-
"msw": "2.11.1",
|
|
28
24
|
"nuxt": "3.13.2",
|
|
29
25
|
"playwright-core": "1.52.0",
|
|
30
26
|
"prettier": "3.3.3",
|
|
31
27
|
"resize-observer-polyfill": "1.5.1",
|
|
32
|
-
"unplugin-auto-import": "^20.0.0",
|
|
33
28
|
"vite": "6.3.5",
|
|
34
29
|
"vite-plugin-vuetify": "2.1.1",
|
|
35
|
-
"vitest": "3.2
|
|
30
|
+
"vitest": "3.1.2",
|
|
36
31
|
"vitest-environment-nuxt": "1.0.1"
|
|
37
32
|
},
|
|
38
33
|
"overrides": {
|
|
@@ -40,7 +35,7 @@
|
|
|
40
35
|
},
|
|
41
36
|
"description": "OpenSource Vue/Vuetify framework for web applications",
|
|
42
37
|
"type": "module",
|
|
43
|
-
"version": "9.11.
|
|
38
|
+
"version": "9.11.2",
|
|
44
39
|
"main": "./nuxt.config.js",
|
|
45
40
|
"dependencies": {
|
|
46
41
|
"@geode/opengeodeweb-back": "latest",
|
|
@@ -52,12 +47,10 @@
|
|
|
52
47
|
"@vueuse/components": "13.1.0",
|
|
53
48
|
"@vueuse/nuxt": "13.1.0",
|
|
54
49
|
"ajv": "8.17.1",
|
|
55
|
-
"get-port-please": "3.2.0",
|
|
56
50
|
"is-electron": "2.2.2",
|
|
57
51
|
"js-file-download": "0.4.12",
|
|
58
52
|
"nuxt": "3.13.2",
|
|
59
|
-
"
|
|
60
|
-
"pinia": "3.0.3",
|
|
53
|
+
"pinia": "2.3.1",
|
|
61
54
|
"sass": "1.87.0",
|
|
62
55
|
"semver": "7.7.1",
|
|
63
56
|
"uuid": "11.1.0",
|
package/stores/data_base.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
|
|
2
|
-
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
|
|
3
2
|
|
|
4
3
|
export const useDataBaseStore = defineStore("dataBase", () => {
|
|
5
|
-
const treeview_store =
|
|
4
|
+
const treeview_store = use_treeview_store()
|
|
6
5
|
const hybridViewerStore = useHybridViewerStore()
|
|
7
6
|
|
|
8
7
|
/** State **/
|
|
@@ -42,12 +41,6 @@ export const useDataBaseStore = defineStore("dataBase", () => {
|
|
|
42
41
|
}
|
|
43
42
|
|
|
44
43
|
/** Actions **/
|
|
45
|
-
async function registerObject(id, file_name, viewer_object) {
|
|
46
|
-
return viewer_call({
|
|
47
|
-
schema: viewer_schemas.opengeodeweb_viewer.generic.register,
|
|
48
|
-
params: { id, file_name, viewer_object },
|
|
49
|
-
})
|
|
50
|
-
}
|
|
51
44
|
async function addItem(
|
|
52
45
|
id,
|
|
53
46
|
value = {
|
|
@@ -144,7 +137,6 @@ export const useDataBaseStore = defineStore("dataBase", () => {
|
|
|
144
137
|
itemMetaDatas,
|
|
145
138
|
meshComponentType,
|
|
146
139
|
formatedMeshComponents,
|
|
147
|
-
registerObject,
|
|
148
140
|
addItem,
|
|
149
141
|
fetchUuidToFlatIndexDict,
|
|
150
142
|
fetchMeshComponents,
|
package/stores/data_style.js
CHANGED
|
@@ -12,22 +12,21 @@ export const useDataStyleStore = defineStore("dataStyle", () => {
|
|
|
12
12
|
/** Actions **/
|
|
13
13
|
function addDataStyle(id, geode_object, object_type) {
|
|
14
14
|
dataStyleState.styles[id] = getDefaultStyle(geode_object)
|
|
15
|
+
|
|
15
16
|
if (object_type === "mesh") {
|
|
16
|
-
|
|
17
|
+
meshStyleStore.applyMeshDefaultStyle(id)
|
|
17
18
|
} else if (object_type === "model") {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
modelStyleStore.applyModelDefaultStyle(id),
|
|
21
|
-
])
|
|
19
|
+
modelStyleStore.setMeshComponentsDefaultStyle(id)
|
|
20
|
+
modelStyleStore.applyModelDefaultStyle(id)
|
|
22
21
|
}
|
|
23
22
|
}
|
|
24
23
|
|
|
25
24
|
function setVisibility(id, visibility) {
|
|
26
25
|
const object_type = dataBaseStore.itemMetaDatas(id).object_type
|
|
27
26
|
if (object_type === "mesh") {
|
|
28
|
-
|
|
27
|
+
meshStyleStore.setMeshVisibility(id, visibility)
|
|
29
28
|
} else if (object_type === "model") {
|
|
30
|
-
|
|
29
|
+
modelStyleStore.setModelVisibility(id, visibility)
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
32
|
|
package/stores/feedback.js
CHANGED
package/stores/geode.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
|
|
2
2
|
import Status from "@ogw_f/utils/status.js"
|
|
3
3
|
|
|
4
|
-
export const
|
|
4
|
+
export const use_geode_store = defineStore("geode", {
|
|
5
5
|
state: () => ({
|
|
6
6
|
default_local_port: "5000",
|
|
7
7
|
request_counter: 0,
|
|
@@ -9,13 +9,13 @@ export const useGeodeStore = defineStore("geode", {
|
|
|
9
9
|
}),
|
|
10
10
|
getters: {
|
|
11
11
|
protocol() {
|
|
12
|
-
if (
|
|
12
|
+
if (use_infra_store().app_mode == appMode.appMode.CLOUD) {
|
|
13
13
|
return "https"
|
|
14
14
|
}
|
|
15
15
|
return "http"
|
|
16
16
|
},
|
|
17
17
|
port() {
|
|
18
|
-
if (
|
|
18
|
+
if (use_infra_store().app_mode == appMode.appMode.CLOUD) {
|
|
19
19
|
return "443"
|
|
20
20
|
}
|
|
21
21
|
const GEODE_PORT = useRuntimeConfig().public.GEODE_PORT
|
|
@@ -25,7 +25,7 @@ export const useGeodeStore = defineStore("geode", {
|
|
|
25
25
|
return this.default_local_port
|
|
26
26
|
},
|
|
27
27
|
base_url() {
|
|
28
|
-
const infra_store =
|
|
28
|
+
const infra_store = use_infra_store()
|
|
29
29
|
let geode_url = `${this.protocol}://${infra_store.domain_name}:${this.port}`
|
|
30
30
|
if (infra_store.app_mode == appMode.appMode.CLOUD) {
|
|
31
31
|
if (infra_store.ID == "") {
|
|
@@ -49,7 +49,7 @@ export const useGeodeStore = defineStore("geode", {
|
|
|
49
49
|
},
|
|
50
50
|
do_ping() {
|
|
51
51
|
const geode_store = this
|
|
52
|
-
const feedback_store =
|
|
52
|
+
const feedback_store = use_feedback_store()
|
|
53
53
|
return useFetch(back_schemas.opengeodeweb_back.ping.$id, {
|
|
54
54
|
baseURL: this.base_url,
|
|
55
55
|
method: back_schemas.opengeodeweb_back.ping.methods[0],
|
package/stores/hybrid_viewer.js
CHANGED
|
@@ -8,7 +8,7 @@ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schem
|
|
|
8
8
|
import Status from "@ogw_f/utils/status.js"
|
|
9
9
|
|
|
10
10
|
export const useHybridViewerStore = defineStore("hybridViewer", () => {
|
|
11
|
-
const viewer_store =
|
|
11
|
+
const viewer_store = use_viewer_store()
|
|
12
12
|
const db = reactive({})
|
|
13
13
|
const status = ref(Status.NOT_CREATED)
|
|
14
14
|
const camera_options = reactive({})
|
package/stores/infra.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useStorage } from "@vueuse/core"
|
|
2
2
|
import Status from "@ogw_f/utils/status.js"
|
|
3
3
|
|
|
4
|
-
export const
|
|
4
|
+
export const use_infra_store = defineStore("infra", {
|
|
5
5
|
state: () => ({
|
|
6
6
|
app_mode: getAppMode(),
|
|
7
7
|
ID: useStorage("ID", ""),
|
|
@@ -16,7 +16,7 @@ export const useInfraStore = defineStore("infra", {
|
|
|
16
16
|
return "localhost"
|
|
17
17
|
},
|
|
18
18
|
lambda_url() {
|
|
19
|
-
const geode_store =
|
|
19
|
+
const geode_store = use_geode_store()
|
|
20
20
|
const public_runtime_config = useRuntimeConfig().public
|
|
21
21
|
const url =
|
|
22
22
|
geode_store.protocol +
|
|
@@ -31,12 +31,12 @@ export const useInfraStore = defineStore("infra", {
|
|
|
31
31
|
},
|
|
32
32
|
microservices_connected() {
|
|
33
33
|
return (
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
use_geode_store().status == Status.CONNECTED &&
|
|
35
|
+
use_viewer_store().status == Status.CONNECTED
|
|
36
36
|
)
|
|
37
37
|
},
|
|
38
38
|
microservices_busy() {
|
|
39
|
-
return
|
|
39
|
+
return use_geode_store().is_busy || use_viewer_store().is_busy
|
|
40
40
|
},
|
|
41
41
|
},
|
|
42
42
|
actions: {
|
|
@@ -48,8 +48,8 @@ export const useInfraStore = defineStore("infra", {
|
|
|
48
48
|
if (this.status === Status.CREATED) return
|
|
49
49
|
console.log("LOCK GRANTED !", lock)
|
|
50
50
|
if (this.app_mode == appMode.appMode.DESKTOP) {
|
|
51
|
-
const viewer_store =
|
|
52
|
-
const geode_store =
|
|
51
|
+
const viewer_store = use_viewer_store()
|
|
52
|
+
const geode_store = use_geode_store()
|
|
53
53
|
const back_port = await window.electronAPI.run_back(
|
|
54
54
|
geode_store.default_local_port,
|
|
55
55
|
)
|
|
@@ -64,7 +64,7 @@ export const useInfraStore = defineStore("infra", {
|
|
|
64
64
|
})
|
|
65
65
|
if (error.value || !data.value) {
|
|
66
66
|
this.status = Status.NOT_CREATED
|
|
67
|
-
const feedback_store =
|
|
67
|
+
const feedback_store = use_feedback_store()
|
|
68
68
|
feedback_store.server_error = true
|
|
69
69
|
return
|
|
70
70
|
}
|
|
@@ -77,8 +77,8 @@ export const useInfraStore = defineStore("infra", {
|
|
|
77
77
|
},
|
|
78
78
|
async create_connection() {
|
|
79
79
|
console.log("create_connection")
|
|
80
|
-
await
|
|
81
|
-
await
|
|
80
|
+
await use_viewer_store().ws_connect()
|
|
81
|
+
await use_geode_store().do_ping()
|
|
82
82
|
return
|
|
83
83
|
},
|
|
84
84
|
},
|
package/stores/treeview.js
CHANGED
package/stores/viewer.js
CHANGED
|
@@ -4,7 +4,7 @@ import "@kitware/vtk.js/Rendering/OpenGL/Profiles/Geometry"
|
|
|
4
4
|
import schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
|
|
5
5
|
import Status from "@ogw_f/utils/status.js"
|
|
6
6
|
|
|
7
|
-
export const
|
|
7
|
+
export const use_viewer_store = defineStore("viewer", {
|
|
8
8
|
state: () => ({
|
|
9
9
|
default_local_port: "1234",
|
|
10
10
|
client: {},
|
|
@@ -16,14 +16,14 @@ export const useViewerStore = defineStore("viewer", {
|
|
|
16
16
|
}),
|
|
17
17
|
getters: {
|
|
18
18
|
protocol() {
|
|
19
|
-
if (
|
|
19
|
+
if (use_infra_store().app_mode == appMode.appMode.CLOUD) {
|
|
20
20
|
return "wss"
|
|
21
21
|
} else {
|
|
22
22
|
return "ws"
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
port() {
|
|
26
|
-
if (
|
|
26
|
+
if (use_infra_store().app_mode == appMode.appMode.CLOUD) {
|
|
27
27
|
return "443"
|
|
28
28
|
}
|
|
29
29
|
const VIEWER_PORT = useRuntimeConfig().public.VIEWER_PORT
|
|
@@ -33,7 +33,7 @@ export const useViewerStore = defineStore("viewer", {
|
|
|
33
33
|
return this.default_local_port
|
|
34
34
|
},
|
|
35
35
|
base_url() {
|
|
36
|
-
const infra_store =
|
|
36
|
+
const infra_store = use_infra_store()
|
|
37
37
|
let viewer_url = `${this.protocol}://${infra_store.domain_name}:${this.port}`
|
|
38
38
|
if (infra_store.app_mode == appMode.appMode.CLOUD) {
|
|
39
39
|
if (infra_store.ID == "") {
|
|
@@ -60,6 +60,7 @@ export const useViewerStore = defineStore("viewer", {
|
|
|
60
60
|
this.picking_mode = false
|
|
61
61
|
},
|
|
62
62
|
async ws_connect() {
|
|
63
|
+
if (process.env.NODE_ENV == "test") return
|
|
63
64
|
if (this.status === Status.CONNECTED) return
|
|
64
65
|
return navigator.locks.request("viewer.ws_connect", async (lock) => {
|
|
65
66
|
if (this.status === Status.CONNECTED) return
|
|
@@ -124,7 +125,7 @@ export const useViewerStore = defineStore("viewer", {
|
|
|
124
125
|
resolve()
|
|
125
126
|
})
|
|
126
127
|
.catch((error) => {
|
|
127
|
-
console.error(
|
|
128
|
+
console.error(error)
|
|
128
129
|
viewer_store.status = Status.NOT_CONNECTED
|
|
129
130
|
reject(error)
|
|
130
131
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { describe, expect, test } from "vitest"
|
|
1
2
|
import { registerEndpoint, mountSuspended } from "@nuxt/test-utils/runtime"
|
|
2
3
|
|
|
3
|
-
import { describe, expect, test, vi } from "vitest"
|
|
4
4
|
import { setActivePinia } from "pinia"
|
|
5
5
|
import { createTestingPinia } from "@pinia/testing"
|
|
6
6
|
import { createVuetify } from "vuetify"
|
|
@@ -19,12 +19,9 @@ const vuetify = createVuetify({
|
|
|
19
19
|
})
|
|
20
20
|
|
|
21
21
|
describe("CrsSelector.vue", () => {
|
|
22
|
-
const pinia = createTestingPinia(
|
|
23
|
-
stubActions: false,
|
|
24
|
-
createSpy: vi.fn,
|
|
25
|
-
})
|
|
22
|
+
const pinia = createTestingPinia()
|
|
26
23
|
setActivePinia(pinia)
|
|
27
|
-
const geode_store =
|
|
24
|
+
const geode_store = use_geode_store()
|
|
28
25
|
geode_store.base_url = ""
|
|
29
26
|
|
|
30
27
|
test(`Default behavior`, async () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { describe, expect, test
|
|
1
|
+
import { describe, expect, test } from "vitest"
|
|
2
2
|
import { registerEndpoint, mountSuspended } from "@nuxt/test-utils/runtime"
|
|
3
3
|
|
|
4
4
|
import { createVuetify } from "vuetify"
|
|
@@ -19,12 +19,9 @@ const vuetify = createVuetify({
|
|
|
19
19
|
})
|
|
20
20
|
|
|
21
21
|
describe("ExtensionSelector.vue", async () => {
|
|
22
|
-
const pinia = createTestingPinia(
|
|
23
|
-
stubActions: false,
|
|
24
|
-
createSpy: vi.fn,
|
|
25
|
-
})
|
|
22
|
+
const pinia = createTestingPinia()
|
|
26
23
|
setActivePinia(pinia)
|
|
27
|
-
const geode_store =
|
|
24
|
+
const geode_store = use_geode_store()
|
|
28
25
|
geode_store.base_url = ""
|
|
29
26
|
|
|
30
27
|
test(`Select geode_object & extension`, async () => {
|
|
@@ -6,7 +6,6 @@ import * as directives from "vuetify/directives"
|
|
|
6
6
|
import { createTestingPinia } from "@pinia/testing"
|
|
7
7
|
|
|
8
8
|
import FeedBackErrorBanner from "@ogw_f/components/FeedBack/ErrorBanner.vue"
|
|
9
|
-
import { setActivePinia } from "pinia"
|
|
10
9
|
|
|
11
10
|
const vuetify = createVuetify({
|
|
12
11
|
components,
|
|
@@ -15,18 +14,13 @@ const vuetify = createVuetify({
|
|
|
15
14
|
|
|
16
15
|
describe("FeedBackErrorBanner.vue", async () => {
|
|
17
16
|
;(test(`Test reload`, async () => {
|
|
18
|
-
const pinia = createTestingPinia({
|
|
19
|
-
stubActions: false,
|
|
20
|
-
createSpy: vi.fn,
|
|
21
|
-
})
|
|
22
|
-
setActivePinia(pinia)
|
|
23
17
|
const wrapper = mount(FeedBackErrorBanner, {
|
|
24
18
|
global: {
|
|
25
|
-
plugins: [
|
|
19
|
+
plugins: [createTestingPinia(), vuetify],
|
|
26
20
|
},
|
|
27
21
|
})
|
|
28
22
|
const reload_spy = vi.spyOn(wrapper.vm, "reload")
|
|
29
|
-
const feedback_store =
|
|
23
|
+
const feedback_store = use_feedback_store()
|
|
30
24
|
await feedback_store.$patch({ server_error: true })
|
|
31
25
|
expect(feedback_store.server_error).toBe(true)
|
|
32
26
|
const v_btn = wrapper.findAll(".v-btn")
|
|
@@ -44,14 +38,13 @@ describe("FeedBackErrorBanner.vue", async () => {
|
|
|
44
38
|
},
|
|
45
39
|
},
|
|
46
40
|
stubActions: false,
|
|
47
|
-
createSpy: vi.fn,
|
|
48
41
|
}),
|
|
49
42
|
vuetify,
|
|
50
43
|
],
|
|
51
44
|
},
|
|
52
45
|
})
|
|
53
46
|
|
|
54
|
-
const feedback_store =
|
|
47
|
+
const feedback_store = use_feedback_store()
|
|
55
48
|
const v_btn = wrapper.findAll(".v-btn")
|
|
56
49
|
await v_btn[1].trigger("click")
|
|
57
50
|
expect(feedback_store.server_error).toBe(false)
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
// @vitest-environment nuxt
|
|
2
2
|
vi.stubGlobal("visualViewport", new EventTarget())
|
|
3
|
-
import { describe, expect, test
|
|
3
|
+
import { describe, expect, test } from "vitest"
|
|
4
4
|
import { mount } from "@vue/test-utils"
|
|
5
5
|
import { createVuetify } from "vuetify"
|
|
6
6
|
import * as components from "vuetify/components"
|
|
7
7
|
import * as directives from "vuetify/directives"
|
|
8
|
-
|
|
9
|
-
import { setActivePinia } from "pinia"
|
|
10
8
|
import { createTestingPinia } from "@pinia/testing"
|
|
11
9
|
|
|
12
10
|
import FeedBackSnackers from "@ogw_f/components/FeedBack/Snackers.vue"
|
|
@@ -18,25 +16,6 @@ const vuetify = createVuetify({
|
|
|
18
16
|
|
|
19
17
|
describe("FeedBackSnackers.vue", async () => {
|
|
20
18
|
test(`Test delete error`, async () => {
|
|
21
|
-
const pinia = createTestingPinia({
|
|
22
|
-
initialState: {
|
|
23
|
-
feedback: {
|
|
24
|
-
feedbacks: [
|
|
25
|
-
{
|
|
26
|
-
type: "error",
|
|
27
|
-
code: 500,
|
|
28
|
-
route: "/test",
|
|
29
|
-
name: "test message",
|
|
30
|
-
description: "test description",
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
stubActions: false,
|
|
36
|
-
createSpy: vi.fn,
|
|
37
|
-
})
|
|
38
|
-
setActivePinia(pinia)
|
|
39
|
-
const feedback_store = useFeedbackStore()
|
|
40
19
|
const wrapper = mount(
|
|
41
20
|
{
|
|
42
21
|
template: "<v-layout><FeedBackSnackers/></v-layout>",
|
|
@@ -47,11 +26,29 @@ describe("FeedBackSnackers.vue", async () => {
|
|
|
47
26
|
components: {
|
|
48
27
|
FeedBackSnackers,
|
|
49
28
|
},
|
|
50
|
-
plugins: [
|
|
29
|
+
plugins: [
|
|
30
|
+
createTestingPinia({
|
|
31
|
+
initialState: {
|
|
32
|
+
feedback: {
|
|
33
|
+
feedbacks: [
|
|
34
|
+
{
|
|
35
|
+
type: "error",
|
|
36
|
+
code: 500,
|
|
37
|
+
route: "/test",
|
|
38
|
+
name: "test message",
|
|
39
|
+
description: "test description",
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
stubActions: false,
|
|
45
|
+
}),
|
|
46
|
+
vuetify,
|
|
47
|
+
],
|
|
51
48
|
},
|
|
52
49
|
},
|
|
53
50
|
)
|
|
54
|
-
|
|
51
|
+
const feedback_store = use_feedback_store()
|
|
55
52
|
expect(feedback_store.feedbacks.length).toBe(1)
|
|
56
53
|
const v_btn = await wrapper.findComponent(components.VBtn)
|
|
57
54
|
await v_btn.trigger("click")
|
|
@@ -23,12 +23,9 @@ const vuetify = createVuetify({
|
|
|
23
23
|
})
|
|
24
24
|
|
|
25
25
|
describe("FileSelector.vue", async () => {
|
|
26
|
-
const pinia = createTestingPinia(
|
|
27
|
-
stubActions: false,
|
|
28
|
-
createSpy: vi.fn,
|
|
29
|
-
})
|
|
26
|
+
const pinia = createTestingPinia()
|
|
30
27
|
setActivePinia(pinia)
|
|
31
|
-
const geode_store =
|
|
28
|
+
const geode_store = use_geode_store()
|
|
32
29
|
geode_store.base_url = ""
|
|
33
30
|
|
|
34
31
|
test(`Select file`, async () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { describe, expect, test
|
|
1
|
+
import { describe, expect, test } from "vitest"
|
|
2
2
|
import { registerEndpoint, mountSuspended } from "@nuxt/test-utils/runtime"
|
|
3
3
|
import { flushPromises } from "@vue/test-utils"
|
|
4
4
|
|
|
@@ -20,12 +20,9 @@ const vuetify = createVuetify({
|
|
|
20
20
|
})
|
|
21
21
|
|
|
22
22
|
describe("FileUploader.vue", async () => {
|
|
23
|
-
const pinia = createTestingPinia(
|
|
24
|
-
stubActions: false,
|
|
25
|
-
createSpy: vi.fn,
|
|
26
|
-
})
|
|
23
|
+
const pinia = createTestingPinia()
|
|
27
24
|
setActivePinia(pinia)
|
|
28
|
-
const geode_store =
|
|
25
|
+
const geode_store = use_geode_store()
|
|
29
26
|
geode_store.base_url = ""
|
|
30
27
|
|
|
31
28
|
registerEndpoint(upload_file_schema.$id, {
|