@geode/opengeodeweb-front 3.0.0 → 4.0.0-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/.eslintrc.cjs ADDED
@@ -0,0 +1,14 @@
1
+ module.exports = {
2
+ root: true,
3
+ env: {
4
+ node: true,
5
+ browser: true,
6
+ es2021: true,
7
+ },
8
+ extends: [
9
+ "eslint:recommended",
10
+ "plugin:vue/vue3-recommended",
11
+ "plugin:vuetify/recommended",
12
+ "plugin:nuxt/recommended",
13
+ ],
14
+ }
@@ -7,5 +7,5 @@ jobs:
7
7
  check-branch-protection:
8
8
  uses: Geode-solutions/actions/.github/workflows/branch-protection.yml@master
9
9
  with:
10
- branch_from: 'next'
11
- branch_to: 'master'
10
+ branch_from: "next"
11
+ branch_to: "master"
@@ -1,7 +1,7 @@
1
1
  name: Publish Package to npmjs
2
2
  on:
3
3
  push:
4
- branches: [ next, master ]
4
+ branches: [next, master]
5
5
 
6
6
  jobs:
7
7
  build:
@@ -13,4 +13,4 @@ jobs:
13
13
  id: semantic
14
14
  env:
15
15
  GITHUB_TOKEN: ${{ github.token }}
16
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
16
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -0,0 +1,11 @@
1
+ name: Prepare PR
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - next
7
+
8
+ jobs:
9
+ prepare:
10
+ uses: Geode-solutions/actions/.github/workflows/web-prepare-pr.yml@master
11
+ secrets: inherit
package/.prettierrc ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "semi": false,
3
+ "vueIndentScriptAndStyle": true
4
+ }
package/README.md CHANGED
@@ -1,2 +1,3 @@
1
1
  # OpenGeodeWeb-Front
2
+
2
3
  OpenSource Vue/Vuetify framework for web applications
@@ -1,110 +1,110 @@
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 point_set2d from '@/assets/img/geode_objects/point_set2d.svg'
8
- import point_set3d from '@/assets/img/geode_objects/point_set3d.svg'
9
- import polygonal_surface2d from '@/assets/img/geode_objects/polygonal_surface2d.svg'
10
- import polygonal_surface3d from '@/assets/img/geode_objects/polygonal_surface3d.svg'
11
- import polyhedral_solid from '@/assets/img/geode_objects/polyhedral_solid.svg'
12
- import raster_image2d from '@/assets/img/geode_objects/raster_image2d.svg'
13
- import raster_image3d from '@/assets/img/geode_objects/raster_image3d.svg'
14
- import regular_grid2d from '@/assets/img/geode_objects/regular_grid2d.svg'
15
- import regular_grid3d from '@/assets/img/geode_objects/regular_grid3d.svg'
16
- import section from '@/assets/img/geode_objects/section.svg'
17
- import structural_model from '@/assets/img/geode_objects/structural_model.svg'
18
- import tetrahedral_solid from '@/assets/img/geode_objects/tetrahedral_solid.svg'
19
- import triangulated_surface2d from '@/assets/img/geode_objects/triangulated_surface2d.svg'
20
- import triangulated_surface3d from '@/assets/img/geode_objects/triangulated_surface3d.svg'
21
- import vertex_set from '@/assets/img/geode_objects/vertex_set.svg'
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 point_set2d from "@/assets/img/geode_objects/point_set2d.svg"
8
+ import point_set3d from "@/assets/img/geode_objects/point_set3d.svg"
9
+ import polygonal_surface2d from "@/assets/img/geode_objects/polygonal_surface2d.svg"
10
+ import polygonal_surface3d from "@/assets/img/geode_objects/polygonal_surface3d.svg"
11
+ import polyhedral_solid from "@/assets/img/geode_objects/polyhedral_solid.svg"
12
+ import raster_image2d from "@/assets/img/geode_objects/raster_image2d.svg"
13
+ import raster_image3d from "@/assets/img/geode_objects/raster_image3d.svg"
14
+ import regular_grid2d from "@/assets/img/geode_objects/regular_grid2d.svg"
15
+ import regular_grid3d from "@/assets/img/geode_objects/regular_grid3d.svg"
16
+ import section from "@/assets/img/geode_objects/section.svg"
17
+ import structural_model from "@/assets/img/geode_objects/structural_model.svg"
18
+ import tetrahedral_solid from "@/assets/img/geode_objects/tetrahedral_solid.svg"
19
+ import triangulated_surface2d from "@/assets/img/geode_objects/triangulated_surface2d.svg"
20
+ import triangulated_surface3d from "@/assets/img/geode_objects/triangulated_surface3d.svg"
21
+ import vertex_set from "@/assets/img/geode_objects/vertex_set.svg"
22
22
 
