mirror of
https://github.com/Fabio286/antares.git
synced 2025-01-28 16:19:24 +01:00
perf(UI): disable save button in table creation when no fields are added
This commit is contained in:
parent
d7f1aa97af
commit
e8af2d24a8
@ -5,7 +5,7 @@
|
||||
<div class="workspace-query-buttons">
|
||||
<button
|
||||
class="btn btn-primary btn-sm"
|
||||
:disabled="!isChanged"
|
||||
:disabled="!isChanged || !isValid"
|
||||
:class="{'loading':isSaving}"
|
||||
title="CTRL+S"
|
||||
@click="saveChanges"
|
||||
@ -242,6 +242,9 @@ export default {
|
||||
JSON.stringify(this.originalKeyUsage) !== JSON.stringify(this.localKeyUsage) ||
|
||||
JSON.stringify(this.originalIndexes) !== JSON.stringify(this.localIndexes) ||
|
||||
JSON.stringify(this.tableOptions) !== JSON.stringify(this.localOptions);
|
||||
},
|
||||
isValid () {
|
||||
return !!this.localFields.length && !!this.localOptions.name.trim().length;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -287,7 +290,7 @@ export default {
|
||||
changeBreadcrumbs: 'workspaces/changeBreadcrumbs'
|
||||
}),
|
||||
async saveChanges () {
|
||||
if (this.isSaving) return;
|
||||
if (this.isSaving || !this.isValid) return;
|
||||
this.isSaving = true;
|
||||
|
||||
const params = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user