Skip to content

Commit 3ac8bb9

Browse files
Merge pull request #65 from Geode-solutions/feat/is_loadable
Feat/is loadable
2 parents 15d2217 + 9aebfd8 commit 3ac8bb9

File tree

3 files changed

+77
-49
lines changed

3 files changed

+77
-49
lines changed

components/ObjectSelector.vue

Lines changed: 42 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,36 @@
11
<template>
22
<FetchingData v-if="loading" />
3-
<v-row v-else-if="allowed_objects.length" class="justify-left">
4-
<v-col v-for="object in allowed_objects" :key="object" cols="2" md="2">
5-
<v-card v-ripple class="card ma-2" hover rounded>
6-
<v-img
7-
:src="geode_objects[object].image"
8-
cover
9-
@click="set_geode_object(object)"
10-
/>
11-
<v-tooltip activator="parent" location="bottom">
12-
{{ geode_objects[object].tooltip }}
13-
</v-tooltip>
14-
</v-card>
3+
<v-row v-else-if="Object.keys(allowed_objects).length" class="justify-left">
4+
<v-col v-for="(value, key) in allowed_objects" :key="key" cols="2" md="2">
5+
<v-tooltip
6+
:disabled="value.is_saveable"
7+
:text="
8+
value['is_loadable']
9+
? geode_objects[key].tooltip
10+
: `Data not loadable with this class (${key})`
11+
"
12+
location="bottom"
13+
>
14+
<template v-slot:activator="{ props }">
15+
<span v-bind="props">
16+
<v-card
17+
v-ripple
18+
class="card ma-2"
19+
hover
20+
rounded
21+
:disabled="!value['is_loadable']"
22+
:elevation="value['is_loadable'] ? 5 : 3"
23+
>
24+
<v-img
25+
:src="geode_objects[key].image"
26+
cover
27+
@click="set_geode_object(key)"
28+
:class="!value['is_loadable'] ? 'disabled' : ''"
29+
/>
30+
</v-card>
31+
</span>
32+
</template>
33+
</v-tooltip>
1534
</v-col>
1635
</v-row>
1736
<v-row v-else class="pa-5">
@@ -45,8 +64,7 @@
4564
const { filenames, key } = props
4665
4766
const loading = ref(false)
48-
const allowed_objects = ref([])
49-
67+
const allowed_objects = ref({})
5068
const toggle_loading = useToggle(loading)
5169
5270
async function get_allowed_objects() {
@@ -95,3 +113,13 @@
95113
get_allowed_objects()
96114
})
97115
</script>
116+
117+
<style scoped>
118+
.disabled {
119+
filter: opacity(0.7);
120+
cursor: pointer;
121+
}
122+
.disabled div {
123+
cursor: not-allowed;
124+
}
125+
</style>

package-lock.json

Lines changed: 30 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"lint": "eslint --fix --ext .js,.vue --ignore-path .gitignore ."
55
},
66
"devDependencies": {
7-
"eslint": "^8.55.0",
8-
"eslint-plugin-import": "^2.29.0",
7+
"eslint": "^8.56.0",
8+
"eslint-plugin-import": "^2.29.1",
99
"eslint-plugin-nuxt": "^4.0.0",
1010
"eslint-plugin-prettier": "^5.0.1",
1111
"eslint-plugin-prettier-vue": "^5.0.0",
1212
"eslint-plugin-vue": "^9.19.2",
13-
"eslint-plugin-vuetify": "^2.1.0",
13+
"eslint-plugin-vuetify": "^2.1.1",
1414
"nuxt": "^3.8.2",
1515
"prettier": "3.1.1"
1616
},
@@ -25,7 +25,7 @@
2525
"@kitware/vtk.js": "^29.2.0",
2626
"@mdi/font": "^7.3.67",
2727
"@pinia/nuxt": "^0.5.1",
28-
"@types/node": "^20.10.4",
28+
"@types/node": "^20.10.5",
2929
"@vueuse/components": "^10.7.0",
3030
"@vueuse/core": "^10.7.0",
3131
"ajv": "^8.12.0",
@@ -34,7 +34,7 @@
3434
"sass": "^1.69.5",
3535
"semver": "^7.5.4",
3636
"vue-recaptcha": "^2.0.3",
37-
"vuetify": "^3.4.6",
37+
"vuetify": "^3.4.7",
3838
"wslink": "^1.12.4"
3939
},
4040
"repository": {

0 commit comments

Comments
 (0)