Skip to content
Snippets Groups Projects
Verified Commit 4b761c54 authored by Martin Weise's avatar Martin Weise
Browse files

Simplified interface

parent c7a0d19c
No related branches found
No related tags found
1 merge request!370Fixed the test
...@@ -54,30 +54,12 @@ ...@@ -54,30 +54,12 @@
</v-col> </v-col>
</v-row> </v-row>
<v-row> <v-row>
<v-col <v-col>
md="6">
<v-select
v-model="payload.is_public"
name="public"
:label="$t('pages.database.subpages.create.data.label')"
:hint="$t('pages.database.subpages.create.data.hint')"
persistent-hint
:variant="inputVariant"
:items="visibilityOptions"
item-title="name"
item-value="value"
:rules="[v => !!v || $t('validation.required')]"
return-object
required>
</v-select>
</v-col>
<v-col
md="6">
<v-select <v-select
v-model="payload.is_schema_public" v-model="mode"
name="schema-public" name="mode"
:label="$t('pages.database.subpages.create.schema.label')" :label="$t('pages.database.subpages.create.visibility.label')"
:hint="$t('pages.database.subpages.create.schema.hint')" :hint="$t('pages.database.subpages.create.visibility.hint')"
persistent-hint persistent-hint
:variant="inputVariant" :variant="inputVariant"
:items="visibilityOptions" :items="visibilityOptions"
...@@ -86,6 +68,19 @@ ...@@ -86,6 +68,19 @@
:rules="[v => !!v || $t('validation.required')]" :rules="[v => !!v || $t('validation.required')]"
return-object return-object
required> required>
<template
v-slot:append-inner>
<v-tooltip
location="bottom">
<template
v-slot:activator="{ props }">
<v-icon
v-bind="props"
icon="mdi-help-circle-outline" />
</template>
{{ mode.hint }}
</v-tooltip>
</template>
</v-select> </v-select>
</v-col> </v-col>
</v-row> </v-row>
...@@ -125,14 +120,17 @@ export default { ...@@ -125,14 +120,17 @@ export default {
engines: [], engines: [],
visibilityOptions: [ visibilityOptions: [
{ {
name: this.$t('toolbars.database.public'), name: this.$t('pages.database.subpages.create.visibility.public.label'),
hint: this.$t('pages.database.subpages.create.visibility.public.hint'),
value: true value: true
}, },
{ {
name: this.$t('toolbars.database.private'), name: this.$t('pages.database.subpages.create.visibility.private.label'),
hint: this.$t('pages.database.subpages.create.visibility.private.hint'),
value: false value: false
} }
], ],
mode: true,
payload: { payload: {
name: null, name: null,
is_public: true, is_public: true,
...@@ -151,6 +149,7 @@ export default { ...@@ -151,6 +149,7 @@ export default {
} }
}, },
mounted () { mounted () {
this.mode = this.visibilityOptions[0]
this.fetchContainers() this.fetchContainers()
}, },
methods: { methods: {
...@@ -186,6 +185,8 @@ export default { ...@@ -186,6 +185,8 @@ export default {
create () { create () {
this.loading = true this.loading = true
this.payload.container_id = this.engine.id this.payload.container_id = this.engine.id
this.payload.is_public = this.mode.value
this.payload.is_schema_public = this.mode.value
const databaseService = useDatabaseService() const databaseService = useDatabaseService()
databaseService.create(this.payload) databaseService.create(this.payload)
.then(async (database) => { .then(async (database) => {
......
...@@ -653,13 +653,17 @@ ...@@ -653,13 +653,17 @@
"label": "Engine", "label": "Engine",
"hint": "Required" "hint": "Required"
}, },
"data": { "visibility": {
"label": "Data Visibility", "label": "Visibility",
"hint": "Required" "hint": "Required",
"public": {
"label": "Public",
"hint": "Everything is visible to the public, e.g. to publish data used in a open-access paper. You can later update the visibility of data."
}, },
"schema": { "private": {
"label": "Schema Visibility", "label": "Private",
"hint": "Required" "hint": "Nothing is visible to anyone without dedicated read-access, e.g. to work on a dataset. You can later update the visibility of data."
}
}, },
"submit": { "submit": {
"text": "Create" "text": "Create"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment