Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
cc192e4
texture_id replacing texture_filename
MaxNumerique Sep 29, 2025
615c3ac
fix(applytexture): Since database added, texture_id is required.
MaxNumerique Sep 29, 2025
bcb582c
Apply prepare changes
MaxNumerique Sep 29, 2025
d59cb45
removed file_name from registerObject function
MaxNumerique Sep 30, 2025
bb86d77
Merge branch 'fix/database' of https://github.com/Geode-solutions/Ope…
MaxNumerique Sep 30, 2025
0d30ab9
mypy
MaxNumerique Oct 1, 2025
4a3b09b
Apply prepare changes
MaxNumerique Oct 1, 2025
fa9fe32
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
MaxNumerique Oct 1, 2025
5f29502
Merge branch 'fix/database' of https://github.com/Geode-solutions/Ope…
MaxNumerique Oct 1, 2025
afcd104
test
MaxNumerique Oct 1, 2025
65a0ca9
test
MaxNumerique Oct 1, 2025
103a401
test
MaxNumerique Oct 1, 2025
077c20e
test
MaxNumerique Oct 1, 2025
94a4340
test
MaxNumerique Oct 1, 2025
917f904
test
MaxNumerique Oct 1, 2025
f37f789
Apply prepare changes
MaxNumerique Oct 1, 2025
1c757d0
test
MaxNumerique Oct 1, 2025
92b3822
Merge branch 'fix/database' of https://github.com/Geode-solutions/Ope…
MaxNumerique Oct 1, 2025
764524c
test
MaxNumerique Oct 1, 2025
b658d11
Apply prepare changes
MaxNumerique Oct 1, 2025
9f6554e
revert
MaxNumerique Oct 2, 2025
41470f8
Apply prepare changes
MaxNumerique Oct 2, 2025
175f53a
test inc
MaxNumerique Oct 2, 2025
a0a3cf2
data_base updated for mesh_component JSON schema update
MaxNumerique Oct 2, 2025
9689829
Apply prepare changes
MaxNumerique Oct 2, 2025
f8de037
stable ? mesh_component
MaxNumerique Oct 3, 2025
2e7098b
Merge branch 'fix/database' of https://github.com/Geode-solutions/Ope…
MaxNumerique Oct 3, 2025
d63442a
schema.route to schema.$id in viewer.call
MaxNumerique Oct 3, 2025
affa376
test
MaxNumerique Oct 3, 2025
80c987d
registerObject whit id only
MaxNumerique Oct 3, 2025
a62c5be
Apply prepare changes
MaxNumerique Oct 3, 2025
e9c850a
waiting room for refacto web server from Vease-Back
MaxNumerique Oct 3, 2025
67a3880
Merge branch 'fix/database' of https://github.com/Geode-solutions/Ope…
MaxNumerique Oct 3, 2025
c59c180
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
MaxNumerique Oct 6, 2025
04fe971
Apply prepare changes
MaxNumerique Oct 6, 2025
0778788
logging problems
MaxNumerique Oct 6, 2025
cbbd164
Merge branch 'fix/database' of https://github.com/Geode-solutions/Ope…
MaxNumerique Oct 6, 2025
5981825
Apply prepare changes
MaxNumerique Oct 6, 2025
24b339d
Integration tests. work in progress. have to deal with generic_protocols
MaxNumerique Oct 7, 2025
465541d
Merge branch 'fix/database' of https://github.com/Geode-solutions/Ope…
MaxNumerique Oct 7, 2025
5537410
addded viewer_object
MaxNumerique Oct 7, 2025
53ce0c4
revert changes to api_fetch and api_fetch.nuxt.test.js and uncomment …
MaxNumerique Oct 8, 2025
18938db
first version of folders removed after all integration tests
MaxNumerique Oct 8, 2025
624b6d4
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
MaxNumerique Oct 14, 2025
4687af3
Apply prepare changes
MaxNumerique Oct 14, 2025
109ad42
fixed back_port
MaxNumerique Oct 14, 2025
8d3bd11
Merge branch 'fix/database' of https://github.com/Geode-solutions/Ope…
MaxNumerique Oct 14, 2025
9132bae
kill_back afterEach
MaxNumerique Oct 14, 2025
dbbc49f
missed imports
MaxNumerique Oct 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ venv
.pytest_cache
__snapshots__
coverage
*.db
# package-lock.json
12 changes: 6 additions & 6 deletions components/Viewer/Options/TextureItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@

