@geode/opengeodeweb-front 6.2.1 → 6.3.0

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 (87) hide show
  1. package/.github/workflows/CD.yml +6 -0
  2. package/assets/geode_objects.js +46 -46
  3. package/assets/img/geode_objects/{section.svg → Section.svg} +1 -1
  4. package/components/Carousel.vue +1 -5
  5. package/components/CrsSelector.vue +6 -4
  6. package/components/ExtensionSelector.vue +78 -77
  7. package/components/FileSelector.vue +6 -7
  8. package/components/FileUploader.vue +7 -6
  9. package/components/MissingFilesSelector.vue +25 -23
  10. package/components/ObjectSelector.vue +24 -18
  11. package/components/PackagesVersions.vue +24 -23
  12. package/components/Wrapper.vue +1 -8
  13. package/composables/api_fetch.js +8 -10
  14. package/composables/runFunctionIfCloudRunning.js +1 -2
  15. package/composables/upload_file.js +4 -1
  16. package/nuxt.config.js +29 -1
  17. package/package.json +30 -14
  18. package/stores/cloud.js +19 -8
  19. package/stores/geode.js +7 -5
  20. package/test/components/CrsSelector.nuxt.test.js +54 -0
  21. package/test/components/ErrorsBanner.nuxt.test.js +46 -0
  22. package/test/components/ErrorsSnackers.nuxt.test.js +37 -0
  23. package/test/components/ExtensionSelector.nuxt.test.js +52 -0
  24. package/test/components/FileSelector.nuxt.test.js +60 -0
  25. package/test/components/FileUploader.nuxt.test.js +50 -0
  26. package/test/components/Launcher.nuxt.test.js +34 -0
  27. package/test/components/MissingFilesSelector.nuxt.test.js +67 -0
  28. package/test/components/ObjectSelector.nuxt.test.js +49 -0
  29. package/test/components/PackagesVersions.nuxt.test.js +45 -0
  30. package/test/components/Step.nuxt.test.js +58 -0
  31. package/test/components/Stepper.nuxt.test.js +58 -0
  32. package/test/components/Wrapper.nuxt.test.js +58 -0
  33. package/test/composables/api_fetch.nuxt.test.js +89 -0
  34. package/test/composables/runFunctionIfCloudRunning.nuxt.test.js +30 -0
  35. package/test/composables/upload_file.nuxt.test.js +51 -0
  36. package/test/stores/Cloud.nuxt.test.js +48 -0
  37. package/test/stores/Errors.test.js +36 -0
  38. package/test/stores/Geode.test.js +60 -0
  39. package/vitest.config.js +13 -0
  40. package/vuetify_config.js +22 -0
  41. package/assets/img/geode_objects/regular_grid.svg +0 -107
  42. package/assets/img/logos/LOGOMOSART-PME.png +0 -0
  43. package/assets/img/logos/logo-avenia.svg +0 -182
  44. package/assets/img/logos/logo_BSC.png +0 -0
  45. package/assets/img/logos/logo_DHI.png +0 -0
  46. package/assets/img/logos/logo_GSC.png +0 -0
  47. package/assets/img/logos/logo_NAOS.png +0 -0
  48. package/assets/img/logos/logo_UL.png +0 -0
  49. package/assets/img/logos/logo_arxitek.png +0 -0
  50. package/assets/img/logos/logo_banquiz.png +0 -0
  51. package/assets/img/logos/logo_cnrs.jpg +0 -0
  52. package/assets/img/logos/logo_earth_quick.jpg +0 -0
  53. package/assets/img/logos/logo_enerex.png +0 -0
  54. package/assets/img/logos/logo_geoliens.png +0 -0
  55. package/assets/img/logos/logo_georessources.jpg +0 -0
  56. package/assets/img/logos/logo_helioparc.svg +0 -182
  57. package/assets/img/logos/logo_pole_avenia.png +0 -0
  58. package/assets/img/logos/logo_region.png +0 -0
  59. package/assets/img/logos/logo_ring.png +0 -0
  60. package/assets/img/logos/logo_totalenergies.png +0 -0
  61. package/assets/schemas/CrsSelector.json +0 -12
  62. package/assets/schemas/ExtensionSelector.json +0 -15
  63. package/assets/schemas/FileSelector.json +0 -12
  64. package/assets/schemas/MissingFilesSelector.json +0 -15
  65. package/assets/schemas/ObjectSelector.json +0 -15
  66. package/components/Header.vue +0 -39
  67. /package/assets/img/geode_objects/{cross_section.svg → CrossSection.svg} +0 -0
  68. /package/assets/img/geode_objects/{edged_curve2d.svg → EdgedCurve2D.svg} +0 -0
  69. /package/assets/img/geode_objects/{edged_curve3d.svg → EdgedCurve3D.svg} +0 -0
  70. /package/assets/img/geode_objects/{edged_curve.svg → Graph.svg} +0 -0
  71. /package/assets/img/geode_objects/{hybrid_solid.svg → HybridSolid3D.svg} +0 -0
  72. /package/assets/img/geode_objects/{light_regular_grid2d.svg → LightRegularGrid2D.svg} +0 -0
  73. /package/assets/img/geode_objects/{light_regular_grid3d.svg → LightRegularGrid3D.svg} +0 -0
  74. /package/assets/img/geode_objects/{point_set2d.svg → PointSet2D.svg} +0 -0
  75. /package/assets/img/geode_objects/{point_set3d.svg → PointSet3D.svg} +0 -0
  76. /package/assets/img/geode_objects/{polygonal_surface2d.svg → PolygonalSurface2D.svg} +0 -0
  77. /package/assets/img/geode_objects/{polygonal_surface3d.svg → PolygonalSurface3D.svg} +0 -0
  78. /package/assets/img/geode_objects/{polyhedral_solid.svg → PolyhedralSolid3D.svg} +0 -0
  79. /package/assets/img/geode_objects/{raster_image2d.svg → RasterImage2D.svg} +0 -0
  80. /package/assets/img/geode_objects/{raster_image3d.svg → RasterImage3D.svg} +0 -0
  81. /package/assets/img/geode_objects/{regular_grid2d.svg → RegularGrid2D.svg} +0 -0
  82. /package/assets/img/geode_objects/{regular_grid3d.svg → RegularGrid3D.svg} +0 -0
  83. /package/assets/img/geode_objects/{structural_model.svg → StructuralModel.svg} +0 -0
  84. /package/assets/img/geode_objects/{tetrahedral_solid.svg → TetrahedralSolid3D.svg} +0 -0
  85. /package/assets/img/geode_objects/{triangulated_surface2d.svg → TriangulatedSurface2D.svg} +0 -0
  86. /package/assets/img/geode_objects/{triangulated_surface3d.svg → TriangulatedSurface3D.svg} +0 -0
  87. /package/assets/img/geode_objects/{vertex_set.svg → VertexSet.svg} +0 -0
