connection workflow

This commit is contained in:
Jan Prochazka
2022-05-19 12:13:46 +02:00
parent 2f8282cbce
commit 96b2c7280d
9 changed files with 82 additions and 17 deletions

View File

@@ -5,7 +5,7 @@ export function getDatabaseFileLabel(databaseFile) {
return databaseFile;
}
export default function getConnectionLabel(connection, { allowExplicitDatabase = true } = {}) {
function getConnectionLabelCore(connection, { allowExplicitDatabase = true } = {}) {
if (!connection) {
return null;
}
@@ -27,3 +27,13 @@ export default function getConnectionLabel(connection, { allowExplicitDatabase =
return '';
}
export default function getConnectionLabel(connection, { allowExplicitDatabase = true, showUnsaved = false } = {}) {
const res = getConnectionLabelCore(connection, { allowExplicitDatabase });
if (res && showUnsaved && connection?.unsaved) {
return `${res} - unsaved`;
}
return res;
}

View File

@@ -148,6 +148,9 @@ export async function duplicateTab(tab) {
}
export function getTabDbKey(tab) {
if (tab.tabComponent == 'ConnectionTab') {
return 'connections.';
}
if (tab.props && tab.props.conid && tab.props.database) {
return `database://${tab.props.database}-${tab.props.conid}`;
}