23
23
  const geode_objects = {
24
- BRep: {
25
- tooltip: 'BRep',
26
- image: brep,
27
- },
28
- CrossSection: {
29
- tooltip: 'CrossSection',
30
- image: cross_section,
31
- },
32
- EdgedCurve2D: {
33
- tooltip: 'EdgedCurve2D',
34
- image: edged_curve2d,
35
- },
36
- EdgedCurve3D: {
37
- tooltip: 'EdgedCurve3D',
38
- image: edged_curve3d,
39
- },
40
- Graph: {
41
- tooltip: 'Graph',
42
- image: edged_curve,
43
- },
44
- HybridSolid3D: {
45
- tooltip: "HybridSolid3D",
46
- image: hybrid_solid,
47
- },
48
- PointSet2D: {
49
- tooltip: 'PointSet2D',
50
- image: point_set2d,
51
- },
52
- PointSet3D: {
53
- tooltip: 'PointSet3D',
54
- image: point_set3d,
55
- },
56
- PolygonalSurface2D: {
57
- tooltip: 'PolygonalSurface2D',
58
- image: polygonal_surface2d,
59
- },
60
- PolygonalSurface3D: {
61
- tooltip: 'PolygonalSurface3D',
62
- image: polygonal_surface3d,
63
- },
64
- PolyhedralSolid3D: {
65
- tooltip: 'PolyhedralSolid3D',
66
- image: polyhedral_solid,
67
- },
68
- RasterImage2D: {
69
- tooltip: 'RasterImage2D',
70
- image: raster_image2d,
71
- },
72
- RasterImage3D: {
73
- tooltip: 'RasterImage3D',
74
- image: raster_image3d,
75
- },
76
- RegularGrid2D: {
77
- tooltip: 'RegularGrid2D',
78
- image: regular_grid2d,
79
- },
80
- RegularGrid3D: {
81
- tooltip: 'RegularGrid3D',
82
- image: regular_grid3d,
83
- },
84
- Section: {
85
- tooltip: 'Section',
86
- image: section,
87
- },
88
- StructuralModel: {
89
- tooltip: 'StructuralModel',
90
- image: structural_model,
91
- },
92
- TetrahedralSolid3D: {
93
- tooltip: 'TetrahedralSolid3D',
94
- image: tetrahedral_solid,
95
- },
96
- TriangulatedSurface2D: {
97
- tooltip: 'TriangulatedSurface2D',
98
- image: triangulated_surface2d,
99
- },
100
- TriangulatedSurface3D: {
101
- tooltip: 'TriangulatedSurface3D',
102
- image: triangulated_surface3d,
103
- },
104
- VertexSet: {
105
- tooltip: 'VertexSet',
106
- image: vertex_set,
107
- }
24
+ BRep: {
25
+ tooltip: "BRep",
26
+ image: brep,
27
+ },
28
+ CrossSection: {
29
+ tooltip: "CrossSection",
30
+ image: cross_section,
31
+ },
32
+ EdgedCurve2D: {
33
+ tooltip: "EdgedCurve2D",
34
+ image: edged_curve2d,
35
+ },
36
+ EdgedCurve3D: {
37
+ tooltip: "EdgedCurve3D",
38
+ image: edged_curve3d,
39
+ },
40
+ Graph: {
41
+ tooltip: "Graph",
42
+ image: edged_curve,
43
+ },
44
+ HybridSolid3D: {
45
+ tooltip: "HybridSolid3D",
46
+ image: hybrid_solid,
47
+ },
48
+ PointSet2D: {
49
+ tooltip: "PointSet2D",
50
+ image: point_set2d,
51
+ },
52
+ PointSet3D: {
53
+ tooltip: "PointSet3D",
54
+ image: point_set3d,
55
+ },
56
+ PolygonalSurface2D: {
57
+ tooltip: "PolygonalSurface2D",
58
+ image: polygonal_surface2d,
59
+ },
60
+ PolygonalSurface3D: {
61
+ tooltip: "PolygonalSurface3D",
62
+ image: polygonal_surface3d,
63
+ },
64
+ PolyhedralSolid3D: {
65
+ tooltip: "PolyhedralSolid3D",
66
+ image: polyhedral_solid,
67
+ },
68
+ RasterImage2D: {
69
+ tooltip: "RasterImage2D",
70
+ image: raster_image2d,
71
+ },
72
+ RasterImage3D: {
73
+ tooltip: "RasterImage3D",
74
+ image: raster_image3d,
75
+ },
76
+ RegularGrid2D: {
77
+ tooltip: "RegularGrid2D",
78
+ image: regular_grid2d,
79
+ },
80
+ RegularGrid3D: {
81
+ tooltip: "RegularGrid3D",
82
+ image: regular_grid3d,
83
+ },
84
+ Section: {
85
+ tooltip: "Section",
86
+ image: section,
87
+ },
88
+ StructuralModel: {
89
+ tooltip: "StructuralModel",
90
+ image: structural_model,
91
+ },
92
+ TetrahedralSolid3D: {
93
+ tooltip: "TetrahedralSolid3D",
94
+ image: tetrahedral_solid,
95
+ },
96
+ TriangulatedSurface2D: {
97
+ tooltip: "TriangulatedSurface2D",
98
+ image: triangulated_surface2d,
99
+ },
100
+ TriangulatedSurface3D: {
101
+ tooltip: "TriangulatedSurface3D",
102
+ image: triangulated_surface3d,
103
+ },
104
+ VertexSet: {
105
+ tooltip: "VertexSet",
106
+ image: vertex_set,
107
+ },
108
108
  }