@@ -7,6 +7,12 @@ jobs:
7
7
  build:
8
8
  runs-on: ubuntu-latest
9
9
  steps:
10
+ - name: Checkout
11
+ uses: actions/checkout@v3
12
+ - name: Unit tests
13
+ run: |
14
+ npm install
15
+ npm run test
10
16
  - uses: actions/checkout@v3
11
17
  - name: Semantic Release
12
18
  uses: cycjimmy/semantic-release-action@v3
@@ -1,119 +1,119 @@
1
- import brep from "@/assets/img/geode_objects/BRep.svg"
2
- import cross_section from "@/assets/img/geode_objects/cross_section.svg"
3
- import edged_curve2d from "@/assets/img/geode_objects/edged_curve2d.svg"
4
- import edged_curve3d from "@/assets/img/geode_objects/edged_curve3d.svg"
5
- import edged_curve from "@/assets/img/geode_objects/edged_curve.svg"
6
- import hybrid_solid from "@/assets/img/geode_objects/hybrid_solid.svg"
7
- import light_regular_grid2d from "@/assets/img/geode_objects/light_regular_grid2d.svg"
8
- import light_regular_grid3d from "@/assets/img/geode_objects/light_regular_grid3d.svg"
9
- import point_set2d from "@/assets/img/geode_objects/point_set2d.svg"
10
- import point_set3d from "@/assets/img/geode_objects/point_set3d.svg"
11
- import polygonal_surface2d from "@/assets/img/geode_objects/polygonal_surface2d.svg"
12
- import polygonal_surface3d from "@/assets/img/geode_objects/polygonal_surface3d.svg"
13
- import polyhedral_solid from "@/assets/img/geode_objects/polyhedral_solid.svg"
14
- import raster_image2d from "@/assets/img/geode_objects/raster_image2d.svg"
15
- import raster_image3d from "@/assets/img/geode_objects/raster_image3d.svg"
16
- import regular_grid2d from "@/assets/img/geode_objects/regular_grid2d.svg"
17
- import regular_grid3d from "@/assets/img/geode_objects/regular_grid3d.svg"
18
- import section from "@/assets/img/geode_objects/section.svg"
19
- import structural_model from "@/assets/img/geode_objects/structural_model.svg"
20
- import tetrahedral_solid from "@/assets/img/geode_objects/tetrahedral_solid.svg"
21
- import triangulated_surface2d from "@/assets/img/geode_objects/triangulated_surface2d.svg"
22
- import triangulated_surface3d from "@/assets/img/geode_objects/triangulated_surface3d.svg"
23
- import vertex_set from "@/assets/img/geode_objects/vertex_set.svg"
1
+ import BRep from "@/assets/img/geode_objects/BRep.svg"
2
+ import CrossSection from "@/assets/img/geode_objects/CrossSection.svg"
3
+ import EdgedCurve2D from "@/assets/img/geode_objects/EdgedCurve2D.svg"
4
+ import EdgedCurve3D from "@/assets/img/geode_objects/EdgedCurve3D.svg"
5
+ import Graph from "@/assets/img/geode_objects/Graph.svg"
6
+ import HybridSolid3D from "@/assets/img/geode_objects/HybridSolid3D.svg"
7
+ import LightRegularGrid2D from "@/assets/img/geode_objects/LightRegularGrid2D.svg"
8
+ import LightRegularGrid3D from "@/assets/img/geode_objects/LightRegularGrid3D.svg"
9
+ import PointSet2D from "@/assets/img/geode_objects/PointSet2D.svg"
10
+ import PointSet3D from "@/assets/img/geode_objects/PointSet3D.svg"
11
+ import PolygonalSurface2D from "@/assets/img/geode_objects/PolygonalSurface2D.svg"
12
+ import PolygonalSurface3D from "@/assets/img/geode_objects/PolygonalSurface3D.svg"
13
+ import PolyhedralSolid3D from "@/assets/img/geode_objects/PolyhedralSolid3D.svg"
14
+ import RasterImage2D from "@/assets/img/geode_objects/RasterImage2D.svg"
15
+ import RasterImage3D from "@/assets/img/geode_objects/RasterImage3D.svg"
16
+ import RegularGrid2D from "@/assets/img/geode_objects/RegularGrid2D.svg"
17
+ import RegularGrid3D from "@/assets/img/geode_objects/RegularGrid3D.svg"
18
+ import Section from "@/assets/img/geode_objects/Section.svg"
19
+ import StructuralModel from "@/assets/img/geode_objects/StructuralModel.svg"
20
+ import TetrahedralSolid3D from "@/assets/img/geode_objects/TetrahedralSolid3D.svg"
21
+ import TriangulatedSurface2D from "@/assets/img/geode_objects/TriangulatedSurface2D.svg"
22
+ import TriangulatedSurface3D from "@/assets/img/geode_objects/TriangulatedSurface3D.svg"
23
+ import VertexSet from "@/assets/img/geode_objects/VertexSet.svg"
24
24
 
