mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-30 16:13:58 +00:00
table editor - mark tab unsaved
This commit is contained in:
@@ -55,7 +55,7 @@
|
|||||||
import ToolStripCommandButton from '../buttons/ToolStripCommandButton.svelte';
|
import ToolStripCommandButton from '../buttons/ToolStripCommandButton.svelte';
|
||||||
import ToolStripButton from '../buttons/ToolStripButton.svelte';
|
import ToolStripButton from '../buttons/ToolStripButton.svelte';
|
||||||
import hasPermission from '../utility/hasPermission';
|
import hasPermission from '../utility/hasPermission';
|
||||||
import { changeTab } from '../utility/common';
|
import { changeTab, markTabSaved, markTabUnsaved } from '../utility/common';
|
||||||
|
|
||||||
export let tabid;
|
export let tabid;
|
||||||
export let conid;
|
export let conid;
|
||||||
@@ -115,6 +115,7 @@
|
|||||||
if (errorMessage) {
|
if (errorMessage) {
|
||||||
showModal(ErrorMessageModal, { title: 'Error when saving', message: errorMessage });
|
showModal(ErrorMessageModal, { title: 'Error when saving', message: errorMessage });
|
||||||
} else {
|
} else {
|
||||||
|
markTabSaved(tabid);
|
||||||
await apiCall('database-connections/sync-model', { conid, database });
|
await apiCall('database-connections/sync-model', { conid, database });
|
||||||
showSnackbarSuccess('Saved to database');
|
showSnackbarSuccess('Saved to database');
|
||||||
const isCreateTable = $editorValue?.base == null;
|
const isCreateTable = $editorValue?.base == null;
|
||||||
@@ -152,7 +153,7 @@
|
|||||||
{resetCounter}
|
{resetCounter}
|
||||||
isCreateTable={objectTypeField == 'tables' && $editorValue && !$editorValue?.base}
|
isCreateTable={objectTypeField == 'tables' && $editorValue && !$editorValue?.base}
|
||||||
setTableInfo={objectTypeField == 'tables' && !$connection?.isReadOnly && hasPermission(`dbops/model/edit`)
|
setTableInfo={objectTypeField == 'tables' && !$connection?.isReadOnly && hasPermission(`dbops/model/edit`)
|
||||||
? tableInfoUpdater =>
|
? tableInfoUpdater => {
|
||||||
setEditorData(tbl =>
|
setEditorData(tbl =>
|
||||||
tbl
|
tbl
|
||||||
? {
|
? {
|
||||||
@@ -163,7 +164,9 @@
|
|||||||
base: tableInfoWithPairingId,
|
base: tableInfoWithPairingId,
|
||||||
current: tableInfoUpdater(tableInfoWithPairingId),
|
current: tableInfoUpdater(tableInfoWithPairingId),
|
||||||
}
|
}
|
||||||
)
|
);
|
||||||
|
markTabUnsaved(tabid);
|
||||||
|
}
|
||||||
: null}
|
: null}
|
||||||
/>
|
/>
|
||||||
<svelte:fragment slot="toolstrip">
|
<svelte:fragment slot="toolstrip">
|
||||||
|
|||||||
Reference in New Issue
Block a user