@geode/opengeodeweb-front 10.3.0 → 10.3.1

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.
Files changed (178) hide show
  1. package/.eslintrc.cjs +1 -0
  2. package/app/assets/geode_objects.js +1 -3
  3. package/app/components/Carousel.vue +7 -4
  4. package/app/components/CrsSelector.vue +5 -6
  5. package/app/components/DragAndDrop.vue +18 -8
  6. package/app/components/ExtensionSelector.vue +9 -17
  7. package/app/components/FeedBack/ErrorBanner.vue +1 -1
  8. package/app/components/FeedBack/Snackers.vue +4 -1
  9. package/app/components/FileSelector.vue +21 -10
  10. package/app/components/FileUploader.vue +15 -32
  11. package/app/components/HybridRenderingView.vue +5 -3
  12. package/app/components/Inspector/InspectionButton.vue +2 -2
  13. package/app/components/Inspector/ResultPanel.vue +4 -4
  14. package/app/components/Launcher.vue +1 -1
  15. package/app/components/Loading.vue +6 -6
  16. package/app/components/MissingFilesSelector.vue +23 -29
  17. package/app/components/ObjectSelector.vue +11 -10
  18. package/app/components/OptionCard.vue +1 -1
  19. package/app/components/PackagesVersions.vue +5 -3
  20. package/app/components/Recaptcha.vue +6 -4
  21. package/app/components/RemoteRenderingView.vue +4 -3
  22. package/app/components/Screenshot.vue +4 -4
  23. package/app/components/Step.vue +7 -7
  24. package/app/components/VeaseViewToolbar.vue +3 -3
  25. package/app/components/Viewer/BreadCrumb.vue +2 -4
  26. package/app/components/Viewer/ContextMenu.vue +77 -45
  27. package/app/components/Viewer/ContextMenuItem.vue +42 -33
  28. package/app/components/Viewer/EdgedCurve/PointsOptions.vue +3 -3
  29. package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +5 -5
  30. package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +6 -6
  31. package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +5 -5
  32. package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +5 -5
  33. package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +6 -7
  34. package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +6 -6
  35. package/app/components/Viewer/Generic/Model/EdgesOptions.vue +3 -3
  36. package/app/components/Viewer/Generic/Model/PointsOptions.vue +4 -4
  37. package/app/components/Viewer/Grid/2D/CellsOptions.vue +3 -3
  38. package/app/components/Viewer/Grid/2D/EdgesOptions.vue +3 -3
  39. package/app/components/Viewer/Grid/2D/PointsOptions.vue +3 -3
  40. package/app/components/Viewer/Grid/3D/CellsOptions.vue +3 -3
  41. package/app/components/Viewer/Grid/3D/EdgesOptions.vue +3 -3
  42. package/app/components/Viewer/Grid/3D/FacetsOptions.vue +3 -3
  43. package/app/components/Viewer/Grid/3D/PointsOptions.vue +3 -3
  44. package/app/components/Viewer/HybridSolid/EdgesOptions.vue +3 -3
  45. package/app/components/Viewer/HybridSolid/PointsOptions.vue +3 -3
  46. package/app/components/Viewer/HybridSolid/PolygonsOptions.vue +3 -3
  47. package/app/components/Viewer/HybridSolid/PolyhedraOptions.vue +3 -3
  48. package/app/components/Viewer/Options/CellAttributeSelector.vue +23 -20
  49. package/app/components/Viewer/Options/ColorMapList.vue +75 -50
  50. package/app/components/Viewer/Options/ColorMapPicker.vue +38 -32
  51. package/app/components/Viewer/Options/ColorPicker.vue +3 -3
  52. package/app/components/Viewer/Options/ColoringTypeSelector.vue +29 -21
  53. package/app/components/Viewer/Options/EdgeAttributeSelector.vue +7 -7
  54. package/app/components/Viewer/Options/PolygonAttributeSelector.vue +7 -7
  55. package/app/components/Viewer/Options/PolyhedronAttributeSelector.vue +7 -7
  56. package/app/components/Viewer/Options/TextureItem.vue +5 -5
  57. package/app/components/Viewer/Options/TexturesSelector.vue +5 -5
  58. package/app/components/Viewer/Options/VertexAttributeSelector.vue +7 -7
  59. package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +5 -5
  60. package/app/components/Viewer/PolygonalSurface/EdgesOptions.vue +3 -3
  61. package/app/components/Viewer/PolygonalSurface/PointsOptions.vue +3 -3
  62. package/app/components/Viewer/PolygonalSurface/SpecificPolygonsOptions.vue +6 -6
  63. package/app/components/Viewer/Solid/EdgesOptions.vue +3 -3
  64. package/app/components/Viewer/Solid/PointsOptions.vue +3 -3
  65. package/app/components/Viewer/Solid/PolygonsOptions.vue +3 -3
  66. package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +6 -6
  67. package/app/components/Viewer/TetrahedralSolid/TetrahedraOptions.vue +3 -3
  68. package/app/components/Viewer/TetrahedralSolid/TrianglesOptions.vue +3 -3
  69. package/app/components/Viewer/Tree/ObjectTree.vue +7 -9
  70. package/app/components/Viewer/TreeComponent.vue +9 -13
  71. package/app/components/Viewer/TreeObject.vue +8 -9
  72. package/app/components/Viewer/TriangulatedSurface/EdgesOptions.vue +3 -3
  73. package/app/components/Viewer/TriangulatedSurface/PointsOptions.vue +3 -3
  74. package/app/components/Viewer/TriangulatedSurface/TrianglesOptions.vue +3 -3
  75. package/app/components/Wrapper.vue +1 -2
  76. package/app/components/ZScaling.vue +1 -1
  77. package/app/composables/project_manager.js +6 -6
  78. package/app/plugins/auto_store_register.js +1 -1
  79. package/app/stores/app.js +45 -41
  80. package/app/stores/data.js +52 -51
  81. package/app/stores/data_style.js +12 -11
  82. package/app/stores/feedback.js +5 -1
  83. package/app/stores/geode.js +16 -13
  84. package/app/stores/hybrid_viewer.js +72 -44
  85. package/app/stores/infra.js +18 -16
  86. package/app/stores/lambda.js +1 -9
  87. package/app/stores/menu.js +13 -13
  88. package/app/stores/treeview.js +15 -13
  89. package/app/stores/viewer.js +39 -33
  90. package/app/utils/app_mode.js +4 -3
  91. package/app/utils/default_styles.js +55 -47
  92. package/app/utils/file_import_workflow.js +4 -17
  93. package/app/utils/local.js +195 -184
  94. package/app/utils/upload_file.js +1 -2
  95. package/eslint.config.js +2 -2
  96. package/internal/database/database.js +17 -32
  97. package/internal/database/extended_database.js +25 -0
  98. package/internal/stores/data_style/mesh/cells/cell.js +3 -3
  99. package/internal/stores/data_style/mesh/cells/color.js +1 -1
  100. package/internal/stores/data_style/mesh/cells/index.js +7 -7
  101. package/internal/stores/data_style/mesh/cells/textures.js +1 -1
  102. package/internal/stores/data_style/mesh/cells/vertex.js +3 -3
  103. package/internal/stores/data_style/mesh/cells/visibility.js +1 -1
  104. package/internal/stores/data_style/mesh/edges/color.js +1 -1
  105. package/internal/stores/data_style/mesh/edges/edge.js +22 -22
  106. package/internal/stores/data_style/mesh/edges/index.js +7 -7
  107. package/internal/stores/data_style/mesh/edges/vertex.js +3 -3
  108. package/internal/stores/data_style/mesh/edges/visibility.js +1 -1
  109. package/internal/stores/data_style/mesh/edges/width.js +1 -1
  110. package/internal/stores/data_style/mesh/index.js +4 -5
  111. package/internal/stores/data_style/mesh/points/color.js +1 -1
  112. package/internal/stores/data_style/mesh/points/index.js +6 -6
  113. package/internal/stores/data_style/mesh/points/size.js +1 -1
  114. package/internal/stores/data_style/mesh/points/vertex.js +3 -3
  115. package/internal/stores/data_style/mesh/points/visibility.js +1 -1
  116. package/internal/stores/data_style/mesh/polygons/color.js +1 -1
  117. package/internal/stores/data_style/mesh/polygons/index.js +7 -7
  118. package/internal/stores/data_style/mesh/polygons/polygon.js +3 -3
  119. package/internal/stores/data_style/mesh/polygons/textures.js +1 -1
  120. package/internal/stores/data_style/mesh/polygons/vertex.js +3 -3
  121. package/internal/stores/data_style/mesh/polygons/visibility.js +1 -1
  122. package/internal/stores/data_style/mesh/polyhedra/color.js +1 -1
  123. package/internal/stores/data_style/mesh/polyhedra/index.js +6 -6
  124. package/internal/stores/data_style/mesh/polyhedra/polyhedron.js +3 -3
  125. package/internal/stores/data_style/mesh/polyhedra/vertex.js +3 -3
  126. package/internal/stores/data_style/mesh/polyhedra/visibility.js +1 -1
  127. package/internal/stores/data_style/model/edges.js +1 -1
  128. package/internal/stores/data_style/model/index.js +32 -22
  129. package/internal/utils/api_fetch.js +8 -5
  130. package/internal/utils/viewer_call.js +42 -46
  131. package/nuxt.config.js +3 -3
  132. package/package.json +1 -1
  133. package/scripts/generate_geode_objects.js +8 -7
  134. package/tests/integration/setup.js +28 -21
  135. package/tests/integration/stores/data_style/mesh/cells.nuxt.test.js +18 -10
  136. package/tests/integration/stores/data_style/mesh/edges.nuxt.test.js +18 -10
  137. package/tests/integration/stores/data_style/mesh/index.nuxt.test.js +9 -5
  138. package/tests/integration/stores/data_style/mesh/points.nuxt.test.js +17 -10
  139. package/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js +18 -10
  140. package/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js +18 -10
  141. package/tests/integration/stores/data_style/model/blocks.nuxt.test.js +10 -6
  142. package/tests/integration/stores/data_style/model/corners.nuxt.test.js +10 -6
  143. package/tests/integration/stores/data_style/model/edges.nuxt.test.js +9 -5
  144. package/tests/integration/stores/data_style/model/index.nuxt.test.js +9 -5
  145. package/tests/integration/stores/data_style/model/lines.nuxt.test.js +10 -6
  146. package/tests/integration/stores/data_style/model/points.nuxt.test.js +9 -5
  147. package/tests/integration/stores/data_style/model/surfaces.nuxt.test.js +10 -6
  148. package/tests/integration/stores/viewer.nuxt.test.js +55 -39
  149. package/tests/setup_indexeddb.js +1 -0
  150. package/tests/unit/components/CrsSelector.nuxt.test.js +18 -19
  151. package/tests/unit/components/ExtensionSelector.nuxt.test.js +24 -19
  152. package/tests/unit/components/FeedBack/ErrorsBanner.nuxt.test.js +23 -36
  153. package/tests/unit/components/FeedBack/Snackers.nuxt.test.js +20 -25
  154. package/tests/unit/components/FileSelector.nuxt.test.js +27 -27
  155. package/tests/unit/components/FileUploader.nuxt.test.js +18 -17
  156. package/tests/unit/components/Inspector/InspectionButton.nuxt.test.js +9 -16
  157. package/tests/unit/components/Inspector/ResultPanel.nuxt.test.js +8 -6
  158. package/tests/unit/components/Launcher.nuxt.test.js +12 -17
  159. package/tests/unit/components/MissingFilesSelector.nuxt.test.js +16 -19
  160. package/tests/unit/components/ObjectSelector.nuxt.test.js +30 -34
  161. package/tests/unit/components/PackagesVersions.nuxt.test.js +8 -11
  162. package/tests/unit/components/Step.nuxt.test.js +8 -7
  163. package/tests/unit/components/Stepper.nuxt.test.js +14 -12
  164. package/tests/unit/composables/ProjectManager.nuxt.test.js +142 -100
  165. package/tests/unit/composables/api_fetch.nuxt.test.js +12 -39
  166. package/tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js +36 -61
  167. package/tests/unit/composables/upload_file.nuxt.test.js +21 -25
  168. package/tests/unit/plugins/project_load.nuxt.test.js +22 -21
  169. package/tests/unit/stores/App.nuxt.test.js +45 -43
  170. package/tests/unit/stores/Feedback.nuxt.test.js +16 -18
  171. package/tests/unit/stores/Geode.nuxt.test.js +135 -137
  172. package/tests/unit/stores/Infra.nuxt.test.js +20 -26
  173. package/tests/unit/stores/Lambda.nuxt.test.js +30 -31
  174. package/tests/unit/stores/Treeview.nuxt.test.js +53 -55
  175. package/tests/unit/stores/Viewer.nuxt.test.js +16 -23
  176. package/tests/unit/utils/validate_schema.nuxt.test.js +18 -18
  177. package/tests/utils.js +15 -2
  178. package/tests/vitest.config.js +6 -2
