Skip to content

Commit

Permalink
fix: missing tabs uid
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabio286 committed Apr 30, 2022
1 parent cdbadbb commit 18b66b5
Show file tree
Hide file tree
Showing 19 changed files with 35 additions and 49 deletions.
2 changes: 1 addition & 1 deletion src/renderer/components/ModalProcessesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/QueryEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -59,7 +60,7 @@ export default {
cursorPosition: 0,
fields: [],
customCompleter: [],
id: null,
id: uidGen(),
lastSchema: null
};
},
Expand Down Expand Up @@ -226,7 +227,6 @@ export default {
}
},
created () {
this.id = this._uid;
this.lastSchema = this.schema;
},
mounted () {
Expand Down
16 changes: 16 additions & 0 deletions src/renderer/components/Workspace.vue
Original file line number Diff line number Diff line change
Expand Up @@ -319,13 +319,15 @@
<WorkspaceTabQuery
v-if="tab.type==='query'"
:key="tab.uid"
:tab-uid="tab.uid"
:tab="tab"
:is-selected="selectedTab === tab.uid"
:connection="connection"
/>
<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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand Down
4 changes: 1 addition & 3 deletions src/renderer/components/WorkspaceTabNewFunction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ export default {
WorkspaceTabPropsFunctionParamsModal
},
props: {
tabUid: String,
connection: Object,
tab: Object,
isSelected: Boolean,
Expand Down Expand Up @@ -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);
},
Expand Down
4 changes: 1 addition & 3 deletions src/renderer/components/WorkspaceTabNewRoutine.vue
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ export default {
WorkspaceTabPropsRoutineParamsModal
},
props: {
tabUid: String,
connection: Object,
tab: Object,
isSelected: Boolean,
Expand Down Expand Up @@ -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);
},
Expand Down
4 changes: 1 addition & 3 deletions src/renderer/components/WorkspaceTabNewScheduler.vue
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ export default {
WorkspaceTabPropsSchedulerTimingModal
},
props: {
tabUid: String,
connection: Object,
tab: Object,
isSelected: Boolean,
Expand Down Expand Up @@ -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);
},
Expand Down
4 changes: 1 addition & 3 deletions src/renderer/components/WorkspaceTabNewTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ export default {
WorkspaceTabNewTableEmptyState
},
props: {
tabUid: String,
connection: Object,
tab: Object,
isSelected: Boolean,
Expand Down Expand Up @@ -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 || '';
Expand Down
4 changes: 1 addition & 3 deletions src/renderer/components/WorkspaceTabNewTrigger.vue
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ export default {
QueryEditor
},
props: {
tabUid: String,
connection: Object,
tab: Object,
isSelected: Boolean,
Expand Down Expand Up @@ -195,9 +196,6 @@ export default {
workspace () {
return this.getWorkspace(this.connection.uid);
},
tabUid () {
return this.$vnode?.key;
},
customizations () {
return this.workspace.customizations;
},
Expand Down
4 changes: 1 addition & 3 deletions src/renderer/components/WorkspaceTabNewTriggerFunction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export default {
QueryEditor
},
props: {
tabUid: String,
connection: Object,
tab: Object,
isSelected: Boolean,
Expand Down Expand Up @@ -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);
},
Expand Down
4 changes: 1 addition & 3 deletions src/renderer/components/WorkspaceTabNewView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export default {
QueryEditor
},
props: {
tabUid: String,
connection: Object,
tab: Object,
isSelected: Boolean,
Expand Down Expand Up @@ -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);
},
Expand Down
4 changes: 1 addition & 3 deletions src/renderer/components/WorkspaceTabPropsFunction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ export default {
ModalAskParameters
},
props: {
tabUid: String,
connection: Object,
function: String,
isSelected: Boolean,
Expand Down Expand Up @@ -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);
},
Expand Down
5 changes: 1 addition & 4 deletions src/renderer/components/WorkspaceTabPropsRoutine.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -198,6 +197,7 @@ export default {
ModalAskParameters
},
props: {
tabUid: String,
connection: Object,
routine: String,
isSelected: Boolean,
Expand Down Expand Up @@ -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);
},
Expand Down
4 changes: 1 addition & 3 deletions src/renderer/components/WorkspaceTabPropsScheduler.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ export default {
WorkspaceTabPropsSchedulerTimingModal
},
props: {
tabUid: String,
connection: Object,
scheduler: String,
isSelected: Boolean,
Expand Down Expand Up @@ -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);
},
Expand Down
4 changes: 1 addition & 3 deletions src/renderer/components/WorkspaceTabPropsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ export default {
WorkspaceTabPropsTableForeignModal
},
props: {
tabUid: String,
connection: Object,
isSelected: Boolean,
table: String,
Expand Down Expand Up @@ -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 : '';
Expand Down
1 change: 1 addition & 0 deletions src/renderer/components/WorkspaceTabPropsTableRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@

<script>
import { storeToRefs } from 'pinia';
import { useNotificationsStore } from '@/stores/notifications';
import { useWorkspacesStore } from '@/stores/workspaces';
import ConfirmModal from '@/components/BaseConfirmModal';
Expand Down
4 changes: 1 addition & 3 deletions src/renderer/components/WorkspaceTabPropsTrigger.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ export default {
QueryEditor
},
props: {
tabUid: String,
connection: Object,
trigger: String,
isSelected: Boolean,
Expand Down Expand Up @@ -192,9 +193,6 @@ export default {
workspace () {
return this.getWorkspace(this.connection.uid);
},
tabUid () {
return this.$vnode?.key;
},
customizations () {
return this.workspace.customizations;
},
Expand Down
Loading

0 comments on commit 18b66b5

Please sign in to comment.