mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Fix IConnectionProfile to have same options key when generated from ConnectionProfile (#22840)
This commit is contained in:
@@ -284,6 +284,7 @@ export class ConnectionProfile extends ProviderConnectionInfo implements interfa
|
|||||||
serverName: this.serverName,
|
serverName: this.serverName,
|
||||||
databaseName: this.databaseName,
|
databaseName: this.databaseName,
|
||||||
authenticationType: this.authenticationType,
|
authenticationType: this.authenticationType,
|
||||||
|
serverCapabilities: this.serverCapabilities,
|
||||||
getOptionsKey: this.getOptionsKey,
|
getOptionsKey: this.getOptionsKey,
|
||||||
matches: this.matches,
|
matches: this.matches,
|
||||||
groupId: this.groupId,
|
groupId: this.groupId,
|
||||||
|
|||||||
@@ -4,11 +4,13 @@
|
|||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import * as azdata from 'azdata';
|
import * as azdata from 'azdata';
|
||||||
|
import { ConnectionProviderProperties } from 'sql/platform/capabilities/common/capabilitiesService';
|
||||||
|
|
||||||
// Used to allow various methods of matching profiles
|
// Used to allow various methods of matching profiles
|
||||||
export type ProfileMatcher = (a: IConnectionProfile, b: IConnectionProfile) => boolean;
|
export type ProfileMatcher = (a: IConnectionProfile, b: IConnectionProfile) => boolean;
|
||||||
|
|
||||||
export interface IConnectionProfile extends azdata.IConnectionProfile {
|
export interface IConnectionProfile extends azdata.IConnectionProfile {
|
||||||
|
serverCapabilities: ConnectionProviderProperties | undefined;
|
||||||
getOptionsKey(getOriginalOptions?: boolean): string;
|
getOptionsKey(getOriginalOptions?: boolean): string;
|
||||||
matches(profile: azdata.IConnectionProfile): boolean;
|
matches(profile: azdata.IConnectionProfile): boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export class ProviderConnectionInfo implements azdata.ConnectionInfo {
|
|||||||
this.providerName = isString(model) ? model : 'providerName' in model ? model.providerName : model.providerId;
|
this.providerName = isString(model) ? model : 'providerName' in model ? model.providerName : model.providerId;
|
||||||
|
|
||||||
if (!isString(model)) {
|
if (!isString(model)) {
|
||||||
if (model.options && this.hasServerCapabilities()) {
|
if (model.options && this.serverCapabilities) {
|
||||||
this.serverCapabilities.connectionOptions.forEach(option => {
|
this.serverCapabilities.connectionOptions.forEach(option => {
|
||||||
let value = model.options[option.name];
|
let value = model.options[option.name];
|
||||||
this.options[option.name] = value;
|
this.options[option.name] = value;
|
||||||
@@ -136,7 +136,7 @@ export class ProviderConnectionInfo implements azdata.ConnectionInfo {
|
|||||||
|
|
||||||
private getServerInfo() {
|
private getServerInfo() {
|
||||||
let title = '';
|
let title = '';
|
||||||
if (this.hasServerCapabilities()) {
|
if (this.serverCapabilities) {
|
||||||
title = this.serverName;
|
title = this.serverName;
|
||||||
// Only show database name if the provider supports it.
|
// Only show database name if the provider supports it.
|
||||||
if (this.serverCapabilities.connectionOptions?.find(option => option.specialValueType === ConnectionOptionSpecialType.databaseName)) {
|
if (this.serverCapabilities.connectionOptions?.find(option => option.specialValueType === ConnectionOptionSpecialType.databaseName)) {
|
||||||
@@ -153,7 +153,7 @@ export class ProviderConnectionInfo implements azdata.ConnectionInfo {
|
|||||||
public get title(): string {
|
public get title(): string {
|
||||||
let label = '';
|
let label = '';
|
||||||
|
|
||||||
if (this.hasServerCapabilities()) {
|
if (this.serverCapabilities) {
|
||||||
if (this.connectionName) {
|
if (this.connectionName) {
|
||||||
label = this.connectionName;
|
label = this.connectionName;
|
||||||
} else {
|
} else {
|
||||||
@@ -169,10 +169,6 @@ export class ProviderConnectionInfo implements azdata.ConnectionInfo {
|
|||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
||||||
public hasServerCapabilities(): boolean {
|
|
||||||
return (this.serverCapabilities !== undefined);
|
|
||||||
}
|
|
||||||
|
|
||||||
public hasLoaded(): boolean {
|
public hasLoaded(): boolean {
|
||||||
return Object.keys(this.capabilitiesService.providers).length > 0;
|
return Object.keys(this.capabilitiesService.providers).length > 0;
|
||||||
}
|
}
|
||||||
@@ -187,7 +183,7 @@ export class ProviderConnectionInfo implements azdata.ConnectionInfo {
|
|||||||
|
|
||||||
public isPasswordRequired(): boolean {
|
public isPasswordRequired(): boolean {
|
||||||
// if there is no provider capabilities metadata assume a password is not required
|
// if there is no provider capabilities metadata assume a password is not required
|
||||||
if (!this.hasServerCapabilities()) {
|
if (!this.serverCapabilities) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,7 +214,7 @@ export class ProviderConnectionInfo implements azdata.ConnectionInfo {
|
|||||||
public getOptionsKey(getOriginalOptions?: boolean): string {
|
public getOptionsKey(getOriginalOptions?: boolean): string {
|
||||||
let useFullOptions = false;
|
let useFullOptions = false;
|
||||||
let idNames = [];
|
let idNames = [];
|
||||||
if (this.hasServerCapabilities()) {
|
if (this.serverCapabilities) {
|
||||||
useFullOptions = this.serverCapabilities.useFullOptions;
|
useFullOptions = this.serverCapabilities.useFullOptions;
|
||||||
idNames = this.serverCapabilities.connectionOptions.map(o => {
|
idNames = this.serverCapabilities.connectionOptions.map(o => {
|
||||||
// All options enabled, use every property besides password.
|
// All options enabled, use every property besides password.
|
||||||
@@ -299,7 +295,7 @@ export class ProviderConnectionInfo implements azdata.ConnectionInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public getSpecialTypeOptionName(type: string): string | undefined {
|
public getSpecialTypeOptionName(type: string): string | undefined {
|
||||||
if (this.hasServerCapabilities()) {
|
if (this.serverCapabilities) {
|
||||||
let optionMetadata = this.serverCapabilities.connectionOptions.find(o => o.specialValueType === type);
|
let optionMetadata = this.serverCapabilities.connectionOptions.find(o => o.specialValueType === type);
|
||||||
return !!optionMetadata ? optionMetadata.name : undefined;
|
return !!optionMetadata ? optionMetadata.name : undefined;
|
||||||
} else {
|
} else {
|
||||||
@@ -315,7 +311,7 @@ export class ProviderConnectionInfo implements azdata.ConnectionInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public get authenticationTypeDisplayName(): string {
|
public get authenticationTypeDisplayName(): string {
|
||||||
let optionMetadata = this.hasServerCapabilities() ? this.serverCapabilities.connectionOptions.find(o => o.specialValueType === ConnectionOptionSpecialType.authType) : undefined;
|
let optionMetadata = this.serverCapabilities ? this.serverCapabilities.connectionOptions.find(o => o.specialValueType === ConnectionOptionSpecialType.authType) : undefined;
|
||||||
let authType = this.authenticationType;
|
let authType = this.authenticationType;
|
||||||
let displayName: string = authType;
|
let displayName: string = authType;
|
||||||
|
|
||||||
@@ -361,7 +357,7 @@ export class ProviderConnectionInfo implements azdata.ConnectionInfo {
|
|||||||
public getConnectionOptionsList(needSpecial: boolean, getNonDefault: boolean): azdata.ConnectionOption[] {
|
public getConnectionOptionsList(needSpecial: boolean, getNonDefault: boolean): azdata.ConnectionOption[] {
|
||||||
let connectionOptions: azdata.ConnectionOption[] = [];
|
let connectionOptions: azdata.ConnectionOption[] = [];
|
||||||
|
|
||||||
if (this.hasServerCapabilities()) {
|
if (this.serverCapabilities) {
|
||||||
this.serverCapabilities.connectionOptions.forEach(element => {
|
this.serverCapabilities.connectionOptions.forEach(element => {
|
||||||
if (((!needSpecial && element.specialValueType !== ConnectionOptionSpecialType.serverName &&
|
if (((!needSpecial && element.specialValueType !== ConnectionOptionSpecialType.serverName &&
|
||||||
element.specialValueType !== ConnectionOptionSpecialType.databaseName &&
|
element.specialValueType !== ConnectionOptionSpecialType.databaseName &&
|
||||||
|
|||||||
@@ -301,6 +301,7 @@ suite('ConnectionConfig', () => {
|
|||||||
groupFullName: undefined,
|
groupFullName: undefined,
|
||||||
groupId: undefined,
|
groupId: undefined,
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: {},
|
options: {},
|
||||||
@@ -333,6 +334,7 @@ suite('ConnectionConfig', () => {
|
|||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: undefined,
|
groupFullName: undefined,
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: {},
|
options: {},
|
||||||
@@ -365,6 +367,7 @@ suite('ConnectionConfig', () => {
|
|||||||
groupFullName: 'g2/g2-2',
|
groupFullName: 'g2/g2-2',
|
||||||
groupId: undefined,
|
groupId: undefined,
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: {},
|
options: {},
|
||||||
@@ -508,6 +511,7 @@ suite('ConnectionConfig', () => {
|
|||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: {},
|
options: {},
|
||||||
@@ -538,6 +542,7 @@ suite('ConnectionConfig', () => {
|
|||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: {},
|
options: {},
|
||||||
@@ -575,6 +580,7 @@ suite('ConnectionConfig', () => {
|
|||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'newid',
|
groupId: 'newid',
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: {},
|
options: {},
|
||||||
@@ -655,6 +661,7 @@ suite('ConnectionConfig', () => {
|
|||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
getOptionsKey: () => { return 'connectionId'; },
|
getOptionsKey: () => { return 'connectionId'; },
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: {},
|
options: {},
|
||||||
@@ -672,6 +679,7 @@ suite('ConnectionConfig', () => {
|
|||||||
groupFullName: 'test',
|
groupFullName: 'test',
|
||||||
groupId: 'test',
|
groupId: 'test',
|
||||||
getOptionsKey: () => { return 'connectionId'; },
|
getOptionsKey: () => { return 'connectionId'; },
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: {},
|
options: {},
|
||||||
@@ -712,6 +720,7 @@ suite('ConnectionConfig', () => {
|
|||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
getOptionsKey: () => { return 'connectionId'; },
|
getOptionsKey: () => { return 'connectionId'; },
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: {
|
options: {
|
||||||
@@ -732,6 +741,7 @@ suite('ConnectionConfig', () => {
|
|||||||
groupFullName: 'test',
|
groupFullName: 'test',
|
||||||
groupId: 'test',
|
groupId: 'test',
|
||||||
getOptionsKey: () => { return 'connectionId'; },
|
getOptionsKey: () => { return 'connectionId'; },
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: { 'testProperty2': '15' },
|
options: { 'testProperty2': '15' },
|
||||||
@@ -770,6 +780,7 @@ suite('ConnectionConfig', () => {
|
|||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
getOptionsKey: () => { return 'connectionId'; },
|
getOptionsKey: () => { return 'connectionId'; },
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: {
|
options: {
|
||||||
@@ -790,6 +801,7 @@ suite('ConnectionConfig', () => {
|
|||||||
groupFullName: 'test',
|
groupFullName: 'test',
|
||||||
groupId: 'test',
|
groupId: 'test',
|
||||||
getOptionsKey: () => { return 'connectionId'; },
|
getOptionsKey: () => { return 'connectionId'; },
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: { 'testProperty1': 'nonDefault' },
|
options: { 'testProperty1': 'nonDefault' },
|
||||||
@@ -831,6 +843,7 @@ suite('ConnectionConfig', () => {
|
|||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
getOptionsKey: () => { return 'connectionId'; },
|
getOptionsKey: () => { return 'connectionId'; },
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: {
|
options: {
|
||||||
@@ -851,6 +864,7 @@ suite('ConnectionConfig', () => {
|
|||||||
groupFullName: 'test',
|
groupFullName: 'test',
|
||||||
groupId: 'test',
|
groupId: 'test',
|
||||||
getOptionsKey: () => { return 'connectionId'; },
|
getOptionsKey: () => { return 'connectionId'; },
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: { 'testProperty2': '15' },
|
options: { 'testProperty2': '15' },
|
||||||
@@ -889,6 +903,7 @@ suite('ConnectionConfig', () => {
|
|||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
getOptionsKey: () => { return 'connectionId'; },
|
getOptionsKey: () => { return 'connectionId'; },
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: {},
|
options: {},
|
||||||
@@ -991,6 +1006,7 @@ suite('ConnectionConfig', () => {
|
|||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
getOptionsKey: () => { return 'connectionId'; },
|
getOptionsKey: () => { return 'connectionId'; },
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: {},
|
options: {},
|
||||||
@@ -1008,6 +1024,7 @@ suite('ConnectionConfig', () => {
|
|||||||
groupFullName: 'test',
|
groupFullName: 'test',
|
||||||
groupId: 'test',
|
groupId: 'test',
|
||||||
getOptionsKey: () => { return 'connectionId'; },
|
getOptionsKey: () => { return 'connectionId'; },
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: {},
|
options: {},
|
||||||
@@ -1025,6 +1042,7 @@ suite('ConnectionConfig', () => {
|
|||||||
groupFullName: 'test',
|
groupFullName: 'test',
|
||||||
groupId: 'test',
|
groupId: 'test',
|
||||||
getOptionsKey: () => { return 'connectionId'; },
|
getOptionsKey: () => { return 'connectionId'; },
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: {},
|
options: {},
|
||||||
@@ -1059,6 +1077,7 @@ suite('ConnectionConfig', () => {
|
|||||||
groupFullName: 'test',
|
groupFullName: 'test',
|
||||||
groupId: 'test',
|
groupId: 'test',
|
||||||
getOptionsKey: () => { return 'connectionId'; },
|
getOptionsKey: () => { return 'connectionId'; },
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: {},
|
options: {},
|
||||||
@@ -1076,6 +1095,7 @@ suite('ConnectionConfig', () => {
|
|||||||
groupFullName: 'test',
|
groupFullName: 'test',
|
||||||
groupId: 'test',
|
groupId: 'test',
|
||||||
getOptionsKey: () => { return 'connectionId'; },
|
getOptionsKey: () => { return 'connectionId'; },
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: {},
|
options: {},
|
||||||
@@ -1093,6 +1113,7 @@ suite('ConnectionConfig', () => {
|
|||||||
groupFullName: 'test',
|
groupFullName: 'test',
|
||||||
groupId: 'test',
|
groupId: 'test',
|
||||||
getOptionsKey: () => { return 'connectionId'; },
|
getOptionsKey: () => { return 'connectionId'; },
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: {},
|
options: {},
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ suite('SQL ConnectionProfileInfo tests', () => {
|
|||||||
groupFullName: 'g2/g2-2',
|
groupFullName: 'g2/g2-2',
|
||||||
groupId: 'group id',
|
groupId: 'group id',
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: mssqlProviderName,
|
providerName: mssqlProviderName,
|
||||||
options: {},
|
options: {},
|
||||||
@@ -282,4 +283,10 @@ suite('SQL ConnectionProfileInfo tests', () => {
|
|||||||
test('an empty connection profile does not cause issues', () => {
|
test('an empty connection profile does not cause issues', () => {
|
||||||
assert.doesNotThrow(() => new ConnectionProfile(capabilitiesService, {} as IConnectionProfile));
|
assert.doesNotThrow(() => new ConnectionProfile(capabilitiesService, {} as IConnectionProfile));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('getOptionsKey should produce the same optionsKey after converting to IConnectionProfile', () => {
|
||||||
|
let conn = new ConnectionProfile(capabilitiesService, iConnectionProfile);
|
||||||
|
const myIConnectionProfile = conn.toIConnectionProfile();
|
||||||
|
assert.equal(conn.getOptionsKey(), myIConnectionProfile.getOptionsKey());
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ suite('ConnectionStore', () => {
|
|||||||
groupId: '',
|
groupId: '',
|
||||||
groupFullName: '',
|
groupFullName: '',
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: () => false,
|
matches: () => false,
|
||||||
providerName: mssqlProviderName,
|
providerName: mssqlProviderName,
|
||||||
options: {},
|
options: {},
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ suite('SQL ProviderConnectionInfo tests', () => {
|
|||||||
groupFullName: 'g2/g2-2',
|
groupFullName: 'g2/g2-2',
|
||||||
groupId: undefined,
|
groupId: undefined,
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: mssqlProviderName,
|
providerName: mssqlProviderName,
|
||||||
options: undefined!,
|
options: undefined!,
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ let connectionProfile: IConnectionProfile = {
|
|||||||
groupFullName: 'g2/g2-2',
|
groupFullName: 'g2/g2-2',
|
||||||
groupId: 'group id',
|
groupId: 'group id',
|
||||||
getOptionsKey: () => 'connection1',
|
getOptionsKey: () => 'connection1',
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: mssqlProviderName,
|
providerName: mssqlProviderName,
|
||||||
options: {},
|
options: {},
|
||||||
@@ -44,6 +45,7 @@ let editorConnectionProfile: IConnectionProfile = {
|
|||||||
groupFullName: 'g2/g2-2',
|
groupFullName: 'g2/g2-2',
|
||||||
groupId: 'group id',
|
groupId: 'group id',
|
||||||
getOptionsKey: () => 'connection2',
|
getOptionsKey: () => 'connection2',
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: mssqlProviderName,
|
providerName: mssqlProviderName,
|
||||||
options: {},
|
options: {},
|
||||||
@@ -61,6 +63,7 @@ let connectionProfileWithoutDbName: IConnectionProfile = {
|
|||||||
groupFullName: 'g2/g2-2',
|
groupFullName: 'g2/g2-2',
|
||||||
groupId: 'group id',
|
groupId: 'group id',
|
||||||
getOptionsKey: () => 'connection1',
|
getOptionsKey: () => 'connection1',
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: mssqlProviderName,
|
providerName: mssqlProviderName,
|
||||||
options: {},
|
options: {},
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ suite('SQL ConnectionManagementService tests', () => {
|
|||||||
groupFullName: 'g2/g2-2',
|
groupFullName: 'g2/g2-2',
|
||||||
groupId: 'group id',
|
groupId: 'group id',
|
||||||
getOptionsKey: () => { return 'connectionId'; },
|
getOptionsKey: () => { return 'connectionId'; },
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined,
|
matches: undefined,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: {},
|
options: {},
|
||||||
@@ -2059,6 +2060,7 @@ test('getEditorConnectionProfileTitle should return a correctly formatted title
|
|||||||
groupFullName: 'g2/g2-2',
|
groupFullName: 'g2/g2-2',
|
||||||
groupId: 'group id',
|
groupId: 'group id',
|
||||||
getOptionsKey: () => { return ''; },
|
getOptionsKey: () => { return ''; },
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined,
|
matches: undefined,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: {},
|
options: {},
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ suite('Insights Dialog Controller Tests', () => {
|
|||||||
groupFullName: '',
|
groupFullName: '',
|
||||||
groupId: '',
|
groupId: '',
|
||||||
getOptionsKey: () => '',
|
getOptionsKey: () => '',
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined,
|
matches: undefined,
|
||||||
providerName: '',
|
providerName: '',
|
||||||
saveProfile: true,
|
saveProfile: true,
|
||||||
|
|||||||
@@ -405,7 +405,7 @@ export class TreeUpdateUtils {
|
|||||||
// Map the indices of profiles that share the same connection name.
|
// Map the indices of profiles that share the same connection name.
|
||||||
for (let i = 0; i < inputList.length; i++) {
|
for (let i = 0; i < inputList.length; i++) {
|
||||||
// do not add if the profile is still loading as that will result in erroneous entries.
|
// do not add if the profile is still loading as that will result in erroneous entries.
|
||||||
if (inputList[i].hasServerCapabilities && inputList[i].hasLoaded()) {
|
if (inputList[i].serverCapabilities && inputList[i].hasLoaded()) {
|
||||||
let titleKey = inputList[i].getOriginalTitle();
|
let titleKey = inputList[i].getOriginalTitle();
|
||||||
if (profileListMap.has(titleKey)) {
|
if (profileListMap.has(titleKey)) {
|
||||||
let profilesForKey = profileListMap.get(titleKey);
|
let profilesForKey = profileListMap.get(titleKey);
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ suite('AsyncServerTreeDragAndDrop', () => {
|
|||||||
groupFullName: 'g2/g2-2',
|
groupFullName: 'g2/g2-2',
|
||||||
groupId: 'group id',
|
groupId: 'group id',
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: mssqlProviderName,
|
providerName: mssqlProviderName,
|
||||||
options: {},
|
options: {},
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ suite('SQL Drag And Drop Controller tests', () => {
|
|||||||
groupFullName: 'g2/g2-2',
|
groupFullName: 'g2/g2-2',
|
||||||
groupId: 'group id',
|
groupId: 'group id',
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: mssqlProviderName,
|
providerName: mssqlProviderName,
|
||||||
options: {},
|
options: {},
|
||||||
@@ -59,6 +60,7 @@ suite('SQL Drag And Drop Controller tests', () => {
|
|||||||
groupFullName: 'g2/g2-2',
|
groupFullName: 'g2/g2-2',
|
||||||
groupId: 'group id',
|
groupId: 'group id',
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: pgsqlProviderName,
|
providerName: pgsqlProviderName,
|
||||||
options: {},
|
options: {},
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ suite('treeUpdateUtils alterConnection', () => {
|
|||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: { testOption3: 'default', testOption2: '10' },
|
options: { testOption3: 'default', testOption2: '10' },
|
||||||
@@ -101,6 +102,7 @@ suite('treeUpdateUtils alterConnection', () => {
|
|||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: { testOption3: 'nonDefault' },
|
options: { testOption3: 'nonDefault' },
|
||||||
@@ -135,6 +137,7 @@ suite('treeUpdateUtils alterConnection', () => {
|
|||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: { testOption2: '15', testOption1: 'test string 1', testOption3: 'nonDefault' },
|
options: { testOption2: '15', testOption1: 'test string 1', testOption3: 'nonDefault' },
|
||||||
@@ -153,6 +156,7 @@ suite('treeUpdateUtils alterConnection', () => {
|
|||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: { testOption2: '50', testOption1: 'test string 1', testOption3: 'nonDefault' },
|
options: { testOption2: '50', testOption1: 'test string 1', testOption3: 'nonDefault' },
|
||||||
@@ -171,6 +175,7 @@ suite('treeUpdateUtils alterConnection', () => {
|
|||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: { testOption2: '15', testOption1: 'test string 2', testOption3: 'nonDefault' },
|
options: { testOption2: '15', testOption1: 'test string 2', testOption3: 'nonDefault' },
|
||||||
@@ -189,6 +194,7 @@ suite('treeUpdateUtils alterConnection', () => {
|
|||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: { testOption2: '50', testOption1: 'test string 2', testOption3: 'nonDefault' },
|
options: { testOption2: '50', testOption1: 'test string 2', testOption3: 'nonDefault' },
|
||||||
@@ -207,6 +213,7 @@ suite('treeUpdateUtils alterConnection', () => {
|
|||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: { testOption3: 'nonDefault' },
|
options: { testOption3: 'nonDefault' },
|
||||||
@@ -248,6 +255,7 @@ suite('treeUpdateUtils alterConnection', () => {
|
|||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: {},
|
options: {},
|
||||||
@@ -266,6 +274,7 @@ suite('treeUpdateUtils alterConnection', () => {
|
|||||||
groupFullName: 'g3-1',
|
groupFullName: 'g3-1',
|
||||||
groupId: 'g3-1',
|
groupId: 'g3-1',
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: {},
|
options: {},
|
||||||
@@ -284,6 +293,7 @@ suite('treeUpdateUtils alterConnection', () => {
|
|||||||
groupFullName: 'g3-2',
|
groupFullName: 'g3-2',
|
||||||
groupId: 'g3-2',
|
groupId: 'g3-2',
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: {},
|
options: {},
|
||||||
@@ -328,6 +338,7 @@ suite('treeUpdateUtils alterConnection', () => {
|
|||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: { testOption1: 'value1' },
|
options: { testOption1: 'value1' },
|
||||||
@@ -346,6 +357,7 @@ suite('treeUpdateUtils alterConnection', () => {
|
|||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: { testOption1: 'value2' },
|
options: { testOption1: 'value2' },
|
||||||
@@ -364,6 +376,7 @@ suite('treeUpdateUtils alterConnection', () => {
|
|||||||
groupFullName: 'g3-1',
|
groupFullName: 'g3-1',
|
||||||
groupId: 'g3-1',
|
groupId: 'g3-1',
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: {},
|
options: {},
|
||||||
@@ -404,6 +417,7 @@ suite('treeUpdateUtils alterConnection', () => {
|
|||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: {},
|
options: {},
|
||||||
@@ -422,6 +436,7 @@ suite('treeUpdateUtils alterConnection', () => {
|
|||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: { testOption1: 'value1', testOption2: '15' },
|
options: { testOption1: 'value1', testOption2: '15' },
|
||||||
@@ -456,6 +471,7 @@ suite('treeUpdateUtils alterConnection', () => {
|
|||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: { testOption1: 'value1', testOption2: '15' },
|
options: { testOption1: 'value1', testOption2: '15' },
|
||||||
@@ -474,6 +490,7 @@ suite('treeUpdateUtils alterConnection', () => {
|
|||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: { testOption1: 'value2', testOption2: '30' },
|
options: { testOption1: 'value2', testOption2: '30' },
|
||||||
@@ -541,6 +558,7 @@ suite('treeUpdateUtils alterConnection', () => {
|
|||||||
groupFullName: 'g3a',
|
groupFullName: 'g3a',
|
||||||
groupId: 'g3a',
|
groupId: 'g3a',
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: {},
|
options: {},
|
||||||
@@ -559,6 +577,7 @@ suite('treeUpdateUtils alterConnection', () => {
|
|||||||
groupFullName: 'g3a',
|
groupFullName: 'g3a',
|
||||||
groupId: 'g3a',
|
groupId: 'g3a',
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: { testOption1: 'value2', testOption2: '30' },
|
options: { testOption1: 'value2', testOption2: '30' },
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ suite('Firewall rule dialog controller tests', () => {
|
|||||||
groupFullName: 'g2/g2-2',
|
groupFullName: 'g2/g2-2',
|
||||||
groupId: 'group id',
|
groupId: 'group id',
|
||||||
getOptionsKey: () => '',
|
getOptionsKey: () => '',
|
||||||
|
serverCapabilities: undefined,
|
||||||
matches: () => false,
|
matches: () => false,
|
||||||
providerName: mssqlProviderName,
|
providerName: mssqlProviderName,
|
||||||
options: {},
|
options: {},
|
||||||
|
|||||||
Reference in New Issue
Block a user