From 21e827f11eb5d1d4f5ae87489a795aa3d64e10b3 Mon Sep 17 00:00:00 2001 From: Philip Carneiro Date: Wed, 21 Aug 2024 09:49:11 +0100 Subject: [PATCH 1/4] solve placeholder issue --- src/webview/components/kdbNewConnectionView.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/webview/components/kdbNewConnectionView.ts b/src/webview/components/kdbNewConnectionView.ts index cc1d551f..d2e06b57 100644 --- a/src/webview/components/kdbNewConnectionView.ts +++ b/src/webview/components/kdbNewConnectionView.ts @@ -161,7 +161,7 @@ export class KdbNewConnectionView extends LitElement { : serverType === ServerType.KDB ? html` { this.newLblName = (event.target as HTMLInputElement).value; this.requestUpdate(); }}" From c108b8a4f8249fa62f2a08049a484fe2bfe38d67 Mon Sep 17 00:00:00 2001 From: Philip Carneiro Date: Wed, 21 Aug 2024 10:00:51 +0100 Subject: [PATCH 3/4] labels with connected connection will open when connect --- src/services/connectionManagerService.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/services/connectionManagerService.ts b/src/services/connectionManagerService.ts index 1df1ab20..1a509bad 100644 --- a/src/services/connectionManagerService.ts +++ b/src/services/connectionManagerService.ts @@ -32,6 +32,7 @@ import { Insights } from "../models/insights"; import { Server } from "../models/server"; import { refreshDataSourcesPanel } from "../utils/dataSource"; import { MetaInfoType } from "../models/meta"; +import { retrieveConnLabelsNames } from "../utils/connLabel"; export class ConnectionManagementService { public retrieveConnection( @@ -232,6 +233,8 @@ export class ConnectionManagementService { } public isConnectedBehaviour(connNode: KdbNode | InsightsNode): void { + ext.latestLblsChanged.length = 0; + ext.latestLblsChanged.push(...retrieveConnLabelsNames(connNode)); ext.connectedContextStrings.push(connNode.label); commands.executeCommand( "setContext", From 845577f068208a7eb2824daed12af73b0891c283 Mon Sep 17 00:00:00 2001 From: Philip Carneiro Date: Wed, 21 Aug 2024 13:04:52 +0100 Subject: [PATCH 4/4] fix tests --- test/suite/webview.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/suite/webview.test.ts b/test/suite/webview.test.ts index e239b6dd..4a5f9c7d 100644 --- a/test/suite/webview.test.ts +++ b/test/suite/webview.test.ts @@ -334,19 +334,19 @@ describe("KdbNewConnectionView", () => { describe("renderServerNameField", () => { it("should render server name field for bundled q", () => { const result = view.renderServerNameField(ServerType.KDB, true); - assert.strictEqual(result.strings[0].includes("Server 1"), false); + assert.strictEqual(result.strings[0].includes("Server-1"), false); }); it("should render server name field for KDB", () => { view.isBundledQ = false; const result = view.renderServerNameField(ServerType.KDB); - assert.strictEqual(result.strings[0].includes("Server 1"), true); + assert.strictEqual(result.strings[0].includes("Server-1"), true); }); it("should render server name field for Insights", () => { view.isBundledQ = false; const result = view.renderServerNameField(ServerType.INSIGHTS, false); - assert.strictEqual(result.strings[0].includes("Insights 1"), true); + assert.strictEqual(result.strings[0].includes("Insights-1"), true); }); });