Skip to content

Commit 38fd783

Browse files
authored
Merge pull request #686 from KxSystems/ee-fixes
[fix] Cannot create or edit MyQ connection
2 parents 1199388 + 9938dbd commit 38fd783

22 files changed

+108
-567
lines changed

package-lock.json

Lines changed: 17 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/commands/serverCommand.ts

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,9 @@ import { MetaContentProvider } from "../services/metaContentProvider";
6161
import { inputVariable } from "../services/notebookProviders";
6262
import { handleLabelsConnMap, removeConnFromLabels } from "../utils/connLabel";
6363
import {
64-
addLocalConnectionContexts,
6564
checkOpenSslInstalled,
6665
getInsights,
6766
getKeyForServerName,
68-
getServerName,
6967
getServers,
7068
offerReconnectionAfterEdit,
7169
updateInsights,
@@ -117,7 +115,7 @@ export async function addInsightsConnection(
117115
insightsData: InsightDetails,
118116
labels?: string[],
119117
) {
120-
const aliasValidation = validateServerAlias(insightsData.alias, false);
118+
const aliasValidation = validateServerAlias(insightsData.alias);
121119
if (aliasValidation) {
122120
notify(aliasValidation, MessageKind.ERROR, { logger });
123121
return;
@@ -198,7 +196,7 @@ export async function editInsightsConnection(
198196
const aliasValidation =
199197
oldAlias === insightsData.alias
200198
? undefined
201-
: validateServerAlias(insightsData.alias, false);
199+
: validateServerAlias(insightsData.alias);
202200
if (aliasValidation) {
203201
notify(aliasValidation, MessageKind.ERROR, { logger });
204202
return;
@@ -422,10 +420,9 @@ export async function enableTLS(serverKey: string): Promise<void> {
422420

423421
export async function addKdbConnection(
424422
kdbData: ServerDetails,
425-
isLocal?: boolean,
426423
labels?: string[],
427424
): Promise<void> {
428-
const aliasValidation = validateServerAlias(kdbData.serverAlias, isLocal!);
425+
const aliasValidation = validateServerAlias(kdbData.serverAlias);
429426
const hostnameValidation = validateServerName(kdbData.serverName);
430427
const portValidation = validateServerPort(kdbData.serverPort);
431428
if (aliasValidation) {
@@ -460,25 +457,17 @@ export async function addKdbConnection(
460457
serverName: kdbData.serverName,
461458
serverPort: kdbData.serverPort,
462459
serverAlias: kdbData.serverAlias,
463-
managed: kdbData.serverAlias === "local",
464460
tls: kdbData.tls,
465461
},
466462
};
467-
if (servers.key.managed) {
468-
await addLocalConnectionContexts(getServerName(servers[0]));
469-
}
470463
} else {
471464
servers[key] = {
472465
auth: kdbData.auth,
473466
serverName: kdbData.serverName,
474467
serverPort: kdbData.serverPort,
475468
serverAlias: kdbData.serverAlias,
476-
managed: kdbData.serverAlias === "local",
477469
tls: kdbData.tls,
478470
};
479-
if (servers[key].managed) {
480-
await addLocalConnectionContexts(getServerName(servers[key]));
481-
}
482471
}
483472

484473
await updateServers(servers);
@@ -510,15 +499,14 @@ export async function addKdbConnection(
510499
export async function editKdbConnection(
511500
kdbData: ServerDetails,
512501
oldAlias: string,
513-
isLocal?: boolean,
514502
editAuth?: boolean,
515503
labels?: string[],
516504
) {
517505
/* c8 ignore start */
518506
const aliasValidation =
519507
oldAlias === kdbData.serverAlias
520508
? undefined
521-
: validateServerAlias(kdbData.serverAlias, isLocal!);
509+
: validateServerAlias(kdbData.serverAlias);
522510
const hostnameValidation = validateServerName(kdbData.serverName);
523511
const portValidation = validateServerPort(kdbData.serverPort);
524512
if (aliasValidation) {
@@ -583,7 +571,6 @@ export async function editKdbConnection(
583571
serverName: kdbData.serverName,
584572
serverPort: kdbData.serverPort,
585573
serverAlias: kdbData.serverAlias,
586-
managed: kdbData.serverAlias === "local",
587574
tls: kdbData.tls,
588575
};
589576

@@ -599,7 +586,6 @@ export async function editKdbConnection(
599586
serverName: kdbData.serverName,
600587
serverPort: kdbData.serverPort,
601588
serverAlias: kdbData.serverAlias,
602-
managed: kdbData.serverAlias === "local",
603589
tls: kdbData.tls,
604590
};
605591

@@ -767,8 +753,7 @@ export async function addImportedConnections(
767753
counter++;
768754
}
769755
connection.serverAlias = alias;
770-
const isManaged = alias === "local";
771-
await addKdbConnection(connection, isManaged);
756+
await addKdbConnection(connection);
772757
}
773758
existingAliases.add(alias);
774759
counter = 1;

src/extension.ts

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ import {
111111
getInsights,
112112
getServers,
113113
hasWorkspaceOrShowOption,
114-
initializeLocalServers,
115114
} from "./utils/core";
116115
import { handleFeedbackSurvey } from "./utils/feedbackSurveyUtils";
117116
import { getIconPath } from "./utils/iconsUtils";
@@ -129,7 +128,6 @@ export async function activate(context: vscode.ExtensionContext) {
129128
ext.context = context;
130129
ext.outputChannel = vscode.window.createOutputChannel("kdb");
131130
ext.openSslVersion = await checkOpenSslInstalled();
132-
ext.isBundleQCreated = false;
133131

134132
getWorkspaceLabelsConnMap();
135133
getWorkspaceLabels();
@@ -181,12 +179,6 @@ export async function activate(context: vscode.ExtensionContext) {
181179
new HelpFeedbackProvider(),
182180
);
183181

184-
// initialize local servers
185-
if (servers !== undefined) {
186-
initializeLocalServers(servers);
187-
ext.serverProvider.refresh(servers);
188-
}
189-
190182
// initialize the secret store
191183
AuthSettings.init(context);
192184
ext.secretSettings = AuthSettings.instance;
@@ -760,13 +752,7 @@ function registerConnectionsCommands(): CommandRegistration[] {
760752
{
761753
command: "kdb.connections.add.kdb",
762754
callback: async (kdbData: ServerDetails, labels: string[]) => {
763-
await addKdbConnection(kdbData, false, labels);
764-
},
765-
},
766-
{
767-
command: "kdb.connections.add.bundleq",
768-
callback: async (kdbData: ServerDetails, labels: string[]) => {
769-
await addKdbConnection(kdbData, true, labels);
755+
await addKdbConnection(kdbData, labels);
770756
},
771757
},
772758
{
@@ -787,17 +773,7 @@ function registerConnectionsCommands(): CommandRegistration[] {
787773
editAuth: boolean,
788774
labels: string[],
789775
) => {
790-
await editKdbConnection(kdbData, oldAlias, false, editAuth, labels);
791-
},
792-
},
793-
{
794-
command: "kdb.connections.edit.bundleq",
795-
callback: async (
796-
kdbData: ServerDetails,
797-
oldAlias: string,
798-
labels: string[],
799-
) => {
800-
await editKdbConnection(kdbData, oldAlias, true, false, labels);
776+
await editKdbConnection(kdbData, oldAlias, editAuth, labels);
801777
},
802778
},
803779
{

src/extensionVariables.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import { kdbAuthMap } from "./models/connectionsModels";
2727
import { CustomAuth } from "./models/customAuth";
2828
import { DataSourceFiles } from "./models/dataSource";
2929
import { ConnectionLabel, LabelColors, Labels } from "./models/labels";
30-
import { LocalProcess } from "./models/localProcess";
3130
import { MetaObjectPayload } from "./models/meta";
3231
import { QueryHistory } from "./models/queryHistory";
3332
import { ScratchpadFile } from "./models/scratchpad";
@@ -67,7 +66,6 @@ export namespace ext {
6766
export let openSslVersion: string | null;
6867
export let resultPanelCSV: string;
6968
export let isDatasourceExecution: boolean;
70-
export let isBundleQCreated: boolean;
7169
export const rowLimit = 150000000;
7270

7371
export let activeConnection: LocalConnection | InsightsConnection | undefined;
@@ -121,11 +119,6 @@ export namespace ext {
121119
suggestFeature: "https://kx-features.ideas.aha.io/ideas/new",
122120
reportBug: "https://github.com/KxSystems/kx-vscode/issues/new?labels=bug",
123121
};
124-
export const localProcessObjects: LocalProcess = {};
125-
// eslint-disable-next-line prefer-const
126-
export let localConnectionContexts: Array<string> = [];
127-
// eslint-disable-next-line prefer-const
128-
export let localConnectionStatus: Array<string> = [];
129122

130123
export const kdbLicName = "kc.lic";
131124
export const kdbInstallUrl =

src/models/connectionsModels.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export interface ServerDetails {
2828
serverPort: string;
2929
auth: boolean;
3030
serverAlias: string;
31-
managed: boolean;
3231
tls: boolean;
3332
username?: string;
3433
password?: string;

src/models/localProcess.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)