Skip to content

Commit a80a721

Browse files
committed
refactoring json schemas
1 parent 7d402fe commit a80a721

File tree

10 files changed

+79
-13
lines changed

10 files changed

+79
-13
lines changed

assets/schemas/CrsSelector.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$id": "/tools/geographic_coordinate_systems",
3+
"type": "object",
4+
"method": "POST",
5+
"properties": {
6+
"input_geode_object": {
7+
"type": "string"
8+
}
9+
},
10+
"required": [
11+
"input_geode_object"
12+
],
13+
"additionalProperties": false
14+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$id": "/tools/geode_objects_and_output_extensions",
3+
"type": "object",
4+
"method": "POST",
5+
"properties": {
6+
"input_geode_object": {
7+
"type": "string"
8+
}
9+
},
10+
"required": ["input_geode_object"],
11+
"additionalProperties": false
12+
}

assets/schemas/FileSelector.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$id": "/tools/allowed_files",
3+
"type": "object",
4+
"method": "POST",
5+
"properties": {
6+
"key": { "type": ["string", "null"] }
7+
},
8+
"required": ["key"],
9+
"additionalProperties": false
10+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$id": "/tools/missing_files",
3+
"type": "object",
4+
"method": "POST",
5+
"properties": {
6+
"input_geode_object": {
7+
"type": "string"
8+
},
9+
"filename": {
10+
"type": "string"
11+
}
12+
},
13+
"required": ["input_geode_object", "filename"],
14+
"additionalProperties": false
15+
}

assets/schemas/ObjectSelector.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$id": "/tools/allowed_objects",
3+
"type": "object",
4+
"method": "POST",
5+
"properties": {
6+
"filename": {
7+
"type": "string"
8+
},
9+
"key": {
10+
"type": ["string", "null"]
11+
}
12+
},
13+
"required": ["filename", "key"],
14+
"additionalProperties": false
15+
}

components/CrsSelector.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
</template>
2525

2626
<script setup>
27+
import schema from "@/assets/schemas/CrsSelector.json"
2728
const emit = defineEmits([
2829
"update_values",
2930
"increment_step",
@@ -33,10 +34,9 @@
3334
const props = defineProps({
3435
input_geode_object: { type: String, required: true },
3536
key_to_update: { type: String, required: true },
36-
schema: { type: Object, required: true },
3737
})
3838
39-
const { input_geode_object, key_to_update, schema } = props
39+
const { input_geode_object, key_to_update } = props
4040
4141
const search = ref("")
4242
const data_table_loading = ref(false)

components/ExtensionSelector.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
</template>
4040

4141
<script setup>
42+
import schema from "@/assets/schemas/ExtensionSelector.json"
4243
const emit = defineEmits([
4344
"update_values",
4445
"increment_step",
@@ -47,9 +48,8 @@
4748
4849
const props = defineProps({
4950
input_geode_object: { type: String, required: true },
50-
schema: { type: Object, required: true },
5151
})
52-
const { input_geode_object, schema } = props
52+
const { input_geode_object } = props
5353
5454
const geode_objects_and_output_extensions = ref([])
5555
const loading = ref(false)

components/FileSelector.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@
88
</template>
99

1010
<script setup>
11+
import schema from "@/assets/schemas/FileSelector.json"
1112
const emit = defineEmits([
1213
"update_values",
13-
"increment_step",
14-
"decrement_step",
14+
"increment_current_step",
15+
"decrement_current_step",
1516
])
1617
1718
const props = defineProps({
1819
multiple: { type: Boolean, required: true },
1920
key: { type: String, required: false, default: "" },
2021
route: { type: String, required: false, default: "" },
21-
schema: { type: Object, required: true },
2222
})
2323
24-
const { multiple, key, route, schema } = props
24+
const { multiple, key, route } = props
2525
2626
const accept = ref("")
2727
const loading = ref(false)
@@ -31,7 +31,7 @@
3131
function files_uploaded_event(value) {
3232
if (value.length) {
3333
emit("update_values", { files: value })
34-
emit("increment_step")
34+
emit("increment_current_step")
3535
}
3636
}
3737

components/MissingFilesSelector.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
</template>
4444

4545
<script setup>
46+
import schema from "@/assets/schemas/MissingFilesSelector.json"
4647
const emit = defineEmits([
4748
"update_values",
4849
"increment_step",
@@ -54,10 +55,9 @@
5455
input_geode_object: { type: String, required: true },
5556
files: { type: Array, required: true },
5657
route: { type: String, required: true },
57-
schema: { type: Object, required: true },
5858
})
5959
60-
const { multiple, input_geode_object, files, route, schema } = props
60+
const { multiple, input_geode_object, files, route } = props
6161
6262
const accept = ref("")
6363
const loading = ref(false)

components/ObjectSelector.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@
3232

3333
<script setup>
3434
import geode_objects from "@/assets/geode_objects"
35+
import schema from "@/assets/schemas/ObjectSelector.json"
3536
3637
const emit = defineEmits(["update_values", "increment_step"])
3738
3839
const props = defineProps({
3940
files: { type: Array, required: true },
4041
key: { type: String, required: false, default: null },
41-
schema: { type: Object, required: true },
4242
})
4343
44-
const { files, key, schema } = props
44+
const { files, key } = props
4545
4646
const loading = ref(false)
4747
const allowed_objects = ref([])

0 commit comments

Comments
 (0)