25
25
  const geode_objects = {
26
26
  BRep: {
27
27
  tooltip: "BRep",
28
- image: brep,
28
+ image: BRep,
29
29
  },
30
30
  CrossSection: {
31
31
  tooltip: "CrossSection",
32
- image: cross_section,
32
+ image: CrossSection,
33
33
  },
34
34
  EdgedCurve2D: {
35
35
  tooltip: "EdgedCurve2D",
36
- image: edged_curve2d,
36
+ image: EdgedCurve2D,
37
37
  },
38
38
  EdgedCurve3D: {
39
39
  tooltip: "EdgedCurve3D",
40
- image: edged_curve3d,
40
+ image: EdgedCurve3D,
41
41
  },
42
42
  Graph: {
43
43
  tooltip: "Graph",
44
- image: edged_curve,
44
+ image: Graph,
45
45
  },
46
46
  HybridSolid3D: {
47
47
  tooltip: "HybridSolid3D",
48
- image: hybrid_solid,
48
+ image: HybridSolid3D,
49
49
  },
50
50
  LightRegularGrid2D: {
51
51
  tooltip: "LightRegularGrid2D",
52
- image: light_regular_grid2d,
52
+ image: LightRegularGrid2D,
53
53
  },
54
54
  LightRegularGrid3D: {
55
55
  tooltip: "LightRegularGrid3D",
56
- image: light_regular_grid3d,
56
+ image: LightRegularGrid3D,
57
57
  },
58
58
  PointSet2D: {
59
59
  tooltip: "PointSet2D",
60
- image: point_set2d,
60
+ image: PointSet2D,
61
61
  },
62
62
  PointSet3D: {
63
63
  tooltip: "PointSet3D",
64
- image: point_set3d,
64
+ image: PointSet3D,
65
65
  },
66
66
  PolygonalSurface2D: {
67
67
  tooltip: "PolygonalSurface2D",
68
- image: polygonal_surface2d,
68
+ image: PolygonalSurface2D,
69
69
  },
70
70
  PolygonalSurface3D: {
71
71
  tooltip: "PolygonalSurface3D",
72
- image: polygonal_surface3d,
72
+ image: PolygonalSurface3D,
73
73
  },
74
74
  PolyhedralSolid3D: {
75
75
  tooltip: "PolyhedralSolid3D",
76
- image: polyhedral_solid,
76
+ image: PolyhedralSolid3D,
77
77
  },
78
78
  RasterImage2D: {
79
79
  tooltip: "RasterImage2D",
80
- image: raster_image2d,
80
+ image: RasterImage2D,
81
81
  },
82
82
  RasterImage3D: {
83
83
  tooltip: "RasterImage3D",
84
- image: raster_image3d,
84
+ image: RasterImage3D,
85
85
  },
86
86
  RegularGrid2D: {
87
87
  tooltip: "RegularGrid2D",
88
- image: regular_grid2d,
88
+ image: RegularGrid2D,
89
89
  },
90
90
  RegularGrid3D: {
91
91
  tooltip: "RegularGrid3D",
92
- image: regular_grid3d,
92
+ image: RegularGrid3D,
93
93
  },
94
94
  Section: {
95
95
  tooltip: "Section",
96
- image: section,
96
+ image: Section,
97
97
  },
98
98
  StructuralModel: {
99
99
  tooltip: "StructuralModel",
100
- image: structural_model,
100
+ image: StructuralModel,
101
101
  },
102
102
  TetrahedralSolid3D: {
103
103
  tooltip: "TetrahedralSolid3D",
104
- image: tetrahedral_solid,
104
+ image: TetrahedralSolid3D,
105
105
  },
106
106
  TriangulatedSurface2D: {
107
107
  tooltip: "TriangulatedSurface2D",
108
- image: triangulated_surface2d,
108
+ image: TriangulatedSurface2D,
109
109
  },
110
110
  TriangulatedSurface3D: {
111
111
  tooltip: "TriangulatedSurface3D",
112
- image: triangulated_surface3d,
112
+ image: TriangulatedSurface3D,
113
113
  },
114
114
  VertexSet: {
115
115
  tooltip: "VertexSet",
116
- image: vertex_set,
116
+ image: VertexSet,
117
117
  },
118
118
  }