package/.eslintrc.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ // oxlint-disable-next-line import/no-commonjs
1
2
  module.exports = {
2
3
  root: true,
3
4
  env: {
@@ -24,7 +24,7 @@ import TriangulatedSurface2D from "@ogw_front/assets/img/geode_objects/Triangula
24
24
  import TriangulatedSurface3D from "@ogw_front/assets/img/geode_objects/TriangulatedSurface3D.svg"
25
25
  import VertexSet from "@ogw_front/assets/img/geode_objects/VertexSet.svg"
26
26
 
27
- const geode_objects = {
27
+ export const geode_objects = {
28
28
  BRep: {
29
29
  tooltip: "BRep",
30
30
  image: BRep,
@@ -126,5 +126,3 @@ const geode_objects = {
126
126
  image: VertexSet,
127
127
  },
128
128
  }
129
-
130
- export default geode_objects
@@ -1,14 +1,17 @@
1
1
  <script setup>
2
+ // oxlint-disable-next-line import/no-unassigned-import
2
3
  import "vue3-carousel/dist/carousel.css"
3
- import { Carousel, Slide, Navigation, Pagination } from "vue3-carousel"
4
+ import { Carousel, Navigation, Pagination, Slide } from "vue3-carousel"
4
5
  import { useDisplay } from "vuetify"
5
6
 
6
- const props = defineProps({
7
+ const NB_ITEMS_TO_DISPLAY = 3
8
+
9
+ const { items } = defineProps({
7
10
  items: { type: Array, required: true },
8
11
  })
9
12
 
10
13
  const { name } = useDisplay()
11
- const nb_items_to_display = ref(3)
14
+ const nb_items_to_display = ref(NB_ITEMS_TO_DISPLAY)
12
15
  watch(
13
16
  name,
14
17
  (value) => {
@@ -46,7 +49,7 @@
46
49
  <ClientOnly>
47
50
  <Carousel :settings="carrousel_settings">
48
51
  <Slide
49
- v-for="(item, index) in props.items"
52
+ v-for="(item, index) in items"
50
53
  :key="index"
51
54
  class="carousel__slide"
52
55
  >
@@ -1,21 +1,20 @@
1
1
  <script setup>
2
2
  import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
3
- const schema = schemas.opengeodeweb_back.geographic_coordinate_systems
4
3
  import { useGeodeStore } from "@ogw_front/stores/geode"
5
4
 
5
+ const schema = schemas.opengeodeweb_back.geographic_coordinate_systems
6
+
6
7
  const emit = defineEmits([
7
8
  "update_values",
8
9
  "increment_step",
9
10
  "decrement_step",
10
11
  ])
11
12
 
12
- const props = defineProps({
13
+ const { geode_object_type, key_to_update } = defineProps({
13
14
  geode_object_type: { type: String, required: true },
14
15
  key_to_update: { type: String, required: true },
15
16
  })
16
17
 
17
- const { geode_object_type, key_to_update } = props
18
-
19
18
  const search = ref("")
20
19
  const data_table_loading = ref(false)
21
20
  const crs_list = ref([])
@@ -33,8 +32,8 @@
33
32
  })
34
33
 
35
34
  function get_selected_crs(crs_code) {
36
- for (let i = 0; i <= crs_list.value.length; i++) {
37
- if (crs_list.value[i]["code"] == crs_code) {
35
+ for (let i = 0; i <= crs_list.value.length; i += 1) {
36
+ if (crs_list.value[i]["code"] === crs_code) {
38
37
  return crs_list.value[i]
39
38
  }
40
39
  }
@@ -1,5 +1,13 @@
1
1
  <script setup>
2
- const props = defineProps({
2
+ const {
3
+ multiple,
4
+ accept,
5
+ loading,
6
+ showExtensions,
7
+ idleText,
8
+ dropText,
9
+ loadingText,
10
+ } = defineProps({
3
11
  multiple: { type: Boolean, default: false },
4
12
  accept: { type: String, default: "" },
5
13
  loading: { type: Boolean, default: false },
@@ -12,20 +20,22 @@
12
20
  const emit = defineEmits(["files-selected"])
13
21
 
14
22
  const isDragging = ref(false)
15
- const fileInput = ref(null)
23
+ const fileInput = ref(undefined)
16
24
 
17
- const triggerFileDialog = () => fileInput.value?.click()
25
+ function triggerFileDialog() {
26
+ fileInput.value?.click()
27
+ }
18
28
 
19
- function handleDrop(e) {
29
+ function handleDrop(event) {
20
30
  isDragging.value = false
21
- const files = Array.from(e.dataTransfer.files)
31
+ const files = [...event.dataTransfer.files]
22
32
  emit("files-selected", files)
23
33
  }
24
34
 
25
- function handleFileSelect(e) {
26
- const files = Array.from(e.target.files)
35
+ function handleFileSelect(event) {
36
+ const files = [...event.target.files]
27
37
  emit("files-selected", files)
28
- e.target.value = ""
38
+ event.target.value = ""
29
39
  }
30
40
  </script>
31
41
 
@@ -11,11 +11,10 @@
11
11
  "decrement_step",
12
12
  ])
13
13
 
14
- const props = defineProps({
14
+ const { geode_object_type, filenames } = defineProps({
15
15
  geode_object_type: { type: String, required: true },
16
16
  filenames: { type: Array, required: true },
17
17
  })
18
- const { geode_object_type, filenames } = props
19
18
  const geode_objects_and_output_extensions = ref({})
20
19
  const loading = ref(false)
21
20
 
@@ -25,27 +24,20 @@
25
24
  toggle_loading()
26
25
  geode_objects_and_output_extensions.value = {}
27
26
  const geodeStore = useGeodeStore()
28
- const promise_array = filenames.map((filename) => {
29
- return new Promise((resolve, reject) => {
30
- const params = {
27
+ const values = await Promise.all(
28
+ filenames.map(async (filename) => {
29
+ const response = await geodeStore.request(schema, {
31
30
  geode_object_type,
32
31
  filename,
33
- }
34
- geodeStore.request(schema, params, {
35
- request_error_function: () => reject(),
36
- response_function: (response) => {
37
- resolve(response.geode_objects_and_output_extensions)
38
- },
39
- response_error_function: () => reject(),
40
32
  })
41
- })
42
- })
43
- const values = await Promise.all(promise_array)
33
+ return response.geode_objects_and_output_extensions
34
+ }),
35
+ )
44
36
  const all_keys = [...new Set(values.flatMap((value) => Object.keys(value)))]
45
37
  const common_keys = all_keys.filter(
46
38
  (i) => !values.some((j) => !Object.keys(j).includes(i)),
47
39
  )
48
- var final_object = {}
40
+ const final_object = {}
49
41
  for (const key of common_keys) {
50
42
  final_object[key] = {}
51
43
  for (const value of values) {
@@ -61,7 +53,7 @@
61
53
  }
62
54
 
63
55
  function update_values(output_geode_object, output_extension) {
64
- if (output_geode_object != "" && output_extension != "") {
56
+ if (output_geode_object !== "" && output_extension !== "") {
65
57
  emit("update_values", {
66
58
  output_geode_object,
67
59
  output_extension,
@@ -3,7 +3,7 @@
3
3
  const feedbackStore = useFeedbackStore()
4
4
 
5
5
  function reload() {
6
- window.location.reload()
6
+ globalThis.location.reload()
7
7
  }
8
8
  </script>
9
9
 
@@ -1,11 +1,14 @@
1
1
  <script setup>
2
2
  import { useFeedbackStore } from "@ogw_front/stores/feedback"
3
3
 
4
+ const MARGIN_BETWEEN_SNACKERS = 60
5
+ const FIRST_SNACKER_MARGIN = 8
6
+
4
7
  const feedbackStore = useFeedbackStore()
5
8
  const show = ref(true)
6
9
 
7
10
  function calc_margin(index) {
8
- return index * 60 + 8 + "px"
11
+ return `${index * MARGIN_BETWEEN_SNACKERS + FIRST_SNACKER_MARGIN}px`
9
12
  }
10
13
  </script>
11
14
 
@@ -13,31 +13,35 @@
13
13
  "decrement_step",
14
14
  ])
15
15
 
16
- const props = defineProps({
16
+ const { multiple, files, auto_upload } = defineProps({
17
17
  multiple: { type: Boolean, required: true },
18
18
  files: { type: Array, default: () => [] },
19
19
  auto_upload: { type: Boolean, default: true },
20
20
  })
21
21
 
22
- const internal_files = ref(props.files)
23
- const auto_upload = ref(props.auto_upload)
22
+ const internal_files = ref(files)
23
+ const internal_auto_upload = ref(auto_upload)
24
24
  const accept = ref("")
25
25
  const loading = ref(false)
26
26
 
27
27
  watch(
28
- () => props.files,
29
- (val) => (internal_files.value = val),
28
+ () => files,
29
+ (val) => {
30
+ internal_files.value = val
31
+ },
30
32
  )
31
33
 
32
34
  watch(
33
- () => props.auto_upload,
34
- (val) => (auto_upload.value = val),
35
+ () => auto_upload,
36
+ (val) => {
37
+ internal_auto_upload.value = val
38
+ },
35
39
  )
36
40
 
37
41
  const toggle_loading = useToggle(loading)
38
42
 
39
43
  function files_uploaded_event(value) {
40
- if (value.length) {
44
+ if (value.length > 0) {
41
45
  emit("update_values", { files: value, auto_upload: false })
42
46
  emit("increment_step")
43
47
  }
@@ -47,7 +51,9 @@
47
51
  toggle_loading()
48
52
  const geodeStore = useGeodeStore()
49
53
  const response = await geodeStore.request(schema, {})
50
- accept.value = response.extensions.map((e) => `.${e}`).join(",")
54
+ accept.value = response.extensions
55
+ .map((extension) => `.${extension}`)
56
+ .join(",")
51
57
  toggle_loading()
52
58
  }
53
59
 
@@ -58,7 +64,12 @@
58
64
  <FetchingData v-if="loading" />
59
65
  <FileUploader
60
66
  v-else
61
- v-bind="{ multiple, accept, files: internal_files, auto_upload }"
67
+ v-bind="{
68
+ multiple,
69
+ accept,
70
+ files: internal_files,
71
+ auto_upload: internal_auto_upload,
72
+ }"
62
73
  @files_uploaded="files_uploaded_event"
63
74
  />
64
75
  </template>
@@ -1,13 +1,13 @@
1
1
  <script setup>
2
+ import DragAndDrop from "@ogw_front/components/DragAndDrop"
2
3
  import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
3
4
  import { upload_file } from "@ogw_front/utils/upload_file"
4
- import DragAndDrop from "@ogw_front/components/DragAndDrop"
5
5
 
6
6
  const schema = schemas.opengeodeweb_back.upload_file
7
7
 
8
8
  const emit = defineEmits(["files_uploaded", "decrement_step", "reset_values"])
9
9
 
10
- const props = defineProps({
10
+ const { multiple, accept, files, auto_upload, mini } = defineProps({
11
11
  multiple: { type: Boolean, required: true },
12
12
  accept: { type: String, required: true },
13
13
  files: { type: Array, required: false, default: [] },
@@ -15,14 +15,14 @@
15
15
  mini: { type: Boolean, required: false, default: false },
16
16
  })
17
17
 
18
- const internal_files = ref(props.files)
18
+ const internal_files = ref(files)
19
19
  const loading = ref(false)
20
20
  const files_uploaded = ref(false)
21
21
 
22
22
  const toggle_loading = useToggle(loading)
23
23
 
24
24
  function processSelectedFiles(files) {
25
- if (props.multiple) {
25
+ if (multiple) {
26
26
  internal_files.value = [...internal_files.value, ...files]
27
27
  } else {
28
28
  internal_files.value = [files[0]]
@@ -39,26 +39,9 @@
39
39
 
40
40
  async function upload_files() {
41
41
  toggle_loading()
42
- var promise_array = []
43
- for (const file of internal_files.value) {
44
- const promise = new Promise((resolve, reject) => {
45
- upload_file(
46
- { route: schema.$id, file },
47
- {
48
- request_error_function: () => {
49
- reject()
50
- },
51
- response_function: () => {
52
- resolve()
53
- },
54
- response_error_function: () => {
55
- reject()
56
- },
57
- },
58
- )
59
- })
60
- promise_array.push(promise)
61
- }
42
+ const promise_array = internal_files.value.map((file) =>
43
+ upload_file({ route: schema.$id, file }),
44
+ )
62
45
  await Promise.all(promise_array)
63
46
  files_uploaded.value = true
64
47
  emit("files_uploaded", internal_files.value)
@@ -66,15 +49,15 @@
66
49
  toggle_loading()
67
50
  }
68
51
 
69
- if (props.files.length) {
70
- internal_files.value = props.files
71
- if (props.auto_upload) {
52
+ if (files.length > 0) {
53
+ internal_files.value = files
54
+ if (auto_upload) {
72
55
  upload_files()
73
56
  }
74
57
  }
75
58
 
76
59
  watch(
77
- () => props.files,
60
+ () => files,
78
61
  (newVal) => {
79
62
  internal_files.value = newVal
80
63
  },
@@ -83,7 +66,7 @@
83
66
 
84
67
  watch(internal_files, (value) => {
85
68
  files_uploaded.value = false
86
- if (props.auto_upload && value.length > 0) {
69
+ if (auto_upload && value.length > 0) {
87
70
  upload_files()
88
71
  }
89
72
  })
@@ -91,8 +74,8 @@
91
74
 
92
75
  <template>
93
76
  <DragAndDrop
94
- :multiple="props.multiple"
95
- :accept="props.accept"
77
+ :multiple="multiple"
78
+ :accept="accept"
96
79
  :loading="loading"
97
80
  :show-extensions="false"
98
81
  @files-selected="processSelectedFiles"
@@ -124,7 +107,7 @@
124
107
  </v-sheet>
125
108
  </v-card-text>
126
109
 
127
- <v-card-actions v-if="!props.auto_upload && internal_files.length">
110
+ <v-card-actions v-if="!auto_upload && internal_files.length > 0">
128
111
  <v-btn
129
112
  color="primary"
130
113
  variant="elevated"
@@ -4,6 +4,8 @@
4
4
  import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer"
5
5
  import { useViewerStore } from "@ogw_front/stores/viewer"
6
6
 
7
+ const DEFAULT_ELEMENT_HEIGHT = 100
8
+
7
9
  const emit = defineEmits(["click"])
8
10
 
9
11
  const container = useTemplateRef("viewer")
@@ -16,7 +18,7 @@
16
18
 
17
19
  const debouncedResize = debounce(() => {
18
20
  hybridViewerStore.resize(elementWidth.value, elementHeight.value)
19
- }, 100)
21
+ }, DEFAULT_ELEMENT_HEIGHT)
20
22
 
21
23
  watch([elementWidth, elementHeight, windowWidth, windowHeight], (value) => {
22
24
  debouncedResize()
@@ -32,9 +34,9 @@
32
34
  })
33
35
 
34
36
  function debounce(func, wait) {
35
- let timeout
37
+ let timeout = undefined
36
38
  return function executedFunction(...args) {
37
- const later = () => {
39
+ function later() {
38
40
  clearTimeout(timeout)
39
41
  func(...args)
40
42
  }
@@ -8,7 +8,7 @@
8
8
  "increment_step",
9
9
  "decrement_step",
10
10
  ])
11
- const props = defineProps({
11
+ const { geode_object_type, filename } = defineProps({
12
12
  geode_object_type: { type: String, required: true },
13
13
  filename: { type: String, required: true },
14
14
  })
@@ -37,7 +37,7 @@
37
37
  <v-btn
38
38
  :loading="loading"
39
39
  color="primary"
40
- @click="get_inspection_results(props.geode_object_type, props.filename)"
40
+ @click="get_inspection_results(geode_object_type, filename)"
41
41
  >
42
42
  Inspect
43
43
  <template #loader>
@@ -1,13 +1,13 @@
1
1
  <script setup>
2
2
  import InspectorResultPanel from "@ogw_front/components/Inspector/ResultPanel"
3
3
 
4
- const props = defineProps({
4
+ const { inspection_result } = defineProps({
5
5
  inspection_result: { type: Array, required: true },
6
6
  })
7
7
  const opened_panels = ref([])
8
8
 
9
- onMounted(async () => {
10
- opened_panels.value = props.inspection_result
9
+ onMounted(() => {
10
+ opened_panels.value = inspection_result
11
11
  .map((result, i) => (result.nb_issues > 0 ? i : -1))
12
12
  .filter((index) => index !== -1)
13
13
  })
@@ -17,7 +17,7 @@
17
17
  <v-container class="pa-2">
18
18
  <v-expansion-panels v-model="opened_panels" multiple elevation="5">
19
19
  <v-expansion-panel
20
- v-for="(result, index) in props.inspection_result"
20
+ v-for="(result, index) in inspection_result"
21
21
  :key="index"
22
22
  class="card"
23
23
  >
@@ -1,7 +1,7 @@
1
1
  <script setup>
2
- import Status from "@ogw_front/utils/status"
3
2
  import Loading from "@ogw_front/components/Loading"
4
3
  import Recaptcha from "@ogw_front/components/Recaptcha"
4
+ import Status from "@ogw_front/utils/status"
5
5
  import { useInfraStore } from "@ogw_front/stores/infra"
6
6
 
7
7
  const infraStore = useInfraStore()
@@ -1,15 +1,15 @@
1
1
  <script setup>
2
- import ying_yang from "@ogw_front/assets/img/energy_sobriety/ying_yang.png"
3
2
  import chemin from "@ogw_front/assets/img/energy_sobriety/chemin.png"
4
- import vert from "@ogw_front/assets/img/energy_sobriety/vert.png"
5
- import lampadaire from "@ogw_front/assets/img/energy_sobriety/lampadaire.png"
6
3
  import collegue from "@ogw_front/assets/img/energy_sobriety/collegue.png"
7
- import sobene from "@ogw_front/assets/img/energy_sobriety/sobene.png"
4
+ import derniere from "@ogw_front/assets/img/energy_sobriety/derniere.png"
8
5
  import etincelle from "@ogw_front/assets/img/energy_sobriety/etincelle.png"
9
6
  import geste from "@ogw_front/assets/img/energy_sobriety/geste.png"
10
- import socle from "@ogw_front/assets/img/energy_sobriety/socle.png"
11
- import derniere from "@ogw_front/assets/img/energy_sobriety/derniere.png"
7
+ import lampadaire from "@ogw_front/assets/img/energy_sobriety/lampadaire.png"
12
8
  import salon from "@ogw_front/assets/img/energy_sobriety/salon.png"
9
+ import sobene from "@ogw_front/assets/img/energy_sobriety/sobene.png"
10
+ import socle from "@ogw_front/assets/img/energy_sobriety/socle.png"
11
+ import vert from "@ogw_front/assets/img/energy_sobriety/vert.png"
12
+ import ying_yang from "@ogw_front/assets/img/energy_sobriety/ying_yang.png"
13
13
 
14
14
  import Carousel from "@ogw_front/components/Carousel"
15
15
 
@@ -13,14 +13,12 @@
13
13
  "decrement_step",
14
14
  ])
15
15
 
16
- const props = defineProps({
16
+ const { multiple, geode_object_type, filenames } = defineProps({
17
17
  multiple: { type: Boolean, required: true },
18
18
  geode_object_type: { type: String, required: true },
19
19
  filenames: { type: Array, required: true },
20
20
  })
21
21
 
22
- const { multiple, geode_object_type, filenames } = props
23
-
24
22
  const accept = ref("")
25
23
  const loading = ref(false)
26
24
  const has_missing_files = ref(false)
@@ -40,37 +38,33 @@
40
38
  additional_files.value = []
41
39
  const geodeStore = useGeodeStore()
42
40
 
43
- const promise_array = filenames.map((filename) => {
44
- const params = { geode_object_type, filename }
45
- return new Promise((resolve, reject) => {
46
- geodeStore.request(schema, params, {
47
- request_error_function: () => reject(),
48
- response_function: (response) => resolve(response),
49
- response_error_function: () => reject(),
50
- })
41
+ const promise_array = filenames.map(async (filename) => {
42
+ const response = await geodeStore.request(schema, {
43
+ geode_object_type,
44
+ filename,
51
45
  })
46
+ return response
52
47
  })
53
48
  const values = await Promise.all(promise_array)
54
49
  for (const value of values) {
55
- has_missing_files.value = value.has_missing_files
56
- ? true
57
- : has_missing_files.value
58
- mandatory_files.value = [].concat(
59
- mandatory_files.value,
60
- value.mandatory_files,
61
- )
62
- additional_files.value = [].concat(
63
- additional_files.value,
64
- value.additional_files,
65
- )
50
+ if (value.has_missing_files) {
51
+ has_missing_files.value = true
52
+ }
53
+ mandatory_files.value = [
54
+ ...mandatory_files.value,
55
+ ...value.mandatory_files,
56
+ ]
57
+ additional_files.value = [
58
+ ...additional_files.value,
59
+ ...value.additional_files,
60
+ ]
66
61
  }
67
- if (!has_missing_files.value) {
68
- emit("increment_step")
69
- } else {
70
- accept.value = []
71
- .concat(mandatory_files.value, additional_files.value)
72
- .map((filename) => "." + filename.split(".").pop())
62
+ if (has_missing_files.value) {
63
+ accept.value = [...mandatory_files.value, ...additional_files.value]
64
+ .map((filename) => `.${filename.split(".").pop()}`)
73
65
  .join(",")
66
+ } else {
67
+ emit("increment_step")
74
68
  }
75
69
  toggle_loading()
76
70
  }
@@ -113,7 +107,7 @@
113
107
  </v-row>
114
108
  <v-row>
115
109
  <v-col
116
- v-if="!mandatory_files.length && additional_files.length"
110
+ v-if="mandatory_files.length === 0 && additional_files.length > 0"
117
111
  cols="auto"
118
112
  >
119
113
  <v-btn @click="emit('increment_step')" color="warning">Skip step</v-btn>
@@ -1,20 +1,19 @@
1
1
  <script setup>
2
- import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
3
-
4
- import geode_objects from "@ogw_front/assets/geode_objects"
5
2
  import FetchingData from "@ogw_front/components/FetchingData.vue"
3
+ import { geode_objects } from "@ogw_front/assets/geode_objects"
4
+ import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
6
5
  import { useGeodeStore } from "@ogw_front/stores/geode"
7
6
 
8
7
  const schema = schemas.opengeodeweb_back.allowed_objects
9
8
 
10
9
  const emit = defineEmits(["update_values", "increment_step"])
11
10
  console.log("ObjectSelector")
12
- const props = defineProps({
11
+
12
+ const { filenames } = defineProps({
13
13
  filenames: { type: Array, required: true },
14
14
  })
15
15
 
16
16
  const geodeStore = useGeodeStore()
17
- const { filenames } = props
18
17
 
19
18
  const loading = ref(false)
20
19
  const allowed_objects = ref({})
@@ -61,11 +60,13 @@
61
60
  toggle_loading()
62
61
  allowed_objects.value = {}
63
62
 
64
- const promise_array = filenames.map((filename) => {
65
- return geodeStore.request(schema, { filename })
66
- })
63
+ const promise_array = filenames.map((filename) =>
64
+ geodeStore.request(schema, { filename }),
65
+ )
67
66
  const responses = await Promise.all(promise_array)
68
- const allowed_objects_list = responses.map((r) => r.allowed_objects)
67
+ const allowed_objects_list = responses.map(
68
+ (response) => response.allowed_objects,
69
+ )
69
70
  const all_keys = [...new Set(allowed_objects_list.flatMap(Object.keys))]
70
71
  const common_keys = all_keys.filter((key) =>
71
72
  allowed_objects_list.every((obj) => key in obj),
@@ -77,7 +78,7 @@
77
78
  )
78
79
  const priorities = allowed_objects_list
79
80
  .map((obj) => obj[key].object_priority)
80
- .filter((p) => p !== undefined && p !== null)
81
+ .filter((priority) => priority !== undefined && priority !== null)
81
82
  final_object[key] = { is_loadable: Math.min(...load_scores) }
82
83
  if (priorities.length) {
83
84
  final_object[key].object_priority = Math.max(...priorities)
@@ -4,7 +4,7 @@
4
4
  const theme = useTheme()
5
5
  const primaryColor = computed(() => theme.current.value.colors.primary)
6
6
 
7
- defineProps({
7
+ const { title, width, maxHeight } = defineProps({
8
8
  title: { type: String, default: "" },
9
9
  width: { type: [Number, String], default: 320 },
10
10
  maxHeight: { type: [Number, String], default: 500 },