const props = defineProps({
id: { type: String, required: true },
texture_id: { type: String, required: true },
texture_name: { type: String, required: true },
texture_file_name: { type: String, required: true },
})

const texture_name = ref("")
texture_name.value = props.texture_name

const texture_file_name = ref("")
texture_file_name.value = props.texture_file_name
const texture_id = ref("")
texture_id.value = props.texture_id

const texture_coordinates = ref([])

Expand Down Expand Up @@ -86,7 +86,7 @@
},
{
response_function: async (response) => {
texture_file_name.value = response._data.viewable_file_name
texture_id.value = response._data.id
},
},
)
Expand All @@ -97,8 +97,8 @@
emit("update_value", { key: "texture_name", value })
})

watch(texture_file_name, (value) => {
emit("update_value", { key: "texture_file_name", value })
watch(texture_id, (value) => {
emit("update_value", { key: "id", value })
})
</script>

Expand Down
12 changes: 5 additions & 7 deletions components/Viewer/Options/TexturesSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<ViewerOptionsTextureItem
:id="id"
:texture_name="internal_textures[index].texture_name"
:texture_file_name="internal_textures[index].texture_file_name"
:texture_id="internal_textures[index].id"
@update_value="update_value_event($event, index)"
/>
</v-row>
Expand All @@ -30,9 +30,7 @@
icon="mdi-plus"
v-tooltip:bottom="'Add a texture'"
size="20"
@click="
internal_textures.push({ texture_name: '', texture_file_name: '' })
"
@click="internal_textures.push({ texture_name: '', id: '' })"
/>
</v-col>
</v-row>
Expand All @@ -51,16 +49,16 @@
if (textures.value != null) {
internal_textures.value = textures.value
} else {
internal_textures.value = [{ texture_name: "", texture_file_name: "" }]
internal_textures.value = [{ id: "", texture_name: "" }]
}
})

