@geode/opengeodeweb-front 10.14.0-rc.2 → 10.14.0-rc.4
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/components/Viewer/ObjectTree/Views/GlobalObjects.vue +1 -0
- package/app/components/Viewer/ObjectTree/Views/ModelComponents.vue +3 -2
- package/app/stores/data.js +3 -5
- package/app/utils/local/microservices.js +1 -1
- package/internal/stores/data_style/model/index.js +1 -0
- package/internal/stores/data_style/model/selection.js +17 -36
- package/internal/utils/api_fetch.js +37 -25
- package/internal/utils/viewer_call.js +3 -3
- package/nuxt.config.js +0 -7
- package/package.json +2 -2
|
@@ -23,8 +23,8 @@ const opened = computed({
|
|
|
23
23
|
set: (val) => treeviewStore.setOpened(viewId, val),
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
-
const items = dataStore.refFormatedMeshComponents(
|
|
27
|
-
const mesh_components_selection = dataStyleStore.visibleMeshComponents(
|
|
26
|
+
const items = dataStore.refFormatedMeshComponents(viewId);
|
|
27
|
+
const mesh_components_selection = dataStyleStore.visibleMeshComponents(viewId);
|
|
28
28
|
|
|
29
29
|
const {
|
|
30
30
|
search,
|
|
@@ -88,6 +88,7 @@ function showContextMenu(event, item) {
|
|
|
88
88
|
item-value="id"
|
|
89
89
|
select-strategy="independent"
|
|
90
90
|
selectable
|
|
91
|
+
items-registration="props"
|
|
91
92
|
@update:selected="onSelectionChange"
|
|
92
93
|
>
|
|
93
94
|
<template #title="{ item }">
|
package/app/stores/data.js
CHANGED
|
@@ -9,6 +9,7 @@ import { useViewerStore } from "@ogw_front/stores/viewer";
|
|
|
9
9
|
|
|
10
10
|
const viewer_generic_schemas = viewer_schemas.opengeodeweb_viewer.generic;
|
|
11
11
|
|
|
12
|
+
// oxlint-disable-next-line max-lines-per-function, max-statements
|
|
12
13
|
export const useDataStore = defineStore("data", () => {
|
|
13
14
|
const viewerStore = useViewerStore();
|
|
14
15
|
|
|
@@ -67,12 +68,9 @@ export const useDataStore = defineStore("data", () => {
|
|
|
67
68
|
}));
|
|
68
69
|
}
|
|
69
70
|
|
|
70
|
-
function refFormatedMeshComponents(
|
|
71
|
+
function refFormatedMeshComponents(modelId) {
|
|
71
72
|
return useObservable(
|
|
72
|
-
liveQuery(() =>
|
|
73
|
-
const unwrapped_id = unref(id);
|
|
74
|
-
return formatedMeshComponents(unwrapped_id);
|
|
75
|
-
}),
|
|
73
|
+
liveQuery(() => formatedMeshComponents(modelId)),
|
|
76
74
|
{ initialValue: undefined },
|
|
77
75
|
);
|
|
78
76
|
}
|
|
@@ -13,7 +13,7 @@ import { commandExistsSync, waitForReady } from "./scripts.js";
|
|
|
13
13
|
import { executableName, executablePath } from "./path.js";
|
|
14
14
|
import { microservicesMetadatasPath, projectMicroservices } from "./cleanup.js";
|
|
15
15
|
|
|
16
|
-
const DEFAULT_TIMEOUT_SECONDS =
|
|
16
|
+
const DEFAULT_TIMEOUT_SECONDS = 60;
|
|
17
17
|
const MILLISECONDS_PER_SECOND = 1000;
|
|
18
18
|
|
|
19
19
|
function getAvailablePort() {
|
|
@@ -10,6 +10,7 @@ import { useModelSelection } from "./selection";
|
|
|
10
10
|
import { useModelSurfacesStyle } from "./surfaces";
|
|
11
11
|
import { useModelVisibilityStyle } from "./visibility";
|
|
12
12
|
|
|
13
|
+
// oxlint-disable-next-line max-lines-per-function, max-statements
|
|
13
14
|
function useModelStyle() {
|
|
14
15
|
const dataStore = useDataStore();
|
|
15
16
|
const dataStyleState = useDataStyleState();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { MESH_TYPES } from "@ogw_front/utils/default_styles";
|
|
2
2
|
import { database } from "@ogw_internal/database/database";
|
|
3
3
|
import { liveQuery } from "dexie";
|
|
4
|
+
import { useObservable } from "@vueuse/rxjs";
|
|
4
5
|
|
|
5
6
|
function buildSelection(modelId, components, stylesMap, typeStylesMap, dataStyleState) {
|
|
6
7
|
const componentsByType = Object.fromEntries(
|
|
@@ -40,44 +41,24 @@ function buildSelection(modelId, components, stylesMap, typeStylesMap, dataStyle
|
|
|
40
41
|
return selection;
|
|
41
42
|
}
|
|
42
43
|
|
|
43
|
-
function useModelSelection(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
function useModelSelection(modelId, dataStyleState) {
|
|
45
|
+
return useObservable(
|
|
46
|
+
liveQuery(async () => {
|
|
47
|
+
const [allComponents, componentStyles, typeStyles] = await Promise.all([
|
|
48
|
+
database.model_components.where("id").equals(modelId).toArray(),
|
|
49
|
+
database.model_component_datastyle.where("id_model").equals(modelId).toArray(),
|
|
50
|
+
database.model_component_type_datastyle.where("id_model").equals(modelId).toArray(),
|
|
51
|
+
]);
|
|
52
|
+
if (allComponents.length === 0) {
|
|
53
|
+
return [];
|
|
51
54
|
}
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
if (allComponents.length === 0) {
|
|
60
|
-
return [];
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const stylesMap = Object.fromEntries(
|
|
64
|
-
componentStyles.map((style) => [style.id_component, style]),
|
|
65
|
-
);
|
|
66
|
-
const typeStylesMap = Object.fromEntries(typeStyles.map((style) => [style.type, style]));
|
|
67
|
-
|
|
68
|
-
return buildSelection(modelId, allComponents, stylesMap, typeStylesMap, dataStyleState);
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
const subscription = observable.subscribe({
|
|
72
|
-
next: (val) => {
|
|
73
|
-
selection.value = val;
|
|
74
|
-
},
|
|
75
|
-
});
|
|
76
|
-
onCleanup(() => subscription.unsubscribe());
|
|
77
|
-
},
|
|
78
|
-
{ immediate: true },
|
|
55
|
+
const stylesMap = Object.fromEntries(
|
|
56
|
+
componentStyles.map((style) => [style.id_component, style]),
|
|
57
|
+
);
|
|
58
|
+
const typeStylesMap = Object.fromEntries(typeStyles.map((style) => [style.type, style]));
|
|
59
|
+
return buildSelection(modelId, allComponents, stylesMap, typeStylesMap, dataStyleState);
|
|
60
|
+
}),
|
|
79
61
|
);
|
|
80
|
-
return selection;
|
|
81
62
|
}
|
|
82
63
|
|
|
83
64
|
export { buildSelection, useModelSelection };
|
|
@@ -7,7 +7,7 @@ const ERROR_400 = 400;
|
|
|
7
7
|
export function api_fetch(
|
|
8
8
|
microservice,
|
|
9
9
|
{ schema, params },
|
|
10
|
-
{ request_error_function, response_function, response_error_function } = {},
|
|
10
|
+
{ request_error_function, response_function, response_error_function, timeout } = {},
|
|
11
11
|
) {
|
|
12
12
|
const feedbackStore = useFeedbackStore();
|
|
13
13
|
|
|
@@ -36,30 +36,42 @@ export function api_fetch(
|
|
|
36
36
|
if (schema.max_retry) {
|
|
37
37
|
request_options.max_retry = schema.max_retry;
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
39
|
+
|
|
40
|
+
function performFetch() {
|
|
41
|
+
return $fetch(schema.$id, {
|
|
42
|
+
baseURL: microservice.base_url,
|
|
43
|
+
...request_options,
|
|
44
|
+
onRequestError({ error }) {
|
|
45
|
+
microservice.stop_request();
|
|
46
|
+
feedbackStore.add_error(error.code, schema.$id, error.message, error.stack);
|
|
47
|
+
if (request_error_function) {
|
|
48
|
+
request_error_function(error);
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
onResponse({ response }) {
|
|
52
|
+
if (response.ok) {
|
|
53
|
+
microservice.stop_request();
|
|
54
|
+
if (response_function) {
|
|
55
|
+
response_function(response._data);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
onResponseError({ response }) {
|
|
51
60
|
microservice.stop_request();
|
|
52
|
-
|
|
53
|
-
|
|
61
|
+
feedbackStore.add_error(response.status, schema.$id, response.name, response.description);
|
|
62
|
+
if (response_error_function) {
|
|
63
|
+
response_error_function(response);
|
|
54
64
|
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (timeout !== undefined && timeout > 0) {
|
|
70
|
+
return pTimeout(performCall(), {
|
|
71
|
+
milliseconds: timeout,
|
|
72
|
+
message: `${schema.$id}: Timed out after ${timeout}ms`,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return performFetch();
|
|
65
77
|
}
|
|
@@ -4,7 +4,7 @@ import { validate_schema } from "@ogw_front/utils/validate_schema";
|
|
|
4
4
|
|
|
5
5
|
const ERROR_400 = 400;
|
|
6
6
|
|
|
7
|
-
export
|
|
7
|
+
export function viewer_call(
|
|
8
8
|
microservice,
|
|
9
9
|
{ schema, params = {} },
|
|
10
10
|
{ request_error_function, response_function, response_error_function, timeout } = {},
|
|
@@ -50,11 +50,11 @@ export async function viewer_call(
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
if (timeout !== undefined && timeout > 0) {
|
|
53
|
-
return
|
|
53
|
+
return pTimeout(performCall(), {
|
|
54
54
|
milliseconds: timeout,
|
|
55
55
|
message: `${schema.$id}: Timed out after ${timeout}ms`,
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
return
|
|
59
|
+
return performCall();
|
|
60
60
|
}
|
package/nuxt.config.js
CHANGED
|
@@ -5,7 +5,6 @@ import path from "node:path";
|
|
|
5
5
|
import package_json from "./package.json";
|
|
6
6
|
|
|
7
7
|
const __dirname = import.meta.dirname;
|
|
8
|
-
const oneMinute = 60_000;
|
|
9
8
|
|
|
10
9
|
export default defineNuxtConfig({
|
|
11
10
|
runtimeConfig: {
|
|
@@ -38,12 +37,6 @@ export default defineNuxtConfig({
|
|
|
38
37
|
transpile: ["vuetify"],
|
|
39
38
|
},
|
|
40
39
|
|
|
41
|
-
nitro: {
|
|
42
|
-
routeRules: {
|
|
43
|
-
"/api/**": { timeout: oneMinute },
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
|
|
47
40
|
vuetify: {
|
|
48
41
|
vuetifyOptions: {
|
|
49
42
|
defaults: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geode/opengeodeweb-front",
|
|
3
|
-
"version": "10.14.0-rc.
|
|
3
|
+
"version": "10.14.0-rc.4",
|
|
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": {
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"sass": "1.87.0",
|
|
64
64
|
"semver": "7.7.1",
|
|
65
65
|
"uuid": "11.1.0",
|
|
66
|
-
"vuetify": "3.
|
|
66
|
+
"vuetify": "3.12.5",
|
|
67
67
|
"vuetify-nuxt-module": "0.18.7",
|
|
68
68
|
"ws": "8.18.3",
|
|
69
69
|
"wslink": "1.12.4"
|