119
119
 
@@ -15,7 +15,7 @@
15
15
  id="svg2"
16
16
  version="1.1"
17
17
  inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
18
- sodipodi:docname="section.svg">
18
+ sodipodi:docname="Section.svg">
19
19
  <sodipodi:namedview
20
20
  id="base"
21
21
  pagecolor="#ffffff"
@@ -27,7 +27,7 @@
27
27
  items: { type: Array, required: true },
28
28
  })
29
29
 
30
- const { name } = toRefs(useDisplay())
30
+ const { name } = useDisplay()
31
31
  const nb_items_to_display = ref(3)
32
32
  watch(
33
33
  name,
@@ -60,10 +60,6 @@
60
60
  transition: 1000,
61
61
  wrapAround: true,
62
62
  })
63
-
64
- onMounted(() => {
65
- console.log(carrousel_settings)
66
- })
67
63
  </script>
68
64
 
69
65
  <style scoped>
@@ -24,7 +24,9 @@
24
24
  </template>
25
25
 
26
26
  <script setup>
27
- import schema from "@/assets/schemas/CrsSelector.json"
27
+ import schemas from "@geode/opengeodeweb-back/schemas.json"
28
+ const schema = schemas.opengeodeweb_back.geographic_coordinate_systems
29
+
28
30
  const emit = defineEmits([
29
31
  "update_values",
30
32
  "increment_step",
@@ -64,11 +66,13 @@
64
66
  async function get_crs_table() {
65
67
  const params = { input_geode_object }
66
68
  toggle_loading()
69
+ console.log("get_crs_table")
67
70
  await api_fetch(
68
71
  { schema, params },
69
72
  {
70
73
  response_function: (response) => {
71
74
  crs_list.value = response._data.crs_list
75
+ console.log("crs_list", response._data.crs_list)
72
76
  },
73
77
  },
74
78
  )
@@ -86,7 +90,5 @@
86
90
  { title: "Name", align: "end", key: "name" },
87
91
  ]
88
92
 
89
- onMounted(() => {
90
- get_crs_table()
91
- })
93
+ await get_crs_table()
92
94
  </script>
@@ -1,62 +1,66 @@
1
1
  <template>
2
2
  <FetchingData v-if="loading" />
3
- <v-row
4
- v-for="(
5
- output_extensions, output_geode_object
6
- ) in geode_objects_and_output_extensions"
7
- :key="output_geode_object"
8
- class="justify-left"
9
- >
10
- <v-card class="card ma-2 pa-2" width="100%">
11
- <v-tooltip :text="`Export as a ${output_geode_object}`" location="bottom">
12
- <template v-slot:activator="{ props }">
13
- <v-card-title v-bind="props">
14
- {{ output_geode_object }}
15
- </v-card-title>
16
- </template>
17
- </v-tooltip>
18
- <v-card-text>
19
- <v-row>
20
- <v-col
21
- v-for="(extension, output_extension) in output_extensions"
22
- :key="output_extension"
23
- cols="auto"
24
- class="pa-0"
25
- >
26
- <v-tooltip
27
- :disabled="extension.is_saveable"
28
- text="Data not saveable with this file extension"
29
- location="bottom"
3
+ <v-row v-else class="justify-left">
4
+ <v-col
5
+ v-for="(
6
+ output_extensions, output_geode_object
7
+ ) in geode_objects_and_output_extensions"
8
+ :key="output_geode_object"
9
+ class="justify-left"
10
+ >
11
+ <v-card class="card ma-2 pa-2" width="100%">
12
+ <v-tooltip
13
+ :text="`Export as a ${output_geode_object}`"
14
+ location="bottom"
15
+ >
16
+ <template v-slot:activator="{ props }">
17
+ <v-card-title v-bind="props">
18
+ {{ output_geode_object }}
19
+ </v-card-title>
20
+ </template>
21
+ </v-tooltip>
22
+ <v-card-text>
23
+ <v-row>
24
+ <v-col
25
+ v-for="(extension, output_extension) in output_extensions"
26
+ :key="output_extension"
27
+ cols="auto"
28
+ class="pa-0"
30
29
  >
