1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

feat: unsaved changes reminder

This commit is contained in:
2020-12-04 11:19:16 +01:00
parent a4122b4eaa
commit 33d1fa2290
7 changed files with 117 additions and 9 deletions

View File

@ -137,7 +137,7 @@ export default {
},
tableOptions () {
const db = this.workspace.structure.find(db => db.name === this.schema);
return db ? db.tables.find(table => table.name === this.table) : {};
return db && this.table ? db.tables.find(table => table.name === this.table) : {};
},
defaultEngine () {
return this.getDatabaseVariable(this.connection.uid, 'default_storage_engine').value || '';
@ -167,12 +167,17 @@ export default {
this.getFieldsData();
this.lastTable = this.table;
}
},
isChanged (val) {
if (this.isSelected && this.lastTable === this.table && this.table !== null)
this.setUnsavedChanges(val);
}
},
methods: {
...mapActions({
addNotification: 'notifications/addNotification',
refreshStructure: 'workspaces/refreshStructure'
refreshStructure: 'workspaces/refreshStructure',
setUnsavedChanges: 'workspaces/setUnsavedChanges'
}),
async getFieldsData () {
if (!this.table) return;