Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove labels when remove conn #402

Merged
merged 2 commits into from
Aug 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/commands/serverCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ export async function editInsightsConnection(
} else {
const oldKey = getKeyForServerName(oldAlias);
const newKey = insightsData.alias;
removeConnFromLabels(oldAlias);
if (insights[oldKey] && oldAlias !== insightsData.alias) {
removeConnFromLabels(oldAlias);
const uInsights = Object.keys(insights).filter((insight) => {
return insight !== oldKey;
});
Expand Down Expand Up @@ -452,6 +452,7 @@ export async function editKdbConnection(
return;
} else {
const oldKey = getKeyForServerName(oldAlias);
removeConnFromLabels(oldKey);
const newKey = kdbData.serverAlias;
const removedAuth =
editAuth && (kdbData.username === "" || kdbData.password === "");
Expand Down Expand Up @@ -526,6 +527,11 @@ export async function editKdbConnection(

export async function removeConnection(viewItem: KdbNode | InsightsNode) {
const connMngService = new ConnectionManagementService();
removeConnFromLabels(
viewItem instanceof KdbNode
? viewItem.details.serverAlias
: viewItem.details.alias,
);
await connMngService.removeConnection(viewItem);
}

Expand Down