Skip to content

Commit

Permalink
Merge pull request #407 from KxSystems/KXI-52704
Browse files Browse the repository at this point in the history
KXI-52704 - label issues
  • Loading branch information
Philip-Carneiro-KX authored Aug 21, 2024
2 parents e3fc833 + 845577f commit ed4060d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/services/connectionManagerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions src/webview/components/kdbNewConnectionView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export class KdbNewConnectionView extends LitElement {
: serverType === ServerType.KDB
? html`<vscode-text-field
class="text-field larger option-title"
placeholder="Server 1"
placeholder="Server-1"
value="${this.kdbServer.serverAlias}"
@input="${(event: Event) =>
(this.kdbServer.serverAlias = (
Expand All @@ -171,7 +171,7 @@ export class KdbNewConnectionView extends LitElement {
</vscode-text-field>`
: html`<vscode-text-field
class="text-field larger option-title"
placeholder="Insights 1"
placeholder="Insights-1"
value="${this.insightsServer.alias}"
@input="${(event: Event) =>
(this.insightsServer.alias = (
Expand Down Expand Up @@ -360,7 +360,7 @@ export class KdbNewConnectionView extends LitElement {
<vscode-text-field
class="text-field larger option-title"
value="${this.newLblName}"
@change="${(event: Event) => {
@keyup="${(event: Event) => {
this.newLblName = (event.target as HTMLInputElement).value;
this.requestUpdate();
}}"
Expand Down
6 changes: 3 additions & 3 deletions test/suite/webview.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});

Expand Down

0 comments on commit ed4060d

Please sign in to comment.