Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
650e9d6
geode_objects
MaxNumerique Jan 27, 2026
46caa8d
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
MaxNumerique Jan 27, 2026
31cfb88
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
MaxNumerique Feb 3, 2026
60c69bd
fix(oxlint): integration of oxlint
MaxNumerique Feb 4, 2026
7eacd29
composables
MaxNumerique Feb 4, 2026
789bc12
plugins & stores
MaxNumerique Feb 4, 2026
45305d1
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
MaxNumerique Feb 5, 2026
a404dfe
Apply prepare changes
MaxNumerique Feb 5, 2026
0c116bd
viewer store oxlinted
MaxNumerique Feb 5, 2026
d45fb9e
Merge branch 'fix/oxlint' of https://github.com/Geode-solutions/OpenG…
MaxNumerique Feb 5, 2026
f140aae
Apply prepare changes
MaxNumerique Feb 5, 2026
d7786eb
utils folder and wiewer store
MaxNumerique Feb 5, 2026
450fc27
Merge branch 'fix/oxlint' of https://github.com/Geode-solutions/OpenG…
MaxNumerique Feb 5, 2026
195fc24
Apply prepare changes
MaxNumerique Feb 5, 2026
c6548e5
internal stores, utils, integration tests
MaxNumerique Feb 5, 2026
cfd3c51
Merge branch 'fix/oxlint' of https://github.com/Geode-solutions/OpenG…
MaxNumerique Feb 5, 2026
950d19b
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
MaxNumerique Feb 5, 2026
48a7e3d
Apply prepare changes
MaxNumerique Feb 5, 2026
989c31b
tests units fixes
MaxNumerique Feb 5, 2026
d0faa4d
Merge branch 'fix/oxlint' of https://github.com/Geode-solutions/OpenG…
MaxNumerique Feb 5, 2026
fa883b9
utils/local refacto
MaxNumerique Feb 5, 2026
d988946
Apply prepare changes
MaxNumerique Feb 5, 2026
a6ef126
infra
MaxNumerique Feb 6, 2026
57d13b1
revert
MaxNumerique Feb 6, 2026
eb81c28
revert revert
MaxNumerique Feb 6, 2026
0375f05
hybrid_viewer vtk imports
MaxNumerique Feb 6, 2026
7bee1e7
rm oxlint flag
MaxNumerique Feb 6, 2026
0b80111
merge from next viewer and hybrid
MaxNumerique Feb 6, 2026
d1997a5
merge from next viewer and hybrid
MaxNumerique Feb 6, 2026
3a0a7d1
Apply prepare changes
MaxNumerique Feb 6, 2026
e3eab62
unit tests for components
MaxNumerique Feb 6, 2026
9a57e2c
Merge branch 'fix/oxlint' of https://github.com/Geode-solutions/OpenG…
MaxNumerique Feb 6, 2026
1316a90
Apply prepare changes
MaxNumerique Feb 6, 2026
e752282
components unit tests
MaxNumerique Feb 6, 2026
2e79f53
Merge branch 'fix/oxlint' of https://github.com/Geode-solutions/OpenG…
MaxNumerique Feb 6, 2026
9894fbc
Apply prepare changes
MaxNumerique Feb 6, 2026
bfe0b70
composables unit tests
MaxNumerique Feb 6, 2026
2c7fb40
Merge branch 'fix/oxlint' of https://github.com/Geode-solutions/OpenG…
MaxNumerique Feb 6, 2026
c337d10
unit plugins stores utils
MaxNumerique Feb 6, 2026
0c7e76f
local refacto
MaxNumerique Feb 6, 2026
058db29
integration test 1
MaxNumerique Feb 6, 2026
3a70688
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
MaxNumerique Feb 6, 2026
0bc42a0
Apply prepare changes
MaxNumerique Feb 6, 2026
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 .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// oxlint-disable-next-line import/no-commonjs
module.exports = {
root: true,
env: {
Expand Down
4 changes: 1 addition & 3 deletions app/assets/geode_objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import TriangulatedSurface2D from "@ogw_front/assets/img/geode_objects/Triangula
import TriangulatedSurface3D from "@ogw_front/assets/img/geode_objects/TriangulatedSurface3D.svg"
import VertexSet from "@ogw_front/assets/img/geode_objects/VertexSet.svg"

const geode_objects = {
export const geode_objects = {
BRep: {
tooltip: "BRep",
image: BRep,
Expand Down Expand Up @@ -126,5 +126,3 @@ const geode_objects = {
image: VertexSet,
},
}

export default geode_objects
11 changes: 7 additions & 4 deletions app/components/Carousel.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
<script setup>
// oxlint-disable-next-line import/no-unassigned-import
import "vue3-carousel/dist/carousel.css"
import { Carousel, Slide, Navigation, Pagination } from "vue3-carousel"
import { Carousel, Navigation, Pagination, Slide } from "vue3-carousel"
import { useDisplay } from "vuetify"

const props = defineProps({
const NB_ITEMS_TO_DISPLAY = 3

const { items } = defineProps({
items: { type: Array, required: true },
})

const { name } = useDisplay()
const nb_items_to_display = ref(3)
const nb_items_to_display = ref(NB_ITEMS_TO_DISPLAY)
watch(
name,
(value) => {
Expand Down Expand Up @@ -46,7 +49,7 @@
<ClientOnly>
<Carousel :settings="carrousel_settings">
<Slide
v-for="(item, index) in props.items"
v-for="(item, index) in items"
:key="index"
class="carousel__slide"
>
Expand Down
11 changes: 5 additions & 6 deletions app/components/CrsSelector.vue
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
<script setup>
import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
const schema = schemas.opengeodeweb_back.geographic_coordinate_systems
import { useGeodeStore } from "@ogw_front/stores/geode"

const schema = schemas.opengeodeweb_back.geographic_coordinate_systems

const emit = defineEmits([
"update_values",
"increment_step",
"decrement_step",
])

const props = defineProps({
const { geode_object_type, key_to_update } = defineProps({
geode_object_type: { type: String, required: true },
key_to_update: { type: String, required: true },
})

const { geode_object_type, key_to_update } = props

const search = ref("")
const data_table_loading = ref(false)
const crs_list = ref([])
Expand All @@ -33,8 +32,8 @@
})

function get_selected_crs(crs_code) {
for (let i = 0; i <= crs_list.value.length; i++) {
if (crs_list.value[i]["code"] == crs_code) {
for (let i = 0; i <= crs_list.value.length; i += 1) {
if (crs_list.value[i]["code"] === crs_code) {
return crs_list.value[i]
}
}
Expand Down
24 changes: 17 additions & 7 deletions app/components/DragAndDrop.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
<script setup>
const props = defineProps({
const {
multiple,
accept,
loading,
showExtensions,
idleText,
dropText,
loadingText,
} = defineProps({
multiple: { type: Boolean, default: false },
accept: { type: String, default: "" },
loading: { type: Boolean, default: false },
Expand All @@ -14,18 +22,20 @@
const isDragging = ref(false)
const fileInput = ref(null)

const triggerFileDialog = () => fileInput.value?.click()
function triggerFileDialog() {
fileInput.value?.click()
}

function handleDrop(e) {
function handleDrop(event) {
isDragging.value = false
const files = Array.from(e.dataTransfer.files)
const files = [...event.dataTransfer.files]
emit("files-selected", files)
}

function handleFileSelect(e) {
const files = Array.from(e.target.files)
function handleFileSelect(event) {
const files = [...event.target.files]
emit("files-selected", files)
e.target.value = ""
event.target.value = ""
}
</script>

Expand Down
26 changes: 9 additions & 17 deletions app/components/ExtensionSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
"decrement_step",
])
const props = defineProps({
const { geode_object_type, filenames } = defineProps({
geode_object_type: { type: String, required: true },
filenames: { type: Array, required: true },
})
const { geode_object_type, filenames } = props
const geode_objects_and_output_extensions = ref({})
const loading = ref(false)
Expand All @@ -25,27 +24,20 @@
toggle_loading()
geode_objects_and_output_extensions.value = {}
const geodeStore = useGeodeStore()
const promise_array = filenames.map((filename) => {
return new Promise((resolve, reject) => {
const params = {
const values = await Promise.all(
filenames.map(async (filename) => {
const response = await geodeStore.request(schema, {
geode_object_type,
filename,
}
geodeStore.request(schema, params, {
request_error_function: () => reject(),
response_function: (response) => {
resolve(response.geode_objects_and_output_extensions)
},
response_error_function: () => reject(),
})
})
})
const values = await Promise.all(promise_array)
return response.geode_objects_and_output_extensions
}),
)
const all_keys = [...new Set(values.flatMap((value) => Object.keys(value)))]
const common_keys = all_keys.filter(
(i) => !values.some((j) => !Object.keys(j).includes(i)),
)
var final_object = {}
const final_object = {}
for (const key of common_keys) {
final_object[key] = {}
for (const value of values) {
Expand All @@ -61,7 +53,7 @@
}
function update_values(output_geode_object, output_extension) {
if (output_geode_object != "" && output_extension != "") {
if (output_geode_object !== "" && output_extension !== "") {
emit("update_values", {
output_geode_object,
output_extension,
Expand Down
5 changes: 4 additions & 1 deletion app/components/FeedBack/Snackers.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<script setup>
import { useFeedbackStore } from "@ogw_front/stores/feedback"

const MARGIN_BETWEEN_SNACKERS = 60
const FIRST_SNACKER_MARGIN = 8

const feedbackStore = useFeedbackStore()
const show = ref(true)

function calc_margin(index) {
return index * 60 + 8 + "px"
return `${index * MARGIN_BETWEEN_SNACKERS + FIRST_SNACKER_MARGIN}px`
}
</script>

Expand Down
31 changes: 21 additions & 10 deletions app/components/FileSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,35 @@
"decrement_step",
])

const props = defineProps({
const { multiple, files, auto_upload } = defineProps({
multiple: { type: Boolean, required: true },
files: { type: Array, default: () => [] },
auto_upload: { type: Boolean, default: true },
})

const internal_files = ref(props.files)
const auto_upload = ref(props.auto_upload)
const internal_files = ref(files)
const internal_auto_upload = ref(auto_upload)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renommage de la ref interne pour éviter la confusion avec la prop

const accept = ref("")
const loading = ref(false)

watch(
() => props.files,
(val) => (internal_files.value = val),
() => files,
(val) => {
internal_files.value = val
},
)

watch(
() => props.auto_upload,
(val) => (auto_upload.value = val),
() => auto_upload,
(val) => {
internal_auto_upload.value = val
},
)

const toggle_loading = useToggle(loading)

function files_uploaded_event(value) {
if (value.length) {
if (value.length > 0) {
emit("update_values", { files: value, auto_upload: false })
emit("increment_step")
}
Expand All @@ -47,7 +51,9 @@
toggle_loading()
const geodeStore = useGeodeStore()
const response = await geodeStore.request(schema, {})
accept.value = response.extensions.map((e) => `.${e}`).join(",")
accept.value = response.extensions
.map((extension) => `.${extension}`)
.join(",")
toggle_loading()
}

Expand All @@ -58,7 +64,12 @@
<FetchingData v-if="loading" />
<FileUploader
v-else
v-bind="{ multiple, accept, files: internal_files, auto_upload }"
v-bind="{
multiple,
accept,
files: internal_files,
auto_upload: internal_auto_upload,
}"
@files_uploaded="files_uploaded_event"
/>
</template>
47 changes: 15 additions & 32 deletions app/components/FileUploader.vue
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<script setup>
import DragAndDrop from "@ogw_front/components/DragAndDrop"
import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
import { upload_file } from "@ogw_front/utils/upload_file"
import DragAndDrop from "@ogw_front/components/DragAndDrop"
const schema = schemas.opengeodeweb_back.upload_file
const emit = defineEmits(["files_uploaded", "decrement_step", "reset_values"])
const props = defineProps({
const { multiple, accept, files, auto_upload, mini } = defineProps({
multiple: { type: Boolean, required: true },
accept: { type: String, required: true },
files: { type: Array, required: false, default: [] },
auto_upload: { type: Boolean, required: false, default: false },
mini: { type: Boolean, required: false, default: false },
})
const internal_files = ref(props.files)
const internal_files = ref(files)
const loading = ref(false)
const files_uploaded = ref(false)
const toggle_loading = useToggle(loading)
function processSelectedFiles(files) {
if (props.multiple) {
if (multiple) {
internal_files.value = [...internal_files.value, ...files]
} else {
internal_files.value = [files[0]]
Expand All @@ -39,42 +39,25 @@
async function upload_files() {
toggle_loading()
var promise_array = []
for (const file of internal_files.value) {
const promise = new Promise((resolve, reject) => {
upload_file(
{ route: schema.$id, file },
{
request_error_function: () => {
reject()
},
response_function: () => {
resolve()
},
response_error_function: () => {
reject()
},
},
)
})
promise_array.push(promise)
}
const promise_array = internal_files.value.map((file) =>
upload_file({ route: schema.$id, file }),
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Supprime l'enrobagee des promesses redondantes puisque upload_file en retourne déjà une.
.map() et Promise.all rend le traitement des fichiers asynchrone et élimine la gestion manuelle des réussites/échecs dans une boucle

await Promise.all(promise_array)
files_uploaded.value = true
emit("files_uploaded", internal_files.value)
toggle_loading()
}
if (props.files.length) {
internal_files.value = props.files
if (props.auto_upload) {
if (files.length > 0) {
internal_files.value = files
if (auto_upload) {
upload_files()
}
}
watch(
() => props.files,
() => files,
(newVal) => {
internal_files.value = newVal
},
Expand All @@ -83,16 +66,16 @@
watch(internal_files, (value) => {
files_uploaded.value = false
if (props.auto_upload && value.length > 0) {
if (auto_upload && value.length > 0) {
upload_files()
}
})
</script>

<template>
<DragAndDrop
:multiple="props.multiple"
:accept="props.accept"
:multiple="multiple"
:accept="accept"
:loading="loading"
:show-extensions="false"
@files-selected="processSelectedFiles"
Expand Down Expand Up @@ -124,7 +107,7 @@
</v-sheet>
</v-card-text>

<v-card-actions v-if="!props.auto_upload && internal_files.length">
<v-card-actions v-if="!auto_upload && internal_files.length > 0">
<v-btn
color="primary"
variant="elevated"
Expand Down
Loading
Loading