31
- <template v-slot:activator="{ props }">
32
- <span v-bind="props">
33
- <v-card
34
- class="card ma-2"
35
- :color="extension.is_saveable ? 'primary' : 'grey'"
36
- hover
37
- @click="
38
- set_variables(output_geode_object, output_extension)
39
- "
40
- :disabled="!extension.is_saveable"
41
- >
42
- <v-card-title align="center">
43
- {{ output_extension }}
44
- </v-card-title>
45
- </v-card>
46
- </span>
47
- </template>
48
- </v-tooltip>
49
- </v-col>
50
- </v-row>
51
- </v-card-text>
52
- </v-card>
30
+ <v-tooltip
31
+ :disabled="extension.is_saveable"
32
+ text="Data not saveable with this file extension"
33
+ location="bottom"
34
+ >
35
+ <template v-slot:activator="{ props }">
36
+ <span v-bind="props">
37
+ <v-card
38
+ class="card ma-2"
39
+ :color="extension.is_saveable ? 'primary' : 'grey'"
40
+ hover
41
+ @click="
42
+ set_variables(output_geode_object, output_extension)
43
+ "
44
+ :disabled="!extension.is_saveable"
45
+ >
46
+ <v-card-title align="center">
47
+ {{ output_extension }}
48
+ </v-card-title>
49
+ </v-card>
50
+ </span>
51
+ </template>
52
+ </v-tooltip>
53
+ </v-col>
54
+ </v-row>
55
+ </v-card-text>
56
+ </v-card>
57
+ </v-col>
53
58
  </v-row>
