mirror of
https://github.com/Fabio286/antares.git
synced 2025-02-03 02:37:49 +01:00
fix: missing table on insert new records on session restored tabs
This commit is contained in:
parent
985e5d3527
commit
8c83b3f144
@ -10,7 +10,7 @@
|
|||||||
:key="connection.uid"
|
:key="connection.uid"
|
||||||
:connection="connection"
|
:connection="connection"
|
||||||
/>
|
/>
|
||||||
<div class="connection-panel-wrapper">
|
<div class="connection-panel-wrapper p-relative">
|
||||||
<WorkspaceAddConnectionPanel v-if="selectedWorkspace === 'NEW'" />
|
<WorkspaceAddConnectionPanel v-if="selectedWorkspace === 'NEW'" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -112,6 +112,8 @@ import BaseSelect from '@/components/BaseSelect.vue';
|
|||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
tabUid: [String, Number],
|
tabUid: [String, Number],
|
||||||
|
schema: String,
|
||||||
|
table: String,
|
||||||
fields: Array as Prop<TableField[]>,
|
fields: Array as Prop<TableField[]>,
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
rowToDuplicate: Object as Prop<any>,
|
rowToDuplicate: Object as Prop<any>,
|
||||||
@ -125,8 +127,6 @@ const workspacesStore = useWorkspacesStore();
|
|||||||
|
|
||||||
const { getSelected: selectedWorkspace } = storeToRefs(workspacesStore);
|
const { getSelected: selectedWorkspace } = storeToRefs(workspacesStore);
|
||||||
|
|
||||||
const { getWorkspace } = workspacesStore;
|
|
||||||
|
|
||||||
const { trapRef } = useFocusTrap({ disableAutofocus: true });
|
const { trapRef } = useFocusTrap({ disableAutofocus: true });
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
@ -136,7 +136,6 @@ const nInserts = ref(1);
|
|||||||
const isInserting = ref(false);
|
const isInserting = ref(false);
|
||||||
const fakerLocale = ref('en');
|
const fakerLocale = ref('en');
|
||||||
|
|
||||||
const workspace = computed(() => getWorkspace(selectedWorkspace.value));
|
|
||||||
const foreignKeys = computed(() => props.keyUsage.map(key => key.field));
|
const foreignKeys = computed(() => props.keyUsage.map(key => key.field));
|
||||||
const hasFakes = computed(() => Object.keys(localRow.value).some(field => 'group' in localRow.value[field] && localRow.value[field].group !== 'manual'));
|
const hasFakes = computed(() => Object.keys(localRow.value).some(field => 'group' in localRow.value[field] && localRow.value[field].group !== 'manual'));
|
||||||
|
|
||||||
@ -222,8 +221,8 @@ const insertRows = async () => {
|
|||||||
try {
|
try {
|
||||||
const { status, response } = await Tables.insertTableFakeRows({
|
const { status, response } = await Tables.insertTableFakeRows({
|
||||||
uid: selectedWorkspace.value,
|
uid: selectedWorkspace.value,
|
||||||
schema: workspace.value.breadcrumbs.schema,
|
schema: props.schema,
|
||||||
table: workspace.value.breadcrumbs.table,
|
table: props.table,
|
||||||
row: rowToInsert,
|
row: rowToInsert,
|
||||||
repeat: nInserts.value,
|
repeat: nInserts.value,
|
||||||
fields: fieldTypes,
|
fields: fieldTypes,
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<div class="footer-right-elements">
|
<div class="footer-right-elements">
|
||||||
<ul class="footer-elements">
|
<ul class="footer-elements">
|
||||||
<li
|
<li
|
||||||
v-if="workspace.connectionStatus === 'connected' "
|
v-if="workspace?.connectionStatus === 'connected' "
|
||||||
class="footer-element footer-link"
|
class="footer-element footer-link"
|
||||||
@click="toggleConsole()"
|
@click="toggleConsole()"
|
||||||
>
|
>
|
||||||
|
@ -560,7 +560,8 @@ setTimeout(() => {
|
|||||||
.connection-panel {
|
.connection-panel {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: .5rem;
|
||||||
|
margin-top: 1.5rem;
|
||||||
|
|
||||||
.panel {
|
.panel {
|
||||||
min-width: 450px;
|
min-width: 450px;
|
||||||
|
@ -163,6 +163,8 @@
|
|||||||
:row-to-duplicate="rowToDuplicate"
|
:row-to-duplicate="rowToDuplicate"
|
||||||
:key-usage="keyUsage"
|
:key-usage="keyUsage"
|
||||||
:tab-uid="tabUid"
|
:tab-uid="tabUid"
|
||||||
|
:schema="schema"
|
||||||
|
:table="table"
|
||||||
@hide="hideFakerModal"
|
@hide="hideFakerModal"
|
||||||
@reload="reloadTable"
|
@reload="reloadTable"
|
||||||
/>
|
/>
|
||||||
@ -237,7 +239,7 @@ const customizations = computed(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const isTable = computed(() => {
|
const isTable = computed(() => {
|
||||||
return !!workspace.value.breadcrumbs.table;
|
return !workspace.value.breadcrumbs.view;
|
||||||
});
|
});
|
||||||
|
|
||||||
const fields = computed(() => {
|
const fields = computed(() => {
|
||||||
@ -355,7 +357,7 @@ const onKey = (e: KeyboardEvent) => {
|
|||||||
pageChange('next');
|
pageChange('next');
|
||||||
if (e.key === 'ArrowLeft')
|
if (e.key === 'ArrowLeft')
|
||||||
pageChange('prev');
|
pageChange('prev');
|
||||||
if (e.key === 'f') // f
|
if (e.key === 'f')
|
||||||
isSearch.value = !isSearch.value;
|
isSearch.value = !isSearch.value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user