109
109
 
110
110
  export default geode_objects
@@ -1,78 +1,92 @@
1
1
  <template>
2
- <v-text-field v-model="search" append-icon="mdi-magnify" label="Search" single-line hide-details></v-text-field>
3
- <v-data-table v-model="selected_crs" :v-model:items-per-page="10" :headers="headers" :items="crs_list" item-value="code"
4
- class="elevation-1" density='compact' fixed-header select-strategy='single' show-select :search="search"
5
- :loading="data_table_loading" loading-text="Loading... Please wait"></v-data-table>
2
+ <v-text-field
3
+ v-model="search"
4
+ append-icon="mdi-magnify"
5
+ label="Search"
6
+ single-line
7
+ hide-details
8
+ ></v-text-field>
9
+ <v-data-table
10
+ v-model="selected_crs"
11
+ :v-model:items-per-page="10"
12
+ :headers="headers"
13
+ :items="crs_list"
14
+ item-value="code"
15
+ class="elevation-1"
16
+ density="compact"
17
+ fixed-header
18
+ select-strategy="single"
19
+ show-select
20
+ :search="search"
21
+ :loading="data_table_loading"
22
+ loading-text="Loading... Please wait"
23
+ ></v-data-table>
6
24
  </template>
7
25
 
8
26
  <script setup>
9
- import { useToggle } from '@vueuse/core'
27
+ import { useToggle } from "@vueuse/core"
10
28
 
11
- const stepper_tree = inject('stepper_tree')
12
- const { geode_object, route_prefix } = stepper_tree
29
+ const stepper_tree = inject("stepper_tree")
30
+ const { geode_object } = stepper_tree
13
31
 
14
- const props = defineProps({
15
- variable_to_update: { type: String, required: true },
16
- variable_to_increment: { type: String, required: true },
17
- })
32
+ const props = defineProps({
33
+ variable_to_update: { type: String, required: true },
34
+ variable_to_increment: { type: String, required: true },
35
+ schema: { type: Object, required: true },
36
+ })
18
37
 
19
- const { variable_to_update, variable_to_increment } = props
38
+ const { variable_to_update, variable_to_increment, schema } = props
20
39
 
