mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
fix: some problems with properties and data tabs when changing database from sidebar
This commit is contained in:
@ -122,7 +122,13 @@ export default {
|
|||||||
return this.selectedWorkspace === this.connection.uid;
|
return this.selectedWorkspace === this.connection.uid;
|
||||||
},
|
},
|
||||||
selectedTab () {
|
selectedTab () {
|
||||||
return this.queryTabs.find(tab => tab.uid === this.workspace.selected_tab) || ['data', 'prop'].includes(this.workspace.selected_tab) ? this.workspace.selected_tab : this.queryTabs[0].uid;
|
if (this.workspace.breadcrumbs.table === null)
|
||||||
|
return this.queryTabs[0].uid;
|
||||||
|
|
||||||
|
return this.queryTabs.find(tab => tab.uid === this.workspace.selected_tab) ||
|
||||||
|
['data', 'prop'].includes(this.workspace.selected_tab)
|
||||||
|
? this.workspace.selected_tab
|
||||||
|
: this.queryTabs[0].uid;
|
||||||
},
|
},
|
||||||
queryTabs () {
|
queryTabs () {
|
||||||
return this.workspace.tabs.filter(tab => tab.type === 'query');
|
return this.workspace.tabs.filter(tab => tab.type === 'query');
|
||||||
|
@ -3,7 +3,7 @@ import Connection from '@/ipc-api/Connection';
|
|||||||
import Database from '@/ipc-api/Database';
|
import Database from '@/ipc-api/Database';
|
||||||
import { uidGen } from 'common/libs/uidGen';
|
import { uidGen } from 'common/libs/uidGen';
|
||||||
const tabIndex = [];
|
const tabIndex = [];
|
||||||
let lastSchema = '';
|
let lastBreadcrumb = '';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
namespaced: true,
|
namespaced: true,
|
||||||
@ -291,12 +291,13 @@ export default {
|
|||||||
dispatch('newTab', uid);
|
dispatch('newTab', uid);
|
||||||
},
|
},
|
||||||
changeBreadcrumbs ({ commit, getters }, payload) {
|
changeBreadcrumbs ({ commit, getters }, payload) {
|
||||||
if (lastSchema !== payload.schema) {
|
if (lastBreadcrumb.schema === payload.schema && lastBreadcrumb.table !== null && payload.table === null) return;
|
||||||
|
|
||||||
|
if (lastBreadcrumb.schema !== payload.schema)
|
||||||
Database.useSchema({ uid: getters.getSelected, schema: payload.schema });
|
Database.useSchema({ uid: getters.getSelected, schema: payload.schema });
|
||||||
lastSchema = payload.schema;
|
|
||||||
}
|
|
||||||
|
|
||||||
commit('CHANGE_BREADCRUMBS', { uid: getters.getSelected, breadcrumbs: payload });
|
commit('CHANGE_BREADCRUMBS', { uid: getters.getSelected, breadcrumbs: payload });
|
||||||
|
lastBreadcrumb = { ...payload };
|
||||||
},
|
},
|
||||||
newTab ({ commit }, uid) {
|
newTab ({ commit }, uid) {
|
||||||
commit('NEW_TAB', uid);
|
commit('NEW_TAB', uid);
|
||||||
|
Reference in New Issue
Block a user