54
59
  </template>
55
60
 
56
61
  <script setup>
57
- import _ from "lodash"
58
- import schema from "@/assets/schemas/ExtensionSelector.json"
59
-
62
+ import schemas from "@geode/opengeodeweb-back/schemas.json"
63
+ const schema = schemas.opengeodeweb_back.geode_objects_and_output_extensions
60
64
  const emit = defineEmits([
61
65
  "update_values",
62
66
  "increment_step",
@@ -75,7 +79,7 @@
75
79
 
76
80
  async function get_output_file_extensions() {
77
81
  toggle_loading()
78
- geode_objects_and_output_extensions.vaue = {}
82
+ geode_objects_and_output_extensions.value = {}
79
83
  var promise_array = []
80
84
  for (const filename of filenames) {
81
85
  const params = { input_geode_object, filename }
@@ -87,26 +91,7 @@
87
91
  reject()
88
92
  },
89
93
  response_function: (response) => {
90
- const data = response._data.geode_objects_and_output_extensions
91
- if (_.isEmpty(geode_objects_and_output_extensions.value)) {
92
- geode_objects_and_output_extensions.value = data
93
- } else {
94
- for (const [geode_object, geode_object_value] of Object.entries(
95
- data,
96
- )) {
97
- for (const [
98
- output_extension,
99
- output_extension_value,
100
- ] of Object.entries(geode_object_value)) {
101
- if (!output_extension_value["is_saveable"]) {
102
- geode_objects_and_output_extensions.value[geode_object][
103
- output_extension
104
- ]["is_saveable"] = false
105
- }
106
- }
107
- }
108
- }
109
- resolve()
94
+ resolve(response._data.geode_objects_and_output_extensions)
110
95
  },
111
96
  response_error_function: () => {
112
97
  reject()
@@ -116,7 +101,25 @@
116
101
  })
117
102
  promise_array.push(promise)
118
103
  }
119
- await Promise.all(promise_array)
104
+ const values = await Promise.all(promise_array)
105
+ const all_keys = [...new Set(values.flatMap((value) => Object.keys(value)))]
106
+ const common_keys = all_keys.filter(
107
+ (i) => !values.some((j) => !Object.keys(j).includes(i)),
108
+ )
109
+ var final_object = {}
110
+ for (const key of common_keys) {
111
+ final_object[key] = {}
112
+ for (const value of values) {
113
+ for (const extension of Object.keys(value[key])) {
114
+ if (value[key][extension].is_saveable == false) {
115
+ final_object[key][extension] = { is_saveable: false }
116
+ } else {
117
+ final_object[key][extension] = { is_saveable: true }
118
+ }
119
+ }
120
+ }
121
+ }
122
+ geode_objects_and_output_extensions.value = final_object
120
123
  toggle_loading()
121
124
  }
