Prevent add/edit dialogs from saving if value is null

This commit is contained in:
Nicola Krumschmidt
2021-01-26 13:14:32 +01:00
parent 8f8b33de09
commit 4bfbc2ba9f
5 changed files with 10 additions and 6 deletions

View File

@@ -35,7 +35,9 @@
</v-card-text>
<v-card-actions>
<v-button secondary @click="renameActive = false">{{ $t('cancel') }}</v-button>
<v-button @click="renameSave" :loading="renameSaving">{{ $t('save') }}</v-button>
<v-button @click="renameSave" :disabled="renameValue === null" :loading="renameSaving">
{{ $t('save') }}
</v-button>
</v-card-actions>
</v-card>
</v-dialog>

View File

@@ -20,7 +20,7 @@
</v-card-text>
<v-card-actions>
<v-button secondary @click="dialogActive = false">{{ $t('cancel') }}</v-button>
<v-button :disabled="!newFolderName || newFolderName.length === 0" @click="addFolder" :loading="saving">
<v-button :disabled="newFolderName === null" @click="addFolder" :loading="saving">
{{ $t('save') }}
</v-button>
</v-card-actions>

View File

@@ -74,7 +74,9 @@
</v-card-text>
<v-card-actions>
<v-button secondary @click="renameActive = false">{{ $t('cancel') }}</v-button>
<v-button @click="renameSave" :loading="renameSaving">{{ $t('save') }}</v-button>
<v-button @click="renameSave" :disabled="renameValue === null" :loading="renameSaving">
{{ $t('save') }}
</v-button>
</v-card-actions>
</v-card>
</v-dialog>

View File

@@ -172,7 +172,7 @@
<v-button secondary @click="duplicateActive = false">
{{ $t('cancel') }}
</v-button>
<v-button @click="saveDuplicate" :loading="duplicating">
<v-button @click="saveDuplicate" :disabled="duplicateName === null" :loading="duplicating">
{{ $t('duplicate') }}
</v-button>
</v-card-actions>

View File

@@ -23,7 +23,7 @@
</v-card-text>
<v-card-actions>
<v-button to="/settings/roles" secondary>{{ $t('cancel') }}</v-button>
<v-button @click="save" :loading="saving">{{ $t('save') }}</v-button>
<v-button @click="save" :disabled="roleName === null" :loading="saving">{{ $t('save') }}</v-button>
</v-card-actions>
</v-card>
</v-dialog>
@@ -38,7 +38,7 @@ import { unexpectedError } from '@/utils/unexpected-error';
export default defineComponent({
setup() {
const roleName = ref<string>();
const roleName = ref<string | null>(null);
const appAccess = ref(true);
const adminAccess = ref(false);