Skip to content

Commit 7f34ae5

Browse files
feat(ExtensionSelector): switch to dict structure
1 parent d948dfc commit 7f34ae5

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

components/ExtensionSelector.vue

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,44 @@
11
<template>
22
<FetchingData v-if="loading" />
33
<v-row
4-
v-for="item in geode_objects_and_output_extensions"
5-
:key="item.geode_object"
4+
v-for="(
5+
output_extensions, geode_object
6+
) in geode_objects_and_output_extensions"
7+
:key="geode_object"
68
class="justify-left"
79
>
810
<v-card class="card ma-2 pa-2" width="100%">
9-
<v-tooltip :text="`Export as a ${item.geode_object}`" location="bottom">
11+
<v-tooltip :text="`Export as a ${geode_object}`" location="bottom">
1012
<template v-slot:activator="{ props }">
1113
<v-card-title v-bind="props">
12-
{{ item.geode_object }}
14+
{{ geode_object }}
1315
</v-card-title>
1416
</template>
1517
</v-tooltip>
1618
<v-card-text>
1719
<v-row>
1820
<v-col
19-
v-for="output in item.outputs"
20-
:key="output.extension"
21+
v-for="(extension, output_extension) in output_extensions"
22+
:key="output_extension"
2123
cols="auto"
2224
class="pa-0"
2325
>
2426
<v-tooltip
25-
:disabled="output.is_saveable"
27+
:disabled="extension.is_saveable"
2628
text="Data not saveable with this file extension"
2729
location="bottom"
2830
>
2931
<template v-slot:activator="{ props }">
3032
<span v-bind="props">
3133
<v-card
3234
class="card ma-2"
33-
:color="output.is_saveable ? 'primary' : 'grey'"
35+
:color="extension.is_saveable ? 'primary' : 'grey'"
3436
hover
35-
@click="set_variables(item.geode_object, output.extension)"
36-
:disabled="!output.is_saveable"
37+
@click="set_variables(geode_object, output_extension)"
38+
:disabled="!extension.is_saveable"
3739
>
3840
<v-card-title align="center">
39-
{{ output.extension }}
41+
{{ output_extension }}
4042
</v-card-title>
4143
</v-card>
4244
</span>
@@ -63,8 +65,7 @@
6365
filenames: { type: Array, required: true },
6466
})
6567
const { input_geode_object, filenames } = props
66-
67-
const geode_objects_and_output_extensions = ref([])
68+
const geode_objects_and_output_extensions = ref({})
6869
const loading = ref(false)
6970
7071
const toggle_loading = useToggle(loading)

0 commit comments

Comments
 (0)