21
- const search = ref('')
22
- const data_table_loading = ref(false)
23
- const crs_list = ref([])
24
- const selected_crs = ref([])
25
- const toggle_loading = useToggle(data_table_loading)
40
+ const search = ref("")
41
+ const data_table_loading = ref(false)
42
+ const crs_list = ref([])
43
+ const selected_crs = ref([])
44
+ const toggle_loading = useToggle(data_table_loading)
26
45
 
27
- watch(selected_crs, (new_value) => {
28
- const crs = get_selected_crs(new_value[0])
29
- set_crs(crs)
30
- })
46
+ watch(selected_crs, (new_value) => {
47
+ const crs = get_selected_crs(new_value[0])
48
+ set_crs(crs)
49
+ })
31
50
 
32
- function set_crs(crs_value) {
33
- stepper_tree[variable_to_update] = crs_value
34
- stepper_tree[variable_to_increment]++
35
- }
51
+ function set_crs(crs_value) {
52
+ stepper_tree[variable_to_update] = crs_value
53
+ stepper_tree[variable_to_increment]++
54
+ }
36
55
 
37
- function get_selected_crs(crs_code) {
38
- for (let i = 0; i <= crs_list.value.length; i++) {
39
- if (crs_list.value[i]['code'] == crs_code) {
40
- return crs_list.value[i]
56
+ function get_selected_crs(crs_code) {
57
+ for (let i = 0; i <= crs_list.value.length; i++) {
58
+ if (crs_list.value[i]["code"] == crs_code) {
59
+ return crs_list.value[i]
60
+ }
41
61
  }
42
62
  }
43
- }
44
63
 
45
- async function get_crs_table() {
46
- let params = new FormData()
47
- params.append('geode_object', geode_object)
48
- toggle_loading()
49
- await api_fetch(`${route_prefix}/geographic_coordinate_systems`, { method: 'POST', body: params },
50
- {
51
- 'request_error_function': () => { toggle_loading() },
52
- 'response_function': (response) => {
53
- toggle_loading()
54
- crs_list.value = response._data.crs_list
64
+ async function get_crs_table() {
65
+ const params = { geode_object: geode_object }
66
+ toggle_loading()
67
+ await api_fetch(
68
+ { schema, params },
69
+ {
70
+ response_function: (response) => {
71
+ crs_list.value = response._data.crs_list
72
+ },
55
73
  },
56
- 'response_error_function': () => { toggle_loading() }
57
- }
58
- )
59
- }
60
-
61
- const headers = [
62
- {
63
- title: 'Authority',
64
- align: 'start',
65
- sortable: true,
66
- key: 'authority',
67
-
68
- },
69
- { title: 'Code', align: 'end', key: 'code' },
70
- { title: 'Name', align: 'end', key: 'name' }
71
- ]
72
-
74
+ )
75
+ toggle_loading()
76
+ }
73
77
 
74
- onMounted(() => {
75
- get_crs_table()
76
- })
78
+ const headers = [
79
+ {
80
+ title: "Authority",
81
+ align: "start",
82
+ sortable: true,
83
+ key: "authority",
84
+ },
85
+ { title: "Code", align: "end", key: "code" },
86
+ { title: "Name", align: "end", key: "name" },
87
+ ]
77
88
 
78
- </script>
89
+ onMounted(() => {
90
+ get_crs_table()
91
+ })
92
+ </script>
@@ -1,5 +1,10 @@
1
1
  <template>
2
- <v-banner v-if="server_error" elevation="2" style="background-color: grey; z-index:100;" position="fixed">
2
+ <v-banner
3
+ v-if="server_error"
4
+ elevation="2"
5
+ style="background-color: grey; z-index: 100"
6
+ position="fixed"
7
+ >
3
8
  <v-row>
4
9
  <v-col cols="auto" class="white--text text-center">
5
10
  <v-tooltip location="end">
@@ -13,18 +18,23 @@
13
18
  </template>
14
19
  </v-tooltip>
15
20
  </v-col>
16
- <v-col cols="auto" class="text-white font-weight-bold">Server timed out due to inactivity,
17
- please reload this page
18
- or click here:
21
+ <v-col cols="auto" class="text-white font-weight-bold"
22
+ >Server timed out due to inactivity, please reload this page or click
23
+ here:
19
24
  </v-col>
20
25
  <v-col cols="auto" align-items="center">
21
- <v-btn @click="reload()" color="grey" density='compact'>
22
- Reload
23
- </v-btn>
26
+ <v-btn @click="reload()" color="grey" density="compact"> Reload </v-btn>
24
27
  </v-col>
25
28
  <v-spacer />
26
29
  <v-col cols="auto">
27
- <v-btn icon flat size="20" @click="errors_store.delete_server_error()" color="grey" class=".align-center">
30
+ <v-btn
31
+ icon
32
+ flat
33
+ size="20"
34
+ @click="errors_store.delete_server_error()"
35
+ color="grey"
36
+ class=".align-center"
37
+ >
28
38
  <v-icon icon="mdi-close" size="20" color="white" />
29
39
  </v-btn>
30
40
  </v-col>
@@ -33,16 +43,16 @@
33
43
  </template>
34
44
 
35
45
  <script setup>
36
- const errors_store = use_errors_store()
37
- const { server_error } = storeToRefs(errors_store)
46
+ const errors_store = use_errors_store()
47
+ const { server_error } = storeToRefs(errors_store)
38
48
 
39
- function reload () {
40
- window.location.reload()
41
- }
49
+ function reload() {
50
+ window.location.reload()
51
+ }
42
52
  </script>
43
53
 
44
54
  <style scoped>
45
- .v-btn {
46
- text-transform: unset !important;
47
- }
48
- </style>
55
+ .v-btn {
56
+ text-transform: unset !important;
57
+ }
58
+ </style>
@@ -1,14 +1,22 @@
1
1
  <template>
2
- <v-snackbar :style="{ 'margin-bottom': calc_margin(index) }" v-for="(error, index) in errors" :key="index"
3
- v-model="show" color="error" location="bottom right" transition="slide-x-reverse-transition" max-width="30%"
4
- height="20px">
2
+ <v-snackbar
3
+ :style="{ 'margin-bottom': calc_margin(index) }"
4
+ v-for="(error, index) in errors"
5
+ :key="index"
6
+ v-model="show"
7
+ color="error"
8
+ location="bottom right"
9
+ transition="slide-x-reverse-transition"
10
+ max-width="30%"
11
+ height="20px"
12
+ >
5
13
  <v-row dense class="flex-nowrap">
6
14
  <v-col cols="auto">
7
15
  <v-tooltip location="left">
8
16
  <span>
9
17
  error: {{ error.code }} {{ error.name }}<br />
10
18
  ressource: {{ error.route }}
11
- <br>
19
+ <br />
12
20
  </span>
13
21
  <template #activator="{ props }">
14
22
  <v-icon v-bind="props" color="white" class="justify-right">
@@ -21,7 +29,7 @@
21
29
  <v-tooltip location="top">
22
30
  <span>
23
31
  {{ error.description }}
24
- <br>
32
+ <br />
25
33
  </span>
26
34
  <template #activator="{ props }">
27
35
  <div v-bind="props">
@@ -32,7 +40,13 @@
32
40
  </v-col>
33
41
  <v-spacer />
34
42
  <v-col cols="auto">
35
- <v-btn icon flat size="20" @click="errors_store.delete_error(index)" color="error">
43
+ <v-btn
44
+ icon
45
+ flat
46
+ size="20"
47
+ @click="errors_store.delete_error(index)"
48
+ color="error"
49
+ >
36
50
  <v-icon icon="mdi-close" size="20" color="white" />
37
51
  </v-btn>
38
52
  </v-col>
@@ -41,18 +55,18 @@
41
55
  </template>
42
56
 
43
57
  <script setup>
44
- const errors_store = use_errors_store()
45
- const { errors } = storeToRefs(errors_store)
58
+ const errors_store = use_errors_store()
59
+ const { errors } = storeToRefs(errors_store)
46
60
 
47
- const show = true
61
+ const show = true
48
62
 
49
- function calc_margin (index) {
50
- return (index * 60) + 8 + 'px'
51
- }
63
+ function calc_margin(index) {
64
+ return index * 60 + 8 + "px"
65
+ }
52
66
  </script>
53
67
 
54
68
  <style scoped>
55
- .v-snackbar :deep(.v-snackbar__content) {
56
- width: 100%;
57
- }
69
+ .v-snackbar :deep(.v-snackbar__content) {
70
+ width: 100%;
71
+ }
58
72
  </style>