function update_value_event($event, index) {
internal_textures.value[index][$event.key] = $event.value
const filtered = internal_textures.value.filter((texture) => {
return texture.texture_name != "" && texture.texture_file_name != ""
return texture.texture_name !== "" && texture.id !== ""
})
if (filtered.length != 0) {
if (filtered.length !== 0) {
textures.value = filtered
}
}
Expand Down
7 changes: 2 additions & 5 deletions stores/data_base.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ export const useDataBaseStore = defineStore("dataBase", () => {
}

/** Actions **/
async function registerObject(id, file_name, viewer_object) {
async function registerObject(id, viewer_object) {
return viewer_call({
schema: viewer_schemas.opengeodeweb_viewer.generic.register,
params: { id, file_name, viewer_object },
params: { id, viewer_object },
})
}
async function addItem(
Expand Down Expand Up @@ -76,14 +76,11 @@ export const useDataBaseStore = defineStore("dataBase", () => {
}

async function fetchMeshComponents(id) {
const { native_filename, geode_object } = itemMetaDatas(id)
await api_fetch(
{
schema: back_schemas.opengeodeweb_back.models.mesh_components,
params: {
id,
filename: native_filename,
geode_object,
},
},
{
Expand Down
Binary file added tests/integration/data/uploads/test.og_edc2d
Binary file not shown.
1 change: 0 additions & 1 deletion tests/integration/microservices/back/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
# pip-compile --output-file=tests/integration/microservices/back/requirements.txt tests/integration/microservices/back/requirements.in
#

opengeodeweb-back==5.*,>=5.10.3rc16
1 change: 0 additions & 1 deletion tests/integration/microservices/viewer/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
# pip-compile --output-file=tests/integration/microservices/viewer/requirements.txt tests/integration/microservices/viewer/requirements.in
#

opengeodeweb-viewer==1.*,>=1.11.3rc7
108 changes: 93 additions & 15 deletions tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import path from "path"
import fs from "fs"

import { setActivePinia } from "pinia"
import { createTestingPinia } from "@pinia/testing"
Expand All @@ -17,19 +18,25 @@ import {
import {
executable_name,
executable_path,
kill_viewer,
run_viewer,
run_back,
kill_viewer,
kill_back,
} from "@ogw_f/utils/local"

import Status from "@ogw_f/utils/status"

import { api_fetch } from "@ogw_f/composables/api_fetch"
import * as composables from "@ogw_f/composables/viewer_call"
import { useDataStyleStore } from "@ogw_f/stores/data_style"
import { useDataBaseStore } from "@ogw_f/stores/data_base"
import { useViewerStore } from "@ogw_f/stores/viewer"
import { useInfraStore } from "@ogw_f/stores/infra"
import { useGeodeStore } from "@ogw_f/stores/geode"

import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
import appMode from "@ogw_f/utils/app_mode"
import { WebSocket } from "ws"

const mesh_edges_schemas = viewer_schemas.opengeodeweb_viewer.mesh.edges
Expand All @@ -45,18 +52,50 @@ vi.stubGlobal("navigator", {
},
})

let foldersBeforeTests = new Set()
const data_folder_path = path.join(__dirname, "..", "..", "..", "data")

function getCurrentFolders(dataFolderPath) {
if (!fs.existsSync(dataFolderPath)) {
return new Set()
}
const entries = fs.readdirSync(dataFolderPath)
const folders = new Set()
for (const entry of entries) {
const entryPath = path.join(dataFolderPath, entry)
if (fs.statSync(entryPath).isDirectory()) {
folders.add(entry)
}
}
return folders
}

function cleanupCreatedFolders(dataFolderPath, foldersBeforeTests) {
if (!fs.existsSync(dataFolderPath)) {
return
}
const currentFolders = getCurrentFolders(dataFolderPath)
for (const folder of currentFolders) {
if (!foldersBeforeTests.has(folder)) {
const folderPath = path.join(dataFolderPath, folder)
fs.rmSync(folderPath, { recursive: true, force: true })
}
}
}

beforeAll(() => {
global.WebSocket = WebSocket
foldersBeforeTests = getCurrentFolders(data_folder_path)
})

afterAll(() => {
delete global.WebSocket
cleanupCreatedFolders(data_folder_path, foldersBeforeTests)
})

const id = "fake_id"
const file_name = "edged_curve.vtp"
let id = "fake_id"
const file_name = "test.og_edc2d"
const geode_object = "EdgedCurve2D"
const object_type = "mesh"

beforeEach(async () => {
const pinia = createTestingPinia({
Expand All @@ -66,32 +105,71 @@ beforeEach(async () => {
setActivePinia(pinia)
const dataStyleStore = useDataStyleStore()
const dataBaseStore = useDataBaseStore()
const geodeStore = useGeodeStore()
const viewerStore = useViewerStore()
const infraStore = useInfraStore()
infraStore.app_mode = appMode.appMode.BROWSER
infraStore.app_mode = appMode.BROWSER

if (!fs.existsSync(data_folder_path)) {
fs.mkdirSync(data_folder_path, { recursive: true })
}

const back_path = path.join(
executable_path(path.join("tests", "integration", "microservices", "back")),
executable_name("opengeodeweb-back"),
)
const viewer_path = path.join(
executable_path(
path.join("tests", "integration", "microservices", "viewer"),
),
executable_name("opengeodeweb_viewer"),
executable_name("opengeodeweb-viewer"),
)
const viewer_port = await run_viewer(viewer_path, {

const back_promise = run_back(back_path, {
port: 5000,
data_folder_path,
})

const viewer_promise = run_viewer(viewer_path, {
port: 1234,
data_folder_path: path.join(__dirname, "..", "..", "..", "data"),
data_folder_path,
})

const [back_port, viewer_port] = await Promise.all([
back_promise,
viewer_promise,
])
console.log("Viewer path:", viewer_path)
geodeStore.default_local_port = back_port
viewerStore.default_local_port = viewer_port
await viewerStore.ws_connect()
await dataBaseStore.registerObject(id, file_name, object_type)
await dataStyleStore.addDataStyle(id, geode_object, object_type)
console.log("schema", back_schemas.opengeodeweb_back.save_viewable_file)

const response = await api_fetch({
schema: back_schemas.opengeodeweb_back.save_viewable_file,
params: {
input_geode_object: geode_object,
filename: file_name,
},
})
id = response.data.value.id

await dataBaseStore.registerObject(id, "mesh")
await dataStyleStore.addDataStyle(id, geode_object, "mesh")

expect(viewerStore.status).toBe(Status.CONNECTED)
}, 15000)

describe("Mesh edges", () => {
afterEach(async () => {
const viewerStore = useViewerStore()
await kill_viewer(viewerStore.default_local_port)
})
afterEach(async () => {
const viewerStore = useViewerStore()
const geodeStore = useGeodeStore()
await Promise.all([
kill_viewer(viewerStore.default_local_port),
kill_back(geodeStore.default_local_port),
])
})

describe("Mesh edges", () => {
describe("Edges visibility", () => {
test("test visibility true", async () => {
const dataStyleStore = useDataStyleStore()
Expand Down