@geode/opengeodeweb-front 6.0.0-rc.3 → 6.0.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.
- package/assets/schemas/ExtensionSelector.json +4 -1
- package/components/ExtensionSelector.vue +64 -27
- package/components/FileUploader.vue +23 -9
- package/components/MissingFilesSelector.vue +43 -31
- package/components/ObjectSelector.vue +36 -14
- package/components/Step.vue +0 -2
- package/composables/upload_file.js +2 -4
- package/package.json +11 -11
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FetchingData v-if="loading" />
|
|
3
3
|
<v-row
|
|
4
|
-
v-for="
|
|
5
|
-
|
|
4
|
+
v-for="(
|
|
5
|
+
output_extensions, output_geode_object
|
|
6
|
+
) in geode_objects_and_output_extensions"
|
|
7
|
+
:key="output_geode_object"
|
|
6
8
|
class="justify-left"
|
|
7
9
|
>
|
|
8
10
|
<v-card class="card ma-2 pa-2" width="100%">
|
|
9
|
-
<v-tooltip :text="`Export as a ${
|
|
11
|
+
<v-tooltip :text="`Export as a ${output_geode_object}`" location="bottom">
|
|
10
12
|
<template v-slot:activator="{ props }">
|
|
11
13
|
<v-card-title v-bind="props">
|
|
12
|
-
{{
|
|
14
|
+
{{ output_geode_object }}
|
|
13
15
|
</v-card-title>
|
|
14
16
|
</template>
|
|
15
17
|
</v-tooltip>
|
|
16
18
|
<v-card-text>
|
|
17
19
|
<v-row>
|
|
18
20
|
<v-col
|
|
19
|
-
v-for="
|
|
20
|
-
:key="
|
|
21
|
+
v-for="(extension, output_extension) in output_extensions"
|
|
22
|
+
:key="output_extension"
|
|
21
23
|
cols="auto"
|
|
22
24
|
class="pa-0"
|
|
23
25
|
>
|
|
24
26
|
<v-tooltip
|
|
25
|
-
:disabled="
|
|
27
|
+
:disabled="extension.is_saveable"
|
|
26
28
|
text="Data not saveable with this file extension"
|
|
27
29
|
location="bottom"
|
|
28
30
|
>
|
|
@@ -30,13 +32,15 @@
|
|
|
30
32
|
<span v-bind="props">
|
|
31
33
|
<v-card
|
|
32
34
|
class="card ma-2"
|
|
33
|
-
:color="
|
|
35
|
+
:color="extension.is_saveable ? 'primary' : 'grey'"
|
|
34
36
|
hover
|
|
35
|
-
@click="
|
|
36
|
-
|
|
37
|
+
@click="
|
|
38
|
+
set_variables(output_geode_object, output_extension)
|
|
39
|
+
"
|
|
40
|
+
:disabled="!extension.is_saveable"
|
|
37
41
|
>
|
|
38
42
|
<v-card-title align="center">
|
|
39
|
-
{{
|
|
43
|
+
{{ output_extension }}
|
|
40
44
|
</v-card-title>
|
|
41
45
|
</v-card>
|
|
42
46
|
</span>
|
|
@@ -50,6 +54,7 @@
|
|
|
50
54
|
</template>
|
|
51
55
|
|
|
52
56
|
<script setup>
|
|
57
|
+
import _ from "lodash"
|
|
53
58
|
import schema from "@/assets/schemas/ExtensionSelector.json"
|
|
54
59
|
|
|
55
60
|
const emit = defineEmits([
|
|
@@ -60,33 +65,65 @@
|
|
|
60
65
|
|
|
61
66
|
const props = defineProps({
|
|
62
67
|
input_geode_object: { type: String, required: true },
|
|
68
|
+
filenames: { type: Array, required: true },
|
|
63
69
|
})
|
|
64
|
-
const { input_geode_object } = props
|
|
65
|
-
|
|
66
|
-
const geode_objects_and_output_extensions = ref([])
|
|
70
|
+
const { input_geode_object, filenames } = props
|
|
71
|
+
const geode_objects_and_output_extensions = ref({})
|
|
67
72
|
const loading = ref(false)
|
|
68
73
|
|
|
69
74
|
const toggle_loading = useToggle(loading)
|
|
70
75
|
|
|
71
76
|
async function get_output_file_extensions() {
|
|
72
77
|
toggle_loading()
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
{
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
78
|
+
geode_objects_and_output_extensions.vaue = {}
|
|
79
|
+
var promise_array = []
|
|
80
|
+
for (const filename of filenames) {
|
|
81
|
+
const params = { input_geode_object, filename }
|
|
82
|
+
const promise = new Promise((resolve, reject) => {
|
|
83
|
+
api_fetch(
|
|
84
|
+
{ schema, params },
|
|
85
|
+
{
|
|
86
|
+
request_error_function: () => {
|
|
87
|
+
reject()
|
|
88
|
+
},
|
|
89
|
+
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()
|
|
110
|
+
},
|
|
111
|
+
response_error_function: () => {
|
|
112
|
+
reject()
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
)
|
|
116
|
+
})
|
|
117
|
+
promise_array.push(promise)
|
|
118
|
+
}
|
|
119
|
+
await Promise.all(promise_array)
|
|
83
120
|
toggle_loading()
|
|
84
121
|
}
|
|
85
122
|
|
|
86
|
-
function set_variables(
|
|
87
|
-
if (
|
|
123
|
+
function set_variables(output_geode_object, output_extension) {
|
|
124
|
+
if (output_geode_object != "" && output_extension != "") {
|
|
88
125
|
const keys_values_object = {
|
|
89
|
-
output_geode_object
|
|
126
|
+
output_geode_object,
|
|
90
127
|
output_extension,
|
|
91
128
|
}
|
|
92
129
|
emit("update_values", keys_values_object)
|
|
@@ -49,15 +49,29 @@
|
|
|
49
49
|
|
|
50
50
|
async function upload_files() {
|
|
51
51
|
toggle_loading()
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
{
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
52
|
+
var promise_array = []
|
|
53
|
+
for (const file of files.value) {
|
|
54
|
+
const promise = new Promise((resolve, reject) => {
|
|
55
|
+
upload_file(
|
|
56
|
+
{ route, file },
|
|
57
|
+
{
|
|
58
|
+
request_error_function: () => {
|
|
59
|
+
reject()
|
|
60
|
+
},
|
|
61
|
+
response_function: () => {
|
|
62
|
+
resolve()
|
|
63
|
+
},
|
|
64
|
+
response_error_function: () => {
|
|
65
|
+
reject()
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
)
|
|
69
|
+
})
|
|
70
|
+
promise_array.push(promise)
|
|
71
|
+
}
|
|
72
|
+
await Promise.all(promise_array)
|
|
73
|
+
files_uploaded.value = true
|
|
74
|
+
emit("files_uploaded", files.value)
|
|
61
75
|
toggle_loading()
|
|
62
76
|
}
|
|
63
77
|
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
const props = defineProps({
|
|
55
55
|
multiple: { type: Boolean, required: true },
|
|
56
56
|
input_geode_object: { type: String, required: true },
|
|
57
|
-
|
|
57
|
+
filenames: { type: Array, required: true },
|
|
58
58
|
route: { type: String, required: true },
|
|
59
59
|
})
|
|
60
60
|
|
|
61
|
-
const { multiple, input_geode_object,
|
|
61
|
+
const { multiple, input_geode_object, filenames, route } = props
|
|
62
62
|
|
|
63
63
|
const accept = ref("")
|
|
64
64
|
const loading = ref(false)
|
|
@@ -73,39 +73,51 @@
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
async function missing_files() {
|
|
76
|
+
toggle_loading()
|
|
76
77
|
has_missing_files.value = false
|
|
77
78
|
mandatory_files.value = []
|
|
78
79
|
additional_files.value = []
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
)
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
80
|
+
var promise_array = []
|
|
81
|
+
|
|
82
|
+
for (const filename of filenames) {
|
|
83
|
+
const params = { input_geode_object, filename }
|
|
84
|
+
const promise = new Promise((resolve, reject) => {
|
|
85
|
+
api_fetch(
|
|
86
|
+
{ schema, params },
|
|
87
|
+
{
|
|
88
|
+
request_error_function: () => {
|
|
89
|
+
reject()
|
|
90
|
+
},
|
|
91
|
+
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()
|
|
104
|
+
},
|
|
105
|
+
response_error_function: () => {
|
|
106
|
+
reject()
|
|
107
|
+
},
|
|
106
108
|
},
|
|
107
|
-
|
|
108
|
-
)
|
|
109
|
+
)
|
|
110
|
+
})
|
|
111
|
+
promise_array.push(promise)
|
|
112
|
+
}
|
|
113
|
+
await Promise.all(promise_array)
|
|
114
|
+
if (!has_missing_files.value) {
|
|
115
|
+
emit("increment_step")
|
|
116
|
+
} else {
|
|
117
|
+
accept.value = []
|
|
118
|
+
.concat(mandatory_files.value, additional_files.value)
|
|
119
|
+
.map((filename) => "." + filename.split(".").pop())
|
|
120
|
+
.join(",")
|
|
109
121
|
}
|
|
110
122
|
toggle_loading()
|
|
111
123
|
}
|
|
@@ -31,17 +31,18 @@
|
|
|
31
31
|
</template>
|
|
32
32
|
|
|
33
33
|
<script setup>
|
|
34
|
+
import { toRaw } from "vue"
|
|
34
35
|
import geode_objects from "@/assets/geode_objects"
|
|
35
36
|
import schema from "@/assets/schemas/ObjectSelector.json"
|
|
36
37
|
|
|
37
38
|
const emit = defineEmits(["update_values", "increment_step"])
|
|
38
39
|
|
|
39
40
|
const props = defineProps({
|
|
40
|
-
|
|
41
|
+
filenames: { type: Array, required: true },
|
|
41
42
|
key: { type: String, required: false, default: null },
|
|
42
43
|
})
|
|
43
44
|
|
|
44
|
-
const {
|
|
45
|
+
const { filenames, key } = props
|
|
45
46
|
|
|
46
47
|
const loading = ref(false)
|
|
47
48
|
const allowed_objects = ref([])
|
|
@@ -49,22 +50,43 @@
|
|
|
49
50
|
const toggle_loading = useToggle(loading)
|
|
50
51
|
|
|
51
52
|
async function get_allowed_objects() {
|
|
52
|
-
const params = { filename: files[0].name, key }
|
|
53
53
|
toggle_loading()
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
54
|
+
allowed_objects.value = []
|
|
55
|
+
var promise_array = []
|
|
56
|
+
for (const filename of filenames) {
|
|
57
|
+
const params = { filename, key }
|
|
58
|
+
const promise = new Promise((resolve, reject) => {
|
|
59
|
+
api_fetch(
|
|
60
|
+
{ schema, params },
|
|
61
|
+
{
|
|
62
|
+
request_error_function: () => {
|
|
63
|
+
reject()
|
|
64
|
+
},
|
|
65
|
+
response_function: (response) => {
|
|
66
|
+
if (allowed_objects.value.length == 0) {
|
|
67
|
+
allowed_objects.value = response._data.allowed_objects
|
|
68
|
+
} else {
|
|
69
|
+
allowed_objects.value = toRaw(allowed_objects.value).filter(
|
|
70
|
+
(value) => response._data.allowed_objects.includes(value),
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
resolve()
|
|
74
|
+
},
|
|
75
|
+
response_error_function: () => {
|
|
76
|
+
reject()
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
)
|
|
80
|
+
})
|
|
81
|
+
promise_array.push(promise)
|
|
82
|
+
}
|
|
83
|
+
await Promise.all(promise_array)
|
|
62
84
|
toggle_loading()
|
|
63
85
|
}
|
|
64
86
|
|
|
65
|
-
function set_geode_object(
|
|
66
|
-
if (
|
|
67
|
-
emit("update_values", { input_geode_object
|
|
87
|
+
function set_geode_object(input_geode_object) {
|
|
88
|
+
if (input_geode_object != "") {
|
|
89
|
+
emit("update_values", { input_geode_object })
|
|
68
90
|
emit("increment_step")
|
|
69
91
|
}
|
|
70
92
|
}
|
package/components/Step.vue
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
export function upload_file(
|
|
2
|
-
{ route,
|
|
2
|
+
{ route, file },
|
|
3
3
|
{ request_error_function, response_function, response_error_function } = {},
|
|
4
4
|
) {
|
|
5
5
|
const errors_store = use_errors_store()
|
|
6
6
|
const geode_store = use_geode_store()
|
|
7
7
|
|
|
8
8
|
const body = new FormData()
|
|
9
|
-
|
|
10
|
-
body.append("content", files[i])
|
|
11
|
-
}
|
|
9
|
+
body.append("file", file)
|
|
12
10
|
|
|
13
11
|
const request_options = {
|
|
14
12
|
method: "PUT",
|
package/package.json
CHANGED
|
@@ -4,37 +4,37 @@
|
|
|
4
4
|
"lint": "eslint --fix --ext .js,.vue --ignore-path .gitignore ."
|
|
5
5
|
},
|
|
6
6
|
"devDependencies": {
|
|
7
|
-
"eslint": "^8.
|
|
7
|
+
"eslint": "^8.55.0",
|
|
8
8
|
"eslint-plugin-import": "^2.29.0",
|
|
9
9
|
"eslint-plugin-nuxt": "^4.0.0",
|
|
10
10
|
"eslint-plugin-prettier": "^5.0.1",
|
|
11
11
|
"eslint-plugin-prettier-vue": "^5.0.0",
|
|
12
|
-
"eslint-plugin-vue": "^9.
|
|
13
|
-
"eslint-plugin-vuetify": "^2.0
|
|
14
|
-
"nuxt": "^3.8.
|
|
15
|
-
"prettier": "3.
|
|
12
|
+
"eslint-plugin-vue": "^9.19.2",
|
|
13
|
+
"eslint-plugin-vuetify": "^2.1.0",
|
|
14
|
+
"nuxt": "^3.8.2",
|
|
15
|
+
"prettier": "3.1.1"
|
|
16
16
|
},
|
|
17
17
|
"overrides": {
|
|
18
18
|
"vue": "latest"
|
|
19
19
|
},
|
|
20
20
|
"description": "OpenSource Vue/Vuetify framework for web applications",
|
|
21
21
|
"type": "module",
|
|
22
|
-
"version": "6.0.0
|
|
22
|
+
"version": "6.0.0",
|
|
23
23
|
"main": "./nuxt.config.js",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@kitware/vtk.js": "^29.
|
|
25
|
+
"@kitware/vtk.js": "^29.2.0",
|
|
26
26
|
"@mdi/font": "^7.3.67",
|
|
27
27
|
"@pinia/nuxt": "^0.5.1",
|
|
28
|
-
"@types/node": "^20.
|
|
29
|
-
"@vueuse/components": "^10.
|
|
30
|
-
"@vueuse/core": "^10.
|
|
28
|
+
"@types/node": "^20.10.4",
|
|
29
|
+
"@vueuse/components": "^10.7.0",
|
|
30
|
+
"@vueuse/core": "^10.7.0",
|
|
31
31
|
"ajv": "^8.12.0",
|
|
32
32
|
"lodash": "^4.17.21",
|
|
33
33
|
"pinia": "^2.1.7",
|
|
34
34
|
"sass": "^1.69.5",
|
|
35
35
|
"semver": "^7.5.4",
|
|
36
36
|
"vue-recaptcha": "^2.0.3",
|
|
37
|
-
"vuetify": "^3.
|
|
37
|
+
"vuetify": "^3.4.6",
|
|
38
38
|
"wslink": "^1.12.4"
|
|
39
39
|
},
|
|
40
40
|
"repository": {
|