122
125
 
@@ -131,7 +134,5 @@
131
134
  }
132
135
  }
133
136
 
134
- onMounted(() => {
135
- get_output_file_extensions()
136
- })
137
+ await get_output_file_extensions()
137
138
  </script>
@@ -2,14 +2,15 @@
2
2
  <FetchingData v-if="loading" />
3
3
  <FileUploader
4
4
  v-else
5
- v-bind="{ multiple, accept, route }"
5
+ v-bind="{ multiple, accept }"
6
6
  @files_uploaded="files_uploaded_event"
7
7
  />
8
8
  </template>
9
9
 
10
10
  <script setup>
11
- import schema from "@/assets/schemas/FileSelector.json"
11
+ import schemas from "@geode/opengeodeweb-back/schemas.json"
12
12
 
13
+ const schema = schemas.opengeodeweb_back.allowed_files
13
14
  const emit = defineEmits([
14
15
  "update_values",
15
16
  "increment_step",
@@ -19,10 +20,9 @@
19
20
  const props = defineProps({
20
21
  multiple: { type: Boolean, required: true },
21
22
  key: { type: String, required: false, default: "" },
22
- route: { type: String, required: false, default: "" },
23
23
  })
24
24
 
25
- const { multiple, key, route } = props
25
+ const { multiple, key } = props
26
26
 
27
27
  const accept = ref("")
28
28
  const loading = ref(false)
@@ -51,7 +51,6 @@
51
51
  )
52
52
  toggle_loading()
53
53
  }
54
- onMounted(() => {
55
- get_allowed_files()
56
- })
54
+
55
+ await get_allowed_files()
57
56
  </script>
@@ -18,27 +18,28 @@
18
18
  <v-row>
19
19
  <v-col cols="auto">
20
20
  <v-btn
21
- @click="upload_files()"
21
+ @click="upload_files"
22
22
  color="primary"
23
23
  :disabled="!files.length && !files_uploaded"
24
24
  :loading="loading"
25
25
  class="pa-2"
26
- >
27
- Upload file(s)</v-btn
26
+ >Upload file(s)</v-btn
28
27
  >
29
28
  </v-col>
30
29
  </v-row>
31
30
  </template>
32
31
 
33
32
  <script setup>
33
+ import schemas from "@geode/opengeodeweb-back/schemas.json"
34
+ const schema = schemas.opengeodeweb_back.upload_file
35
+
34
36
  const emit = defineEmits(["files_uploaded", "decrement_step"])
35
37
 
36
38
  const props = defineProps({
37
39
  multiple: { type: Boolean, required: true },
38
40
  accept: { type: String, required: true },
39
- route: { type: String, required: true },
40
41
  })
41
- const { multiple, accept, route } = toRefs(props)
42
+ const { multiple, accept } = toRefs(props)
42
43
 
43
44
  const label = multiple ? "Please select file(s)" : "Please select a file"
