fix: missing tabs uid

This commit is contained in:
Fabio Di Stasio 2022-04-30 17:15:33 +02:00
parent cdbadbb11a
commit 18b66b5032
19 changed files with 35 additions and 49 deletions

View File

@ -295,7 +295,7 @@ export default {
this.stopRefresh();
this.selectedCell = cell;
this.selectedRow = cell.id;
this.selectedRow = Number(cell.id);
this.contextEvent = event;
this.isContext = true;
},

View File

@ -13,6 +13,7 @@ import * as ace from 'ace-builds';
import 'ace-builds/webpack-resolver';
import '../libs/ext-language_tools';
import { storeToRefs } from 'pinia';
import { uidGen } from 'common/libs/uidGen';
import { useApplicationStore } from '@/stores/application';
import { useSettingsStore } from '@/stores/settings';
import Tables from '@/ipc-api/Tables';
@ -59,7 +60,7 @@ export default {
cursorPosition: 0,
fields: [],
customCompleter: [],
id: null,
id: uidGen(),
lastSchema: null
};
},
@ -226,7 +227,6 @@ export default {
}
},
created () {
this.id = this._uid;
this.lastSchema = this.schema;
},
mounted () {

View File

@ -319,6 +319,7 @@
<WorkspaceTabQuery
v-if="tab.type==='query'"
:key="tab.uid"
:tab-uid="tab.uid"
:tab="tab"
:is-selected="selectedTab === tab.uid"
:connection="connection"
@ -326,6 +327,7 @@
<WorkspaceTabTable
v-else-if="['temp-data', 'data'].includes(tab.type)"
:key="tab.uid"
:tab-uid="tab.uid"
:connection="connection"
:is-selected="selectedTab === tab.uid"
:table="tab.elementName"
@ -335,6 +337,7 @@
<WorkspaceTabNewTable
v-else-if="tab.type === 'new-table'"
:key="tab.uid"
:tab-uid="tab.uid"
:tab="tab"
:connection="connection"
:is-selected="selectedTab === tab.uid"
@ -343,6 +346,7 @@
<WorkspaceTabPropsTable
v-else-if="tab.type === 'table-props'"
:key="tab.uid"
:tab-uid="tab.uid"
:connection="connection"
:is-selected="selectedTab === tab.uid"
:table="tab.elementName"
@ -351,6 +355,7 @@
<WorkspaceTabNewView
v-else-if="tab.type === 'new-view'"
:key="tab.uid"
:tab-uid="tab.uid"
:tab="tab"
:connection="connection"
:is-selected="selectedTab === tab.uid"
@ -359,6 +364,7 @@
<WorkspaceTabPropsView
v-else-if="tab.type === 'view-props'"
:key="tab.uid"
:tab-uid="tab.uid"
:is-selected="selectedTab === tab.uid"
:connection="connection"
:view="tab.elementName"
@ -367,6 +373,7 @@
<WorkspaceTabNewTrigger
v-else-if="tab.type === 'new-trigger'"
:key="tab.uid"
:tab-uid="tab.uid"
:tab="tab"
:connection="connection"
:is-selected="selectedTab === tab.uid"
@ -376,6 +383,7 @@
<WorkspaceTabPropsTrigger
v-else-if="['temp-trigger-props', 'trigger-props'].includes(tab.type)"
:key="tab.uid"
:tab-uid="tab.uid"
:connection="connection"
:is-selected="selectedTab === tab.uid"
:trigger="tab.elementName"
@ -384,6 +392,7 @@
<WorkspaceTabNewTriggerFunction
v-else-if="tab.type === 'new-trigger-function'"
:key="tab.uid"
:tab-uid="tab.uid"
:tab="tab"
:connection="connection"
:is-selected="selectedTab === tab.uid"
@ -393,6 +402,7 @@
<WorkspaceTabPropsTriggerFunction
v-else-if="['temp-trigger-function-props', 'trigger-function-props'].includes(tab.type)"
:key="tab.uid"
:tab-uid="tab.uid"
:connection="connection"
:is-selected="selectedTab === tab.uid"
:function="tab.elementName"
@ -401,6 +411,7 @@
<WorkspaceTabNewRoutine
v-else-if="tab.type === 'new-routine'"
:key="tab.uid"
:tab-uid="tab.uid"
:tab="tab"
:connection="connection"
:is-selected="selectedTab === tab.uid"
@ -410,6 +421,7 @@
<WorkspaceTabPropsRoutine
v-else-if="['temp-routine-props', 'routine-props'].includes(tab.type)"
:key="tab.uid"
:tab-uid="tab.uid"
:connection="connection"
:is-selected="selectedTab === tab.uid"
:routine="tab.elementName"
@ -418,6 +430,7 @@
<WorkspaceTabNewFunction
v-else-if="tab.type === 'new-function'"
:key="tab.uid"
:tab-uid="tab.uid"
:tab="tab"
:connection="connection"
:is-selected="selectedTab === tab.uid"
@ -427,6 +440,7 @@
<WorkspaceTabPropsFunction
v-else-if="['temp-function-props', 'function-props'].includes(tab.type)"
:key="tab.uid"
:tab-uid="tab.uid"
:connection="connection"
:is-selected="selectedTab === tab.uid"
:function="tab.elementName"
@ -435,6 +449,7 @@
<WorkspaceTabNewScheduler
v-else-if="tab.type === 'new-scheduler'"
:key="tab.uid"
:tab-uid="tab.uid"
:tab="tab"
:connection="connection"
:is-selected="selectedTab === tab.uid"
@ -444,6 +459,7 @@
<WorkspaceTabPropsScheduler
v-else-if="['temp-scheduler-props', 'scheduler-props'].includes(tab.type)"
:key="tab.uid"
:tab-uid="tab.uid"
:connection="connection"
:is-selected="selectedTab === tab.uid"
:scheduler="tab.elementName"

View File

@ -219,6 +219,7 @@ export default {
WorkspaceTabPropsFunctionParamsModal
},
props: {
tabUid: String,
connection: Object,
tab: Object,
isSelected: Boolean,
@ -271,9 +272,6 @@ export default {
customizations () {
return this.workspace.customizations;
},
tabUid () {
return this.$vnode?.key;
},
isChanged () {
return JSON.stringify(this.originalFunction) !== JSON.stringify(this.localFunction);
},

View File

@ -179,6 +179,7 @@ export default {
WorkspaceTabPropsRoutineParamsModal
},
props: {
tabUid: String,
connection: Object,
tab: Object,
isSelected: Boolean,
@ -231,9 +232,6 @@ export default {
customizations () {
return this.workspace.customizations;
},
tabUid () {
return this.$vnode?.key;
},
isChanged () {
return JSON.stringify(this.originalRoutine) !== JSON.stringify(this.localRoutine);
},

View File

@ -158,6 +158,7 @@ export default {
WorkspaceTabPropsSchedulerTimingModal
},
props: {
tabUid: String,
connection: Object,
tab: Object,
isSelected: Boolean,
@ -207,9 +208,6 @@ export default {
workspace () {
return this.getWorkspace(this.connection.uid);
},
tabUid () {
return this.$vnode?.key;
},
isChanged () {
return JSON.stringify(this.originalScheduler) !== JSON.stringify(this.localScheduler);
},

View File

@ -186,6 +186,7 @@ export default {
WorkspaceTabNewTableEmptyState
},
props: {
tabUid: String,
connection: Object,
tab: Object,
isSelected: Boolean,
@ -244,9 +245,6 @@ export default {
workspace () {
return this.getWorkspace(this.connection.uid);
},
tabUid () {
return this.$vnode?.key;
},
defaultCollation () {
if (this.workspace.customizations.collations)
return this.getDatabaseVariable(this.selectedWorkspace, 'collation_server').value || '';

View File

@ -146,6 +146,7 @@ export default {
QueryEditor
},
props: {
tabUid: String,
connection: Object,
tab: Object,
isSelected: Boolean,
@ -195,9 +196,6 @@ export default {
workspace () {
return this.getWorkspace(this.connection.uid);
},
tabUid () {
return this.$vnode?.key;
},
customizations () {
return this.workspace.customizations;
},

View File

@ -122,6 +122,7 @@ export default {
QueryEditor
},
props: {
tabUid: String,
connection: Object,
tab: Object,
isSelected: Boolean,
@ -175,9 +176,6 @@ export default {
customizations () {
return this.workspace.customizations;
},
tabUid () {
return this.$vnode?.key;
},
isChanged () {
return JSON.stringify(this.originalFunction) !== JSON.stringify(this.localFunction);
},

View File

@ -135,6 +135,7 @@ export default {
QueryEditor
},
props: {
tabUid: String,
connection: Object,
tab: Object,
isSelected: Boolean,
@ -183,9 +184,6 @@ export default {
workspace () {
return this.getWorkspace(this.connection.uid);
},
tabUid () {
return this.$vnode?.key;
},
isChanged () {
return JSON.stringify(this.originalView) !== JSON.stringify(this.localView);
},

View File

@ -241,6 +241,7 @@ export default {
ModalAskParameters
},
props: {
tabUid: String,
connection: Object,
function: String,
isSelected: Boolean,
@ -292,9 +293,6 @@ export default {
customizations () {
return this.workspace.customizations;
},
tabUid () {
return this.$vnode?.key;
},
isChanged () {
return JSON.stringify(this.originalFunction) !== JSON.stringify(this.localFunction);
},

View File

@ -152,7 +152,6 @@
<label class="form-label ml-2">{{ $t('message.routineBody') }}</label>
<QueryEditor
v-show="isSelected"
:key="`${routine}-${_uid}`"
ref="queryEditor"
v-model="localRoutine.sql"
:workspace="workspace"
@ -198,6 +197,7 @@ export default {
ModalAskParameters
},
props: {
tabUid: String,
connection: Object,
routine: String,
isSelected: Boolean,
@ -249,9 +249,6 @@ export default {
customizations () {
return this.workspace.customizations;
},
tabUid () {
return this.$vnode?.key;
},
isChanged () {
return JSON.stringify(this.originalRoutine) !== JSON.stringify(this.localRoutine);
},

View File

@ -157,6 +157,7 @@ export default {
WorkspaceTabPropsSchedulerTimingModal
},
props: {
tabUid: String,
connection: Object,
scheduler: String,
isSelected: Boolean,
@ -204,9 +205,6 @@ export default {
workspace () {
return this.getWorkspace(this.connection.uid);
},
tabUid () {
return this.$vnode?.key;
},
isChanged () {
return JSON.stringify(this.originalScheduler) !== JSON.stringify(this.localScheduler);
},

View File

@ -196,6 +196,7 @@ export default {
WorkspaceTabPropsTableForeignModal
},
props: {
tabUid: String,
connection: Object,
isSelected: Boolean,
table: String,
@ -250,9 +251,6 @@ export default {
workspace () {
return this.getWorkspace(this.connection.uid);
},
tabUid () {
return this.$vnode?.key;
},
defaultEngine () {
const engine = this.getDatabaseVariable(this.connection.uid, 'default_storage_engine');
return engine ? engine.value : '';

View File

@ -344,6 +344,7 @@
<script>
import { storeToRefs } from 'pinia';
import { useNotificationsStore } from '@/stores/notifications';
import { useWorkspacesStore } from '@/stores/workspaces';
import ConfirmModal from '@/components/BaseConfirmModal';

View File

@ -145,6 +145,7 @@ export default {
QueryEditor
},
props: {
tabUid: String,
connection: Object,
trigger: String,
isSelected: Boolean,
@ -192,9 +193,6 @@ export default {
workspace () {
return this.getWorkspace(this.connection.uid);
},
tabUid () {
return this.$vnode?.key;
},
customizations () {
return this.workspace.customizations;
},

View File

@ -119,6 +119,7 @@ export default {
ModalAskParameters
},
props: {
tabUid: String,
connection: Object,
function: String,
isSelected: Boolean,
@ -170,9 +171,6 @@ export default {
customizations () {
return this.workspace.customizations;
},
tabUid () {
return this.$vnode?.key;
},
isChanged () {
return JSON.stringify(this.originalFunction) !== JSON.stringify(this.localFunction);
},

View File

@ -134,6 +134,7 @@ export default {
QueryEditor
},
props: {
tabUid: String,
connection: Object,
isSelected: Boolean,
schema: String,
@ -178,9 +179,6 @@ export default {
workspace () {
return this.getWorkspace(this.connection.uid);
},
tabUid () {
return this.$vnode?.key;
},
isChanged () {
return JSON.stringify(this.originalView) !== JSON.stringify(this.localView);
},

View File

@ -211,6 +211,7 @@ export default {
},
mixins: [tableTabs],
props: {
tabUid: String,
connection: Object,
tab: Object,
isSelected: Boolean
@ -261,9 +262,6 @@ export default {
workspace () {
return this.getWorkspace(this.connection.uid);
},
tabUid () {
return this.$vnode?.key;
},
breadcrumbsSchema () {
return this.workspace.breadcrumbs.schema || null;
},