@geode/opengeodeweb-front 9.11.6-rc.1 → 9.11.6-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/components/Viewer/Options/TextureItem.vue +6 -6
- package/components/Viewer/Options/TexturesSelector.vue +5 -7
- package/package.json +1 -1
- package/stores/data_base.js +2 -5
- package/tests/integration/data/uploads/test.og_edc2d +0 -0
- package/tests/integration/microservices/back/requirements.txt +1 -1
- package/tests/integration/microservices/viewer/requirements.txt +1 -1
- package/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js +93 -15
|
@@ -42,15 +42,15 @@
|
|
|
42
42
|
|
|
43
43
|
const props = defineProps({
|
|
44
44
|
id: { type: String, required: true },
|
|
45
|
+
texture_id: { type: String, required: true },
|
|
45
46
|
texture_name: { type: String, required: true },
|
|
46
|
-
texture_file_name: { type: String, required: true },
|
|
47
47
|
})
|
|
48
48
|
|
|
49
49
|
const texture_name = ref("")
|
|
50
50
|
texture_name.value = props.texture_name
|
|
51
51
|
|
|
52
|
-
const
|
|
53
|
-
|
|
52
|
+
const texture_id = ref("")
|
|
53
|
+
texture_id.value = props.texture_id
|
|
54
54
|
|
|
55
55
|
const texture_coordinates = ref([])
|
|
56
56
|
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
response_function: async (response) => {
|
|
89
|
-
|
|
89
|
+
texture_id.value = response._data.id
|
|
90
90
|
},
|
|
91
91
|
},
|
|
92
92
|
)
|
|
@@ -97,8 +97,8 @@
|
|
|
97
97
|
emit("update_value", { key: "texture_name", value })
|
|
98
98
|
})
|
|
99
99
|
|
|
100
|
-
watch(
|
|
101
|
-
emit("update_value", { key: "
|
|
100
|
+
watch(texture_id, (value) => {
|
|
101
|
+
emit("update_value", { key: "id", value })
|
|
102
102
|
})
|
|
103
103
|
</script>
|
|
104
104
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
<ViewerOptionsTextureItem
|
|
19
19
|
:id="id"
|
|
20
20
|
:texture_name="internal_textures[index].texture_name"
|
|
21
|
-
:
|
|
21
|
+
:texture_id="internal_textures[index].id"
|
|
22
22
|
@update_value="update_value_event($event, index)"
|
|
23
23
|
/>
|
|
24
24
|
</v-row>
|
|
@@ -30,9 +30,7 @@
|
|
|
30
30
|
icon="mdi-plus"
|
|
31
31
|
v-tooltip:bottom="'Add a texture'"
|
|
32
32
|
size="20"
|
|
33
|
-
@click="
|
|
34
|
-
internal_textures.push({ texture_name: '', texture_file_name: '' })
|
|
35
|
-
"
|
|
33
|
+
@click="internal_textures.push({ texture_name: '', id: '' })"
|
|
36
34
|
/>
|
|
37
35
|
</v-col>
|
|
38
36
|
</v-row>
|
|
@@ -51,16 +49,16 @@
|
|
|
51
49
|
if (textures.value != null) {
|
|
52
50
|
internal_textures.value = textures.value
|
|
53
51
|
} else {
|
|
54
|
-
internal_textures.value = [{
|
|
52
|
+
internal_textures.value = [{ id: "", texture_name: "" }]
|
|
55
53
|
}
|
|
56
54
|
})
|
|
57
55
|
|
|
58
56
|
function update_value_event($event, index) {
|
|
59
57
|
internal_textures.value[index][$event.key] = $event.value
|
|
60
58
|
const filtered = internal_textures.value.filter((texture) => {
|
|
61
|
-
return texture.texture_name
|
|
59
|
+
return texture.texture_name !== "" && texture.id !== ""
|
|
62
60
|
})
|
|
63
|
-
if (filtered.length
|
|
61
|
+
if (filtered.length !== 0) {
|
|
64
62
|
textures.value = filtered
|
|
65
63
|
}
|
|
66
64
|
}
|
package/package.json
CHANGED
package/stores/data_base.js
CHANGED
|
@@ -42,10 +42,10 @@ export const useDataBaseStore = defineStore("dataBase", () => {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
/** Actions **/
|
|
45
|
-
async function registerObject(id,
|
|
45
|
+
async function registerObject(id, viewer_object) {
|
|
46
46
|
return viewer_call({
|
|
47
47
|
schema: viewer_schemas.opengeodeweb_viewer.generic.register,
|
|
48
|
-
params: { id,
|
|
48
|
+
params: { id, viewer_object },
|
|
49
49
|
})
|
|
50
50
|
}
|
|
51
51
|
async function addItem(
|
|
@@ -76,14 +76,11 @@ export const useDataBaseStore = defineStore("dataBase", () => {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
async function fetchMeshComponents(id) {
|
|
79
|
-
const { native_filename, geode_object } = itemMetaDatas(id)
|
|
80
79
|
await api_fetch(
|
|
81
80
|
{
|
|
82
81
|
schema: back_schemas.opengeodeweb_back.models.mesh_components,
|
|
83
82
|
params: {
|
|
84
83
|
id,
|
|
85
|
-
filename: native_filename,
|
|
86
|
-
geode_object,
|
|
87
84
|
},
|
|
88
85
|
},
|
|
89
86
|
{
|
|
Binary file
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import path from "path"
|
|
2
|
+
import fs from "fs"
|
|
2
3
|
|
|
3
4
|
import { setActivePinia } from "pinia"
|
|
4
5
|
import { createTestingPinia } from "@pinia/testing"
|
|
@@ -17,19 +18,25 @@ import {
|
|
|
17
18
|
import {
|
|
18
19
|
executable_name,
|
|
19
20
|
executable_path,
|
|
20
|
-
kill_viewer,
|
|
21
21
|
run_viewer,
|
|
22
|
+
run_back,
|
|
23
|
+
kill_viewer,
|
|
24
|
+
kill_back,
|
|
22
25
|
} from "@ogw_f/utils/local"
|
|
23
26
|
|
|
24
27
|
import Status from "@ogw_f/utils/status"
|
|
25
28
|
|
|
29
|
+
import { api_fetch } from "@ogw_f/composables/api_fetch"
|
|
26
30
|
import * as composables from "@ogw_f/composables/viewer_call"
|
|
27
31
|
import { useDataStyleStore } from "@ogw_f/stores/data_style"
|
|
28
32
|
import { useDataBaseStore } from "@ogw_f/stores/data_base"
|
|
29
33
|
import { useViewerStore } from "@ogw_f/stores/viewer"
|
|
30
34
|
import { useInfraStore } from "@ogw_f/stores/infra"
|
|
35
|
+
import { useGeodeStore } from "@ogw_f/stores/geode"
|
|
31
36
|
|
|
32
37
|
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
|
|
38
|
+
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
|
|
39
|
+
import appMode from "@ogw_f/utils/app_mode"
|
|
33
40
|
import { WebSocket } from "ws"
|
|
34
41
|
|
|
35
42
|
const mesh_edges_schemas = viewer_schemas.opengeodeweb_viewer.mesh.edges
|
|
@@ -45,18 +52,50 @@ vi.stubGlobal("navigator", {
|
|
|
45
52
|
},
|
|
46
53
|
})
|
|
47
54
|
|
|
55
|
+
let foldersBeforeTests = new Set()
|
|
56
|
+
const data_folder_path = path.join(__dirname, "..", "..", "..", "data")
|
|
57
|
+
|
|
58
|
+
function getCurrentFolders(dataFolderPath) {
|
|
59
|
+
if (!fs.existsSync(dataFolderPath)) {
|
|
60
|
+
return new Set()
|
|
61
|
+
}
|
|
62
|
+
const entries = fs.readdirSync(dataFolderPath)
|
|
63
|
+
const folders = new Set()
|
|
64
|
+
for (const entry of entries) {
|
|
65
|
+
const entryPath = path.join(dataFolderPath, entry)
|
|
66
|
+
if (fs.statSync(entryPath).isDirectory()) {
|
|
67
|
+
folders.add(entry)
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return folders
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function cleanupCreatedFolders(dataFolderPath, foldersBeforeTests) {
|
|
74
|
+
if (!fs.existsSync(dataFolderPath)) {
|
|
75
|
+
return
|
|
76
|
+
}
|
|
77
|
+
const currentFolders = getCurrentFolders(dataFolderPath)
|
|
78
|
+
for (const folder of currentFolders) {
|
|
79
|
+
if (!foldersBeforeTests.has(folder)) {
|
|
80
|
+
const folderPath = path.join(dataFolderPath, folder)
|
|
81
|
+
fs.rmSync(folderPath, { recursive: true, force: true })
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
48
86
|
beforeAll(() => {
|
|
49
87
|
global.WebSocket = WebSocket
|
|
88
|
+
foldersBeforeTests = getCurrentFolders(data_folder_path)
|
|
50
89
|
})
|
|
51
90
|
|
|
52
91
|
afterAll(() => {
|
|
53
92
|
delete global.WebSocket
|
|
93
|
+
cleanupCreatedFolders(data_folder_path, foldersBeforeTests)
|
|
54
94
|
})
|
|
55
95
|
|
|
56
|
-
|
|
57
|
-
const file_name = "
|
|
96
|
+
let id = "fake_id"
|
|
97
|
+
const file_name = "test.og_edc2d"
|
|
58
98
|
const geode_object = "EdgedCurve2D"
|
|
59
|
-
const object_type = "mesh"
|
|
60
99
|
|
|
61
100
|
beforeEach(async () => {
|
|
62
101
|
const pinia = createTestingPinia({
|
|
@@ -66,32 +105,71 @@ beforeEach(async () => {
|
|
|
66
105
|
setActivePinia(pinia)
|
|
67
106
|
const dataStyleStore = useDataStyleStore()
|
|
68
107
|
const dataBaseStore = useDataBaseStore()
|
|
108
|
+
const geodeStore = useGeodeStore()
|
|
69
109
|
const viewerStore = useViewerStore()
|
|
70
110
|
const infraStore = useInfraStore()
|
|
71
|
-
infraStore.app_mode = appMode.
|
|
111
|
+
infraStore.app_mode = appMode.BROWSER
|
|
112
|
+
|
|
113
|
+
if (!fs.existsSync(data_folder_path)) {
|
|
114
|
+
fs.mkdirSync(data_folder_path, { recursive: true })
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const back_path = path.join(
|
|
118
|
+
executable_path(path.join("tests", "integration", "microservices", "back")),
|
|
119
|
+
executable_name("opengeodeweb-back"),
|
|
120
|
+
)
|
|
72
121
|
const viewer_path = path.join(
|
|
73
122
|
executable_path(
|
|
74
123
|
path.join("tests", "integration", "microservices", "viewer"),
|
|
75
124
|
),
|
|
76
|
-
executable_name("
|
|
125
|
+
executable_name("opengeodeweb-viewer"),
|
|
77
126
|
)
|
|
78
|
-
|
|
127
|
+
|
|
128
|
+
const back_promise = run_back(back_path, {
|
|
129
|
+
port: 5000,
|
|
130
|
+
data_folder_path,
|
|
131
|
+
})
|
|
132
|
+
|
|
133
|
+
const viewer_promise = run_viewer(viewer_path, {
|
|
79
134
|
port: 1234,
|
|
80
|
-
data_folder_path
|
|
135
|
+
data_folder_path,
|
|
81
136
|
})
|
|
137
|
+
|
|
138
|
+
const [back_port, viewer_port] = await Promise.all([
|
|
139
|
+
back_promise,
|
|
140
|
+
viewer_promise,
|
|
141
|
+
])
|
|
142
|
+
console.log("Viewer path:", viewer_path)
|
|
143
|
+
geodeStore.default_local_port = back_port
|
|
82
144
|
viewerStore.default_local_port = viewer_port
|
|
83
145
|
await viewerStore.ws_connect()
|
|
84
|
-
|
|
85
|
-
|
|
146
|
+
console.log("schema", back_schemas.opengeodeweb_back.save_viewable_file)
|
|
147
|
+
|
|
148
|
+
const response = await api_fetch({
|
|
149
|
+
schema: back_schemas.opengeodeweb_back.save_viewable_file,
|
|
150
|
+
params: {
|
|
151
|
+
input_geode_object: geode_object,
|
|
152
|
+
filename: file_name,
|
|
153
|
+
},
|
|
154
|
+
})
|
|
155
|
+
id = response.data.value.id
|
|
156
|
+
|
|
157
|
+
await dataBaseStore.registerObject(id, "mesh")
|
|
158
|
+
await dataStyleStore.addDataStyle(id, geode_object, "mesh")
|
|
159
|
+
|
|
86
160
|
expect(viewerStore.status).toBe(Status.CONNECTED)
|
|
87
161
|
}, 15000)
|
|
88
162
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
163
|
+
afterEach(async () => {
|
|
164
|
+
const viewerStore = useViewerStore()
|
|
165
|
+
const geodeStore = useGeodeStore()
|
|
166
|
+
await Promise.all([
|
|
167
|
+
kill_viewer(viewerStore.default_local_port),
|
|
168
|
+
kill_back(geodeStore.default_local_port),
|
|
169
|
+
])
|
|
170
|
+
})
|
|
94
171
|
|
|
172
|
+
describe("Mesh edges", () => {
|
|
95
173
|
describe("Edges visibility", () => {
|
|
96
174
|
test("test visibility true", async () => {
|
|
97
175
|
const dataStyleStore = useDataStyleStore()
|