44
45
  const files = ref([])
@@ -53,7 +54,7 @@
53
54
  for (const file of files.value) {
54
55
  const promise = new Promise((resolve, reject) => {
55
56
  upload_file(
56
- { route, file },
57
+ { route: schema.$id, file },
57
58
  {
58
59
  request_error_function: () => {
59
60
  reject()
@@ -26,8 +26,8 @@
26
26
  <v-row>
27
27
  <v-col cols="12">
28
28
  <FileUploader
29
- v-bind="{ multiple, accept, route }"
30
- @files_uploaded="files_uploaded"
29
+ v-bind="{ multiple, accept }"
30
+ @files_uploaded="files_uploaded_event"
31
31
  />
32
32
  </v-col>
33
33
  </v-row>
@@ -36,14 +36,16 @@
36
36
  v-if="!mandatory_files.length && additional_files.length"
37
37
  cols="auto"
38
38
  >
39
- <v-btn @click="skip_step()" color="warning"> Skip step </v-btn>
39
+ <v-btn @click="emit('increment_step')" color="warning">Skip step</v-btn>
40
40
  </v-col>
41
41
  </v-row>
42
42
  </v-container>
43
43
  </template>
44
44
 
45
45
  <script setup>
46
- import schema from "@/assets/schemas/MissingFilesSelector.json"
46
+ import schemas from "@geode/opengeodeweb-back/schemas.json"
47
+
48
+ const schema = schemas.opengeodeweb_back.missing_files
47
49
 
48
50
  const emit = defineEmits([
49
51
  "update_values",
@@ -55,10 +57,9 @@
55
57
  multiple: { type: Boolean, required: true },
56
58
  input_geode_object: { type: String, required: true },
57
59
  filenames: { type: Array, required: true },
58
- route: { type: String, required: true },
59
60
  })
60
61
 
61
- const { multiple, input_geode_object, filenames, route } = props
62
+ const { multiple, input_geode_object, filenames } = props
62
63
 
63
64
  const accept = ref("")
64
65
  const loading = ref(false)
@@ -67,7 +68,8 @@
67
68
  const additional_files = ref([])
68
69
  const toggle_loading = useToggle(loading)
69
70
 
70
- function files_uploaded(value) {
71
+ function files_uploaded_event(value) {
72
+ console.log("update_values")
71
73
  emit("update_values", { additional_files: value })
72
74
  missing_files()
73
75
  }
@@ -89,18 +91,7 @@
89
91
  reject()
90
92
  },
91
93
  response_function: (response) => {
92
- has_missing_files.value = response._data.has_missing_files
93
- ? true
94
- : has_missing_files.value
95
- mandatory_files.value = [].concat(
96
- mandatory_files.value,
97
- response._data.mandatory_files,
98
- )
99
- additional_files.value = [].concat(
100
- additional_files.value,
101
- response._data.additional_files,
102
- )
103
- resolve()
94
+ resolve(response._data)
104
95
  },
105
96
  response_error_function: () => {
106
97
  reject()
@@ -110,7 +101,20 @@
110
101
  })
111
102
  promise_array.push(promise)
112
103
  }
113
- await Promise.all(promise_array)
104
+ const values = await Promise.all(promise_array)
105
+ for (const value of values) {
106
+ has_missing_files.value = value.has_missing_files
107
+ ? true
108
+ : has_missing_files.value
109
+ mandatory_files.value = [].concat(
110
+ mandatory_files.value,
111
+ value.mandatory_files,
112
+ )
113
+ additional_files.value = [].concat(
114
+ additional_files.value,
115
+ value.additional_files,
116
+ )
117
+ }
114
118
  if (!has_missing_files.value) {
115
119
  emit("increment_step")
116
120
  } else {
@@ -122,7 +126,5 @@
122
126
  toggle_loading()
123
127
  }
124
128
 
125
- onMounted(() => {
126
- missing_files()
127
- })
129
+ await missing_files()
128
130
  </script>