1
1
mirror of https://github.com/Fabio286/antares.git synced 2024-12-25 08:20:39 +01:00

fix: breadcrumb not change after table rename

This commit is contained in:
Fabio Di Stasio 2020-12-27 13:08:13 +01:00
parent 56f2a27f00
commit b6b7be098a

View File

@ -200,7 +200,8 @@ export default {
...mapActions({ ...mapActions({
addNotification: 'notifications/addNotification', addNotification: 'notifications/addNotification',
refreshStructure: 'workspaces/refreshStructure', refreshStructure: 'workspaces/refreshStructure',
setUnsavedChanges: 'workspaces/setUnsavedChanges' setUnsavedChanges: 'workspaces/setUnsavedChanges',
changeBreadcrumbs: 'workspaces/changeBreadcrumbs'
}), }),
async getFieldsData () { async getFieldsData () {
if (!this.table) return; if (!this.table) return;
@ -394,7 +395,15 @@ export default {
const { status, response } = await Tables.alterTable(params); const { status, response } = await Tables.alterTable(params);
if (status === 'success') { if (status === 'success') {
const oldName = this.tableOptions.name;
await this.refreshStructure(this.connection.uid); await this.refreshStructure(this.connection.uid);
if (oldName !== this.localOptions.name) {
this.setUnsavedChanges(false);
this.changeBreadcrumbs({ schema: this.schema, table: this.localOptions.name });
}
this.getFieldsData(); this.getFieldsData();
} }
else else