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

feat: rename tabs if element is renamed

This commit is contained in:
2021-07-16 17:27:37 +02:00
parent 525c964c62
commit ef21ea7448
2 changed files with 36 additions and 2 deletions

View File

@ -224,6 +224,7 @@ export default {
refreshStructure: 'workspaces/refreshStructure',
setUnsavedChanges: 'workspaces/setUnsavedChanges',
newTab: 'workspaces/newTab',
renameTabs: 'workspaces/renameTabs',
changeBreadcrumbs: 'workspaces/changeBreadcrumbs'
}),
async getFieldsData () {
@ -233,7 +234,10 @@ export default {
this.lastTable = this.table;
this.newFieldsCounter = 0;
this.isLoading = true;
this.localOptions = JSON.parse(JSON.stringify(this.tableOptions));
try {
this.localOptions = JSON.parse(JSON.stringify(this.tableOptions));
}
catch (error) {}
const params = {
uid: this.connection.uid,
@ -441,7 +445,13 @@ export default {
if (oldName !== this.localOptions.name) {
this.setUnsavedChanges(false);
this.newTab({ uid: this.connection.uid, schema: this.schema, table: this.localOptions.name, type: 'table-props' });// TODO: rename function that gets new and old name and change it on all opened tables
this.renameTabs({
uid: this.connection.uid,
schema: this.schema,
elementName: oldName,
elementNewName: this.localOptions.name,
elementType: 'table'
});
this.changeBreadcrumbs({ schema: this.schema, table: this.localOptions.name });
}