@geode/opengeodeweb-front 10.21.0-rc.1 → 10.21.0-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/components/CrsSelector.vue +3 -3
- package/app/components/ExtensionSelector.vue +3 -3
- package/app/components/FileSelector.vue +3 -3
- package/app/components/FileUploader.vue +4 -4
- package/app/components/Inspector/InspectionButton.vue +3 -3
- package/app/components/Loading.vue +27 -0
- package/app/components/MissingFilesSelector.vue +3 -3
- package/app/components/ObjectSelector.vue +3 -3
- package/app/components/PackagesVersions.vue +4 -4
- package/app/components/Viewer/Options/AttributeSelector.vue +3 -3
- package/app/components/Viewer/Options/TextureItem.vue +4 -4
- package/app/composables/project_manager.js +5 -5
- package/app/stores/{geode.js → back.js} +16 -1
- package/app/stores/viewer.js +18 -0
- package/app/utils/extension.js +0 -2
- package/app/utils/import_workflow.js +3 -3
- package/package.json +1 -1
- package/tests/integration/setup.js +3 -3
- package/tests/unit/components/CrsSelector.nuxt.test.js +6 -6
- package/tests/unit/components/ExtensionSelector.nuxt.test.js +4 -4
- package/tests/unit/components/FileSelector.nuxt.test.js +3 -3
- package/tests/unit/components/FileUploader.nuxt.test.js +3 -3
- package/tests/unit/components/Inspector/InspectionButton.nuxt.test.js +4 -4
- package/tests/unit/components/MissingFilesSelector.nuxt.test.js +4 -4
- package/tests/unit/components/ObjectSelector.nuxt.test.js +3 -3
- package/tests/unit/components/PackagesVersions.nuxt.test.js +3 -3
- package/tests/unit/composables/api_fetch.nuxt.test.js +9 -9
- package/tests/unit/composables/project_manager.nuxt.test.js +3 -3
- package/tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js +7 -7
- package/tests/unit/composables/upload_file.nuxt.test.js +7 -7
- package/tests/unit/stores/app.nuxt.test.js +9 -9
- package/tests/unit/stores/{geode.nuxt.test.js → back.nuxt.test.js} +43 -43
- package/tests/unit/stores/infra.nuxt.test.js +34 -34
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json";
|
|
3
|
-
import {
|
|
3
|
+
import { useBackStore } from "@ogw_front/stores/back";
|
|
4
4
|
|
|
5
5
|
const schema = schemas.opengeodeweb_back.geographic_coordinate_systems;
|
|
6
6
|
|
|
@@ -16,7 +16,7 @@ const data_table_loading = ref(false);
|
|
|
16
16
|
const crs_list = ref([]);
|
|
17
17
|
const selected_crs = ref([]);
|
|
18
18
|
const toggle_loading = useToggle(data_table_loading);
|
|
19
|
-
const
|
|
19
|
+
const backStore = useBackStore();
|
|
20
20
|
|
|
21
21
|
watch(selected_crs, (new_value) => {
|
|
22
22
|
const crs = get_selected_crs(new_value[0]);
|
|
@@ -38,7 +38,7 @@ function get_selected_crs(crs_code) {
|
|
|
38
38
|
async function get_crs_table() {
|
|
39
39
|
const params = { geode_object_type };
|
|
40
40
|
toggle_loading();
|
|
41
|
-
await
|
|
41
|
+
await backStore.request(schema, params, {
|
|
42
42
|
response_function: (response) => {
|
|
43
43
|
crs_list.value = response.crs_list;
|
|
44
44
|
},
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json";
|
|
3
3
|
|
|
4
4
|
import FetchingData from "@ogw_front/components/FetchingData";
|
|
5
|
-
import {
|
|
5
|
+
import { useBackStore } from "@ogw_front/stores/back";
|
|
6
6
|
|
|
7
7
|
const schema = schemas.opengeodeweb_back.geode_objects_and_output_extensions;
|
|
8
8
|
const emit = defineEmits(["update_values", "increment_step", "decrement_step"]);
|
|
@@ -19,10 +19,10 @@ const toggle_loading = useToggle(loading);
|
|
|
19
19
|
async function get_output_file_extensions() {
|
|
20
20
|
toggle_loading();
|
|
21
21
|
geode_objects_and_output_extensions.value = {};
|
|
22
|
-
const
|
|
22
|
+
const backStore = useBackStore();
|
|
23
23
|
const values = await Promise.all(
|
|
24
24
|
filenames.map(async (filename) => {
|
|
25
|
-
const response = await
|
|
25
|
+
const response = await backStore.request(schema, {
|
|
26
26
|
geode_object_type,
|
|
27
27
|
filename,
|
|
28
28
|
});
|
|
@@ -3,7 +3,7 @@ import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json";
|
|
|
3
3
|
|
|
4
4
|
import FetchingData from "@ogw_front/components/FetchingData";
|
|
5
5
|
import FileUploader from "@ogw_front/components/FileUploader";
|
|
6
|
-
import {
|
|
6
|
+
import { useBackStore } from "@ogw_front/stores/back";
|
|
7
7
|
|
|
8
8
|
const schema = schemas.opengeodeweb_back.allowed_files;
|
|
9
9
|
|
|
@@ -46,8 +46,8 @@ function files_uploaded_event(value) {
|
|
|
46
46
|
|
|
47
47
|
async function get_allowed_files() {
|
|
48
48
|
toggle_loading();
|
|
49
|
-
const
|
|
50
|
-
const response = await
|
|
49
|
+
const backStore = useBackStore();
|
|
50
|
+
const response = await backStore.request(schema, {});
|
|
51
51
|
accept.value = response.extensions.map((extension) => `.${extension}`).join(",");
|
|
52
52
|
toggle_loading();
|
|
53
53
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import {
|
|
2
|
+
import { useBackStore } from "@ogw_front/stores/back";
|
|
3
3
|
|
|
4
4
|
import CsvPreviewer from "@ogw_front/components/csv-preview/CsvPreviewer";
|
|
5
5
|
import DragAndDrop from "@ogw_front/components/DragAndDrop";
|
|
@@ -15,7 +15,7 @@ const { multiple, accept, files, auto_upload, showOverlay, mini } = defineProps(
|
|
|
15
15
|
mini: { type: Boolean, default: false },
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
-
const
|
|
18
|
+
const backStore = useBackStore();
|
|
19
19
|
const internal_files = ref(files);
|
|
20
20
|
const dragAndDropRef = useTemplateRef("dragAndDropRef");
|
|
21
21
|
const csv_dialog = ref(false);
|
|
@@ -49,7 +49,7 @@ async function onCsvConfirm(result) {
|
|
|
49
49
|
});
|
|
50
50
|
|
|
51
51
|
current_csv_file.value.isConfigured = true;
|
|
52
|
-
await
|
|
52
|
+
await backStore.upload(json_file);
|
|
53
53
|
internal_files.value = [...internal_files.value];
|
|
54
54
|
csv_dialog.value = false;
|
|
55
55
|
}
|
|
@@ -72,7 +72,7 @@ function removeFile(index) {
|
|
|
72
72
|
|
|
73
73
|
async function upload_files() {
|
|
74
74
|
toggle_loading();
|
|
75
|
-
const promise_array = internal_files.value.map((file) =>
|
|
75
|
+
const promise_array = internal_files.value.map((file) => backStore.upload(file));
|
|
76
76
|
await Promise.all(promise_array);
|
|
77
77
|
files_uploaded.value = true;
|
|
78
78
|
toggle_loading();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json";
|
|
3
|
-
import {
|
|
3
|
+
import { useBackStore } from "@ogw_front/stores/back";
|
|
4
4
|
|
|
5
5
|
const schema = schemas.opengeodeweb_back.inspect_file;
|
|
6
6
|
|
|
@@ -18,9 +18,9 @@ async function get_inspection_results() {
|
|
|
18
18
|
geode_object_type,
|
|
19
19
|
filename,
|
|
20
20
|
};
|
|
21
|
-
const
|
|
21
|
+
const backStore = useBackStore();
|
|
22
22
|
|
|
23
|
-
await
|
|
23
|
+
await backStore.request(schema, params, {
|
|
24
24
|
response_function: (response) => {
|
|
25
25
|
emit("update_values", {
|
|
26
26
|
inspection_result: [response.inspection_result],
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { Status } from "@ogw_front/utils/status";
|
|
3
|
+
import { useInfraStore } from "@ogw_front/stores/infra";
|
|
4
|
+
|
|
2
5
|
const { logo, appName } = defineProps({
|
|
3
6
|
logo: {
|
|
4
7
|
type: String,
|
|
@@ -10,6 +13,12 @@ const { logo, appName } = defineProps({
|
|
|
10
13
|
},
|
|
11
14
|
});
|
|
12
15
|
|
|
16
|
+
const infraStore = useInfraStore();
|
|
17
|
+
|
|
18
|
+
const extensionStores = computed(() =>
|
|
19
|
+
infraStore.microservices.filter((store) => store.$id !== "back" && store.$id !== "viewer"),
|
|
20
|
+
);
|
|
21
|
+
|
|
13
22
|
const show = ref(false);
|
|
14
23
|
const progress = ref(0);
|
|
15
24
|
|
|
@@ -76,6 +85,24 @@ onUnmounted(() => {
|
|
|
76
85
|
<LoadingHeader :logo="logo" />
|
|
77
86
|
<LoadingEcoMessages :app-name="appName" />
|
|
78
87
|
<LoadingProgress :progress="progress" />
|
|
88
|
+
|
|
89
|
+
<div class="d-flex flex-wrap justify-center gap-4 w-100 mt-4">
|
|
90
|
+
<v-chip
|
|
91
|
+
v-for="store in extensionStores"
|
|
92
|
+
:key="store.$id"
|
|
93
|
+
:color="store.status === Status.CONNECTED ? 'success' : 'primary'"
|
|
94
|
+
variant="flat"
|
|
95
|
+
>
|
|
96
|
+
<v-icon
|
|
97
|
+
start
|
|
98
|
+
:icon="
|
|
99
|
+
store.status === Status.CONNECTED ? 'mdi-check-circle' : 'mdi-loading mdi-spin'
|
|
100
|
+
"
|
|
101
|
+
/>
|
|
102
|
+
{{ store.$id.charAt(0).toUpperCase() + store.$id.slice(1) }}
|
|
103
|
+
</v-chip>
|
|
104
|
+
</div>
|
|
105
|
+
|
|
79
106
|
<LoadingFooter />
|
|
80
107
|
</div>
|
|
81
108
|
</div>
|
|
@@ -3,7 +3,7 @@ import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json";
|
|
|
3
3
|
|
|
4
4
|
import FetchingData from "@ogw_front/components/FetchingData";
|
|
5
5
|
import FileUploader from "@ogw_front/components/FileUploader";
|
|
6
|
-
import {
|
|
6
|
+
import { useBackStore } from "@ogw_front/stores/back";
|
|
7
7
|
|
|
8
8
|
const schema = schemas.opengeodeweb_back.missing_files;
|
|
9
9
|
|
|
@@ -33,7 +33,7 @@ async function missing_files() {
|
|
|
33
33
|
has_missing_files.value = false;
|
|
34
34
|
mandatory_files.value = [];
|
|
35
35
|
additional_files.value = [];
|
|
36
|
-
const
|
|
36
|
+
const backStore = useBackStore();
|
|
37
37
|
|
|
38
38
|
const promise_array = filenames.map((filename) => {
|
|
39
39
|
const isCsvFile =
|
|
@@ -45,7 +45,7 @@ async function missing_files() {
|
|
|
45
45
|
additional_files: [],
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
-
return
|
|
48
|
+
return backStore.request(schema, { geode_object_type, filename });
|
|
49
49
|
});
|
|
50
50
|
const values = await Promise.all(promise_array);
|
|
51
51
|
for (const value of values) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import FetchingData from "@ogw_front/components/FetchingData.vue";
|
|
3
3
|
import { geode_objects } from "@ogw_front/assets/geode_objects";
|
|
4
4
|
import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json";
|
|
5
|
-
import {
|
|
5
|
+
import { useBackStore } from "@ogw_front/stores/back";
|
|
6
6
|
|
|
7
7
|
const schema = schemas.opengeodeweb_back.allowed_objects;
|
|
8
8
|
|
|
@@ -12,7 +12,7 @@ const { filenames } = defineProps({
|
|
|
12
12
|
filenames: { type: Array, required: true },
|
|
13
13
|
});
|
|
14
14
|
|
|
15
|
-
const
|
|
15
|
+
const backStore = useBackStore();
|
|
16
16
|
|
|
17
17
|
const loading = ref(false);
|
|
18
18
|
const allowed_objects = ref({});
|
|
@@ -52,7 +52,7 @@ async function get_allowed_objects() {
|
|
|
52
52
|
toggle_loading();
|
|
53
53
|
allowed_objects.value = {};
|
|
54
54
|
|
|
55
|
-
const promise_array = filenames.map((filename) =>
|
|
55
|
+
const promise_array = filenames.map((filename) => backStore.request(schema, { filename }));
|
|
56
56
|
const responses = await Promise.all(promise_array);
|
|
57
57
|
const allowed_objects_list = responses.map((response) => response.allowed_objects);
|
|
58
58
|
const all_keys = [...new Set(allowed_objects_list.flatMap((obj) => Object.keys(obj)))];
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { Status } from "@ogw_front/utils/status";
|
|
3
|
-
import {
|
|
3
|
+
import { useBackStore } from "@ogw_front/stores/back";
|
|
4
4
|
|
|
5
5
|
const { schema } = defineProps({
|
|
6
6
|
schema: { type: Object, required: true },
|
|
7
7
|
});
|
|
8
8
|
|
|
9
|
-
const
|
|
9
|
+
const backStore = useBackStore();
|
|
10
10
|
const packages_versions = ref([]);
|
|
11
11
|
|
|
12
12
|
async function get_packages_versions() {
|
|
13
|
-
await
|
|
13
|
+
await backStore.request(
|
|
14
14
|
schema,
|
|
15
15
|
{},
|
|
16
16
|
{
|
|
@@ -22,7 +22,7 @@ async function get_packages_versions() {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
watch(
|
|
25
|
-
() =>
|
|
25
|
+
() => backStore.status,
|
|
26
26
|
(value) => {
|
|
27
27
|
if (value === Status.CONNECTED) {
|
|
28
28
|
get_packages_versions();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import ViewerOptionsAttributeColorBar from "@ogw_front/components/Viewer/Options/AttributeColorBar.vue";
|
|
3
|
-
import {
|
|
3
|
+
import { useBackStore } from "@ogw_front/stores/back";
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const backStore = useBackStore();
|
|
6
6
|
|
|
7
7
|
const name = defineModel("name", { type: String });
|
|
8
8
|
const range = defineModel("range", { type: Array });
|
|
@@ -49,7 +49,7 @@ function resetRange() {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
function getAttributes() {
|
|
52
|
-
|
|
52
|
+
backStore.request(
|
|
53
53
|
schema,
|
|
54
54
|
{ id },
|
|
55
55
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import FileUploader from "@ogw_front/components/FileUploader";
|
|
3
3
|
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json";
|
|
4
|
-
import {
|
|
4
|
+
import { useBackStore } from "@ogw_front/stores/back";
|
|
5
5
|
|
|
6
6
|
const emit = defineEmits(["update_value"]);
|
|
7
7
|
|
|
@@ -18,14 +18,14 @@ const texture_id = ref("");
|
|
|
18
18
|
texture_id.value = texture_id;
|
|
19
19
|
|
|
20
20
|
const texture_coordinates = ref([]);
|
|
21
|
-
const
|
|
21
|
+
const backStore = useBackStore();
|
|
22
22
|
|
|
23
23
|
onMounted(() => {
|
|
24
24
|
getTextureCoordinates();
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
function getTextureCoordinates() {
|
|
28
|
-
|
|
28
|
+
backStore.request(
|
|
29
29
|
back_schemas.opengeodeweb_back.texture_coordinates,
|
|
30
30
|
{ id },
|
|
31
31
|
{
|
|
@@ -38,7 +38,7 @@ function getTextureCoordinates() {
|
|
|
38
38
|
|
|
39
39
|
async function files_uploaded_event(value) {
|
|
40
40
|
if (value.length > 0) {
|
|
41
|
-
await
|
|
41
|
+
await backStore.request(
|
|
42
42
|
back_schemas.opengeodeweb_back.save_viewable_file,
|
|
43
43
|
{
|
|
44
44
|
schema: back_schemas.opengeodeweb_back.save_viewable_file,
|
|
@@ -5,9 +5,9 @@ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schem
|
|
|
5
5
|
import { importWorkflowFromSnapshot } from "@ogw_front/utils/import_workflow";
|
|
6
6
|
|
|
7
7
|
import { useAppStore } from "@ogw_front/stores/app";
|
|
8
|
+
import { useBackStore } from "@ogw_front/stores/back";
|
|
8
9
|
import { useDataStore } from "@ogw_front/stores/data";
|
|
9
10
|
import { useDataStyleStore } from "@ogw_front/stores/data_style";
|
|
10
|
-
import { useGeodeStore } from "@ogw_front/stores/geode";
|
|
11
11
|
import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
|
|
12
12
|
import { useTreeviewStore } from "@ogw_front/stores/treeview";
|
|
13
13
|
import { useViewerStore } from "@ogw_front/stores/viewer";
|
|
@@ -15,13 +15,13 @@ import { useViewerStore } from "@ogw_front/stores/viewer";
|
|
|
15
15
|
async function exportProject() {
|
|
16
16
|
console.log("[export triggered]");
|
|
17
17
|
const appStore = useAppStore();
|
|
18
|
-
const
|
|
18
|
+
const backStore = useBackStore();
|
|
19
19
|
const snapshot = await appStore.exportStores();
|
|
20
20
|
const schema = back_schemas.opengeodeweb_back.export_project;
|
|
21
21
|
const defaultName = "project.vease";
|
|
22
22
|
|
|
23
23
|
const result = await $fetch(schema.$id, {
|
|
24
|
-
baseURL:
|
|
24
|
+
baseURL: backStore.base_url,
|
|
25
25
|
method: schema.methods.find((method) => method !== "OPTIONS"),
|
|
26
26
|
body: { snapshot, filename: defaultName },
|
|
27
27
|
});
|
|
@@ -30,7 +30,7 @@ async function exportProject() {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
async function importProject(file) {
|
|
33
|
-
const
|
|
33
|
+
const backStore = useBackStore();
|
|
34
34
|
const dataStyleStore = useDataStyleStore();
|
|
35
35
|
const viewerStore = useViewerStore();
|
|
36
36
|
const dataStore = useDataStore();
|
|
@@ -63,7 +63,7 @@ async function importProject(file) {
|
|
|
63
63
|
form.append("file", file, originalFileName);
|
|
64
64
|
|
|
65
65
|
const result = await $fetch(schemaImport.$id, {
|
|
66
|
-
baseURL:
|
|
66
|
+
baseURL: backStore.base_url,
|
|
67
67
|
method: "POST",
|
|
68
68
|
body: form,
|
|
69
69
|
});
|
|
@@ -10,11 +10,12 @@ import { useInfraStore } from "@ogw_front/stores/infra";
|
|
|
10
10
|
const MILLISECONDS_IN_SECOND = 1000;
|
|
11
11
|
const DEFAULT_PING_INTERVAL_SECONDS = 10;
|
|
12
12
|
|
|
13
|
-
export const
|
|
13
|
+
export const useBackStore = defineStore("back", {
|
|
14
14
|
state: () => ({
|
|
15
15
|
default_local_port: "5000",
|
|
16
16
|
request_counter: 0,
|
|
17
17
|
status: Status.NOT_CONNECTED,
|
|
18
|
+
version: "0.0.0",
|
|
18
19
|
}),
|
|
19
20
|
getters: {
|
|
20
21
|
protocol() {
|
|
@@ -148,6 +149,20 @@ export const useGeodeStore = defineStore("geode", {
|
|
|
148
149
|
},
|
|
149
150
|
);
|
|
150
151
|
},
|
|
152
|
+
get_version(schema) {
|
|
153
|
+
if (!schema) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
return this.request(
|
|
157
|
+
schema,
|
|
158
|
+
{},
|
|
159
|
+
{
|
|
160
|
+
response_function: (response) => {
|
|
161
|
+
this.version = response.microservice_version;
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
);
|
|
165
|
+
},
|
|
151
166
|
},
|
|
152
167
|
share: {
|
|
153
168
|
omit: ["status"],
|
package/app/stores/viewer.js
CHANGED
|
@@ -30,6 +30,7 @@ export const useViewerStore = defineStore(
|
|
|
30
30
|
const picked_point = ref({ x: undefined, y: undefined, z: undefined });
|
|
31
31
|
const request_counter = ref(0);
|
|
32
32
|
const status = ref(Status.NOT_CONNECTED);
|
|
33
|
+
const version = ref("0.0.0");
|
|
33
34
|
const busy = ref(0);
|
|
34
35
|
|
|
35
36
|
const protocol = computed(() => {
|
|
@@ -185,6 +186,21 @@ export const useViewerStore = defineStore(
|
|
|
185
186
|
);
|
|
186
187
|
}
|
|
187
188
|
|
|
189
|
+
function get_version(schema) {
|
|
190
|
+
if (!schema) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
return request(
|
|
194
|
+
schema,
|
|
195
|
+
{},
|
|
196
|
+
{
|
|
197
|
+
response_function: (response) => {
|
|
198
|
+
version.value = response.microservice_version;
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
|
|
188
204
|
return {
|
|
189
205
|
default_local_port,
|
|
190
206
|
client,
|
|
@@ -205,6 +221,8 @@ export const useViewerStore = defineStore(
|
|
|
205
221
|
launch,
|
|
206
222
|
connect,
|
|
207
223
|
request,
|
|
224
|
+
version,
|
|
225
|
+
get_version,
|
|
208
226
|
};
|
|
209
227
|
},
|
|
210
228
|
{
|
package/app/utils/extension.js
CHANGED
|
@@ -35,8 +35,6 @@ async function registerRunningExtensions() {
|
|
|
35
35
|
});
|
|
36
36
|
appStore.registerStore(store);
|
|
37
37
|
console.log("[ExtensionManager] Store registered:", store.$id);
|
|
38
|
-
await store.connect();
|
|
39
|
-
console.log("[ExtensionManager] Microservice connected:", store.$id);
|
|
40
38
|
infraStore.register_microservice(store);
|
|
41
39
|
}
|
|
42
40
|
return {
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json";
|
|
4
4
|
|
|
5
5
|
// Local imports
|
|
6
|
+
import { useBackStore } from "@ogw_front/stores/back";
|
|
6
7
|
import { useDataStore } from "@ogw_front/stores/data";
|
|
7
8
|
import { useDataStyleStore } from "@ogw_front/stores/data_style";
|
|
8
|
-
import { useGeodeStore } from "@ogw_front/stores/geode";
|
|
9
9
|
import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
|
|
10
10
|
import { useTreeviewStore } from "@ogw_front/stores/treeview";
|
|
11
11
|
|
|
@@ -55,8 +55,8 @@ async function importItem(item) {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
async function importFile(filename, geode_object_type) {
|
|
58
|
-
const
|
|
59
|
-
const response = await
|
|
58
|
+
const backStore = useBackStore();
|
|
59
|
+
const response = await backStore.request(back_schemas.opengeodeweb_back.save_viewable_file, {
|
|
60
60
|
geode_object_type,
|
|
61
61
|
filename,
|
|
62
62
|
});
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@ import { Status } from "@ogw_front/utils/status";
|
|
|
14
14
|
import { appMode } from "@ogw_front/utils/local/app_mode";
|
|
15
15
|
import { importFile } from "@ogw_front/utils/import_workflow";
|
|
16
16
|
import { setupActivePinia } from "@ogw_tests/utils";
|
|
17
|
-
import {
|
|
17
|
+
import { useBackStore } from "@ogw_front/stores/back";
|
|
18
18
|
import { useInfraStore } from "@ogw_front/stores/infra";
|
|
19
19
|
import { useViewerStore } from "@ogw_front/stores/viewer";
|
|
20
20
|
|
|
@@ -23,7 +23,7 @@ const beforeAllTimeout = 40_000;
|
|
|
23
23
|
const data_folder = path.join("tests", "integration", "data", "uploads");
|
|
24
24
|
|
|
25
25
|
async function runMicroservices() {
|
|
26
|
-
const
|
|
26
|
+
const backStore = useBackStore();
|
|
27
27
|
const infraStore = useInfraStore();
|
|
28
28
|
const viewerStore = useViewerStore();
|
|
29
29
|
infraStore.app_mode = appMode.BROWSER;
|
|
@@ -53,7 +53,7 @@ async function runMicroservices() {
|
|
|
53
53
|
port: viewer_port,
|
|
54
54
|
});
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
backStore.default_local_port = back_port;
|
|
57
57
|
viewerStore.default_local_port = viewer_port;
|
|
58
58
|
|
|
59
59
|
return {
|
|
@@ -5,19 +5,19 @@ import { mountSuspended } from "@nuxt/test-utils/runtime";
|
|
|
5
5
|
// Local imports
|
|
6
6
|
import { setupActivePinia, vuetify } from "@ogw_tests/utils";
|
|
7
7
|
import CrsSelector from "@ogw_front/components/CrsSelector";
|
|
8
|
-
import {
|
|
8
|
+
import { useBackStore } from "@ogw_front/stores/back";
|
|
9
9
|
|
|
10
10
|
const EXPECTED_LENGTH = 1;
|
|
11
11
|
const FIRST_INDEX = 0;
|
|
12
12
|
|
|
13
13
|
let pinia = undefined;
|
|
14
|
-
let
|
|
14
|
+
let backStore = undefined;
|
|
15
15
|
|
|
16
16
|
describe("crs selector", () => {
|
|
17
17
|
beforeEach(() => {
|
|
18
18
|
pinia = setupActivePinia();
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
backStore = useBackStore();
|
|
20
|
+
backStore.base_url = "/";
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
test("default behavior", async () => {
|
|
@@ -29,8 +29,8 @@ describe("crs selector", () => {
|
|
|
29
29
|
},
|
|
30
30
|
];
|
|
31
31
|
|
|
32
|
-
// Mock
|
|
33
|
-
|
|
32
|
+
// Mock backStore.request instead of registerEndpoint
|
|
33
|
+
backStore.request = vi.fn((schema, params, callbacks) => {
|
|
34
34
|
callbacks.response_function({ crs_list });
|
|
35
35
|
return Promise.resolve({ crs_list });
|
|
36
36
|
});
|
|
@@ -8,7 +8,7 @@ import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json";
|
|
|
8
8
|
// Local imports
|
|
9
9
|
import { setupActivePinia, vuetify } from "@ogw_tests/utils";
|
|
10
10
|
import ExtensionSelector from "@ogw_front/components/ExtensionSelector";
|
|
11
|
-
import {
|
|
11
|
+
import { useBackStore } from "@ogw_front/stores/back";
|
|
12
12
|
|
|
13
13
|
const EXPECTED_LENGTH = 1;
|
|
14
14
|
const FIRST_INDEX = 0;
|
|
@@ -17,13 +17,13 @@ const SECOND_INDEX = 1;
|
|
|
17
17
|
const schema = schemas.opengeodeweb_back.geode_objects_and_output_extensions;
|
|
18
18
|
|
|
19
19
|
const pinia = setupActivePinia();
|
|
20
|
-
const
|
|
20
|
+
const backStore = useBackStore();
|
|
21
21
|
|
|
22
22
|
describe("extension selector", () => {
|
|
23
23
|
beforeEach(() => {
|
|
24
|
-
|
|
24
|
+
backStore.base_url = "/";
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
backStore.request = vi.fn(() => {
|
|
27
27
|
const response = {
|
|
28
28
|
geode_objects_and_output_extensions: {
|
|
29
29
|
BRep: { msh: { is_saveable: true } },
|
|
@@ -9,7 +9,7 @@ import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json";
|
|
|
9
9
|
import { setupActivePinia, vuetify } from "@ogw_tests/utils";
|
|
10
10
|
import FileSelector from "@ogw_front/components/FileSelector";
|
|
11
11
|
import FileUploader from "@ogw_front/components/FileUploader";
|
|
12
|
-
import {
|
|
12
|
+
import { useBackStore } from "@ogw_front/stores/back";
|
|
13
13
|
|
|
14
14
|
const EXPECTED_LENGTH = 1;
|
|
15
15
|
const FIRST_INDEX = 0;
|
|
@@ -20,8 +20,8 @@ const upload_file_schema = schemas.opengeodeweb_back.upload_file;
|
|
|
20
20
|
|
|
21
21
|
describe("file selector", () => {
|
|
22
22
|
const pinia = setupActivePinia();
|
|
23
|
-
const
|
|
24
|
-
|
|
23
|
+
const backStore = useBackStore();
|
|
24
|
+
backStore.base_url = "/";
|
|
25
25
|
|
|
26
26
|
test("select file", async () => {
|
|
27
27
|
registerEndpoint(allowed_files_schema.$id, {
|
|
@@ -8,7 +8,7 @@ import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json";
|
|
|
8
8
|
// Local imports
|
|
9
9
|
import { setupActivePinia, vuetify } from "@ogw_tests/utils";
|
|
10
10
|
import FileUploader from "@ogw_front/components/FileUploader";
|
|
11
|
-
import {
|
|
11
|
+
import { useBackStore } from "@ogw_front/stores/back";
|
|
12
12
|
|
|
13
13
|
const FIRST_INDEX = 0;
|
|
14
14
|
const SECOND_INDEX = 1;
|
|
@@ -17,8 +17,8 @@ const upload_file_schema = schemas.opengeodeweb_back.upload_file;
|
|
|
17
17
|
|
|
18
18
|
describe("file uploader", () => {
|
|
19
19
|
const pinia = setupActivePinia();
|
|
20
|
-
const
|
|
21
|
-
|
|
20
|
+
const backStore = useBackStore();
|
|
21
|
+
backStore.base_url = "/";
|
|
22
22
|
|
|
23
23
|
registerEndpoint(upload_file_schema.$id, {
|
|
24
24
|
method: upload_file_schema.methods[FIRST_INDEX],
|
|
@@ -7,12 +7,12 @@ import { mountSuspended } from "@nuxt/test-utils/runtime";
|
|
|
7
7
|
// Local imports
|
|
8
8
|
import { setupActivePinia, vuetify } from "@ogw_tests/utils";
|
|
9
9
|
import InspectorInspectionButton from "@ogw_front/components/Inspector/InspectionButton";
|
|
10
|
-
import {
|
|
10
|
+
import { useBackStore } from "@ogw_front/stores/back";
|
|
11
11
|
|
|
12
12
|
describe("inspector inspection button", () => {
|
|
13
13
|
const pinia = setupActivePinia();
|
|
14
|
-
const
|
|
15
|
-
|
|
14
|
+
const backStore = useBackStore();
|
|
15
|
+
backStore.base_url = "/";
|
|
16
16
|
|
|
17
17
|
test("with issues", async () => {
|
|
18
18
|
const inspection_result = {
|
|
@@ -31,7 +31,7 @@ describe("inspector inspection button", () => {
|
|
|
31
31
|
},
|
|
32
32
|
],
|
|
33
33
|
};
|
|
34
|
-
|
|
34
|
+
backStore.request = vi.fn((_schema, _params, callbacks) => {
|
|
35
35
|
callbacks?.response_function?.({ inspection_result });
|
|
36
36
|
return Promise.resolve({ inspection_result });
|
|
37
37
|
});
|
|
@@ -9,7 +9,7 @@ import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json";
|
|
|
9
9
|
import { setupActivePinia, vuetify } from "@ogw_tests/utils";
|
|
10
10
|
import FileUploader from "@ogw_front/components/FileUploader";
|
|
11
11
|
import MissingFilesSelector from "@ogw_front/components/MissingFilesSelector";
|
|
12
|
-
import {
|
|
12
|
+
import { useBackStore } from "@ogw_front/stores/back";
|
|
13
13
|
|
|
14
14
|
const EXPECTED_LENGTH = 1;
|
|
15
15
|
const FIRST_INDEX = 0;
|
|
@@ -19,11 +19,11 @@ const upload_file_schema = schemas.opengeodeweb_back.upload_file;
|
|
|
19
19
|
|
|
20
20
|
describe("missing files selector", () => {
|
|
21
21
|
const pinia = setupActivePinia();
|
|
22
|
-
const
|
|
23
|
-
|
|
22
|
+
const backStore = useBackStore();
|
|
23
|
+
backStore.base_url = "/";
|
|
24
24
|
|
|
25
25
|
test("select file", async () => {
|
|
26
|
-
|
|
26
|
+
backStore.request = vi.fn((schema, params, callbacks) => {
|
|
27
27
|
callbacks?.response_function?.({
|
|
28
28
|
has_missing_files: true,
|
|
29
29
|
mandatory_files: ["fake_file.txt"],
|