Merge from vscode e3c4990c67c40213af168300d1cfeb71d680f877 (#16569)

This commit is contained in:
Cory Rivera
2021-08-25 16:28:29 -07:00
committed by GitHub
parent ab1112bfb3
commit cb7b7da0a4
1752 changed files with 59525 additions and 33878 deletions

View File

@@ -674,9 +674,9 @@ class TreeItemRenderer extends Disposable implements ITreeRenderer<ITreeItemFrom
if (iconUrl || sqlIcon) {
templateData.icon.className = 'custom-view-tree-node-item-icon';
if (sqlIcon) {
DOM.toggleClass(templateData.icon, sqlIcon, !!sqlIcon); // tracked change
templateData.icon.classList.toggle(sqlIcon, !!sqlIcon); // tracked change
}
DOM.toggleClass(templateData.icon, 'icon', !!sqlIcon);
templateData.icon.classList.toggle('icon', !!sqlIcon);
templateData.icon.style.backgroundImage = iconUrl ? DOM.asCSSUrl(iconUrl) : '';
} else {
let iconClass: string | undefined;

View File

@@ -17,7 +17,6 @@ import { ConnectionWidget } from 'sql/workbench/services/connection/browser/conn
import { IServerGroupController } from 'sql/platform/serverGroup/common/serverGroupController';
import { ILogService } from 'vs/platform/log/common/log';
import { ConnectionProviderProperties } from 'sql/platform/capabilities/common/capabilitiesService';
import { assign } from 'vs/base/common/objects';
export class ConnectionController implements IConnectionComponentController {
private _advancedController: AdvancedPropertiesController;
@@ -153,7 +152,7 @@ export class ConnectionController implements IConnectionComponentController {
} else {
defaultGroupId = Utils.defaultGroupId;
}
allGroups.push(assign({}, this._connectionWidget.DefaultServerGroup, { id: defaultGroupId }));
allGroups.push(Object.assign({}, this._connectionWidget.DefaultServerGroup, { id: defaultGroupId }));
allGroups.push(this._connectionWidget.NoneServerGroup);
if (connectionGroupRoot && connectionGroupRoot.length > 0) {
this.flattenGroups(connectionGroupRoot[0], allGroups);

View File

@@ -45,7 +45,6 @@ import { Memento, MementoObject } from 'vs/workbench/common/memento';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { entries } from 'sql/base/common/collections';
import { values } from 'vs/base/common/collections';
import { assign } from 'vs/base/common/objects';
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
import { toErrorMessage } from 'vs/base/common/errorMessage';
@@ -877,7 +876,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
// Request Senders
private async sendConnectRequest(connection: interfaces.IConnectionProfile, uri: string): Promise<boolean> {
let connectionInfo = assign({}, {
let connectionInfo = Object.assign({}, {
options: connection.options
});

View File

@@ -30,7 +30,6 @@ import * as DOM from 'vs/base/browser/dom';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { OS, OperatingSystem } from 'vs/base/common/platform';
import { MessageType } from 'vs/base/browser/ui/inputbox/inputBox';
import { endsWith, startsWith } from 'vs/base/common/strings';
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { ILogService } from 'vs/platform/log/common/log';
@@ -229,7 +228,7 @@ export class ConnectionWidget extends lifecycle.Disposable {
validation: (value: string) => {
if (!value) {
return ({ type: MessageType.ERROR, content: localize('connectionWidget.missingRequireField', "{0} is required.", serverNameOption.displayName) });
} else if (startsWith(value, ' ') || endsWith(value, ' ')) {
} else if (value.startsWith(' ') || value.endsWith(' ')) {
return ({ type: MessageType.WARNING, content: localize('connectionWidget.fieldWillBeTrimmed', "{0} will be trimmed.", serverNameOption.displayName) });
}
return undefined;

View File

@@ -33,7 +33,6 @@ import { TestEnvironmentService, TestEditorService } from 'vs/workbench/test/bro
import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService';
import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService';
import { ILogService, NullLogService } from 'vs/platform/log/common/log';
import { assign } from 'vs/base/common/objects';
import { NullAdsTelemetryService } from 'sql/platform/telemetry/common/adsTelemetryService';
import { TestStorageService } from 'vs/workbench/test/common/workbenchTestServices';
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
@@ -74,9 +73,9 @@ suite('SQL ConnectionManagementService tests', () => {
id: undefined
};
let connectionProfileWithEmptySavedPassword: IConnectionProfile =
assign({}, connectionProfile, { password: '', serverName: connectionProfile.serverName + 1 });
Object.assign({}, connectionProfile, { password: '', serverName: connectionProfile.serverName + 1 });
let connectionProfileWithEmptyUnsavedPassword: IConnectionProfile =
assign({}, connectionProfile, { password: '', serverName: connectionProfile.serverName + 2, savePassword: false });
Object.assign({}, connectionProfile, { password: '', serverName: connectionProfile.serverName + 2, savePassword: false });
let connectionManagementService: ConnectionManagementService;
let configResult: { [key: string]: any } = {};
@@ -482,7 +481,7 @@ suite('SQL ConnectionManagementService tests', () => {
});
test('changeGroupIdForconnection should change the groupId for a connection profile', async () => {
let profile = <ConnectionProfile>assign({}, connectionProfile);
let profile = <ConnectionProfile>Object.assign({}, connectionProfile);
profile.options = { password: profile.password };
profile.id = 'test_id';
let newGroupId = 'new_group_id';
@@ -504,7 +503,7 @@ suite('SQL ConnectionManagementService tests', () => {
});
test('findExistingConnection should find connection for connectionProfile with same info', async () => {
let profile = <ConnectionProfile>assign({}, connectionProfile);
let profile = <ConnectionProfile>Object.assign({}, connectionProfile);
let uri1 = 'connection:connectionId';
let options: IConnectionCompletionOptions = {
params: {
@@ -535,7 +534,7 @@ suite('SQL ConnectionManagementService tests', () => {
});
test('deleteConnection should delete the connection properly', async () => {
let profile = <ConnectionProfile>assign({}, connectionProfile);
let profile = <ConnectionProfile>Object.assign({}, connectionProfile);
let uri1 = 'connection:connectionId';
let options: IConnectionCompletionOptions = {
params: {
@@ -566,7 +565,7 @@ suite('SQL ConnectionManagementService tests', () => {
});
test('deleteConnectionGroup should delete connections in connection group', async () => {
let profile = <ConnectionProfile>assign({}, connectionProfile);
let profile = <ConnectionProfile>Object.assign({}, connectionProfile);
let profileGroup = createConnectionGroup('original_id');
profileGroup.addConnections([profile]);
let uri1 = 'connection:connectionId';
@@ -601,13 +600,13 @@ suite('SQL ConnectionManagementService tests', () => {
connectionStore.setup(x => x.canChangeConnectionConfig(TypeMoq.It.isAny(), TypeMoq.It.isAnyString())).returns(() => {
return true;
});
let profile = <ConnectionProfile>assign({}, connectionProfile);
let profile = <ConnectionProfile>Object.assign({}, connectionProfile);
let newGroupId = 'test_group_id';
assert(connectionManagementService.canChangeConnectionConfig(profile, newGroupId));
});
test('isProfileConnecting should return false for already connected profile', async () => {
let profile = <ConnectionProfile>assign({}, connectionProfile);
let profile = <ConnectionProfile>Object.assign({}, connectionProfile);
let uri = 'Editor Uri';
let options: IConnectionCompletionOptions = {
params: {
@@ -635,7 +634,7 @@ suite('SQL ConnectionManagementService tests', () => {
});
test('disconnect should disconnect the profile when given ConnectionProfile', async () => {
let profile = <ConnectionProfile>assign({}, connectionProfile);
let profile = <ConnectionProfile>Object.assign({}, connectionProfile);
let uri = 'connection:connectionId'; // must use default connection uri for test to work.
let options: IConnectionCompletionOptions = {
params: {
@@ -664,7 +663,7 @@ suite('SQL ConnectionManagementService tests', () => {
});
test('disconnect should disconnect the profile when given uri string', async () => {
let profile = <ConnectionProfile>assign({}, connectionProfile);
let profile = <ConnectionProfile>Object.assign({}, connectionProfile);
let uri = 'connection:connectionId'; // must use default connection uri for test to work.
let options: IConnectionCompletionOptions = {
params: {
@@ -693,7 +692,7 @@ suite('SQL ConnectionManagementService tests', () => {
});
test('cancelConnection should disconnect the profile', async () => {
let profile = <ConnectionProfile>assign({}, connectionProfile);
let profile = <ConnectionProfile>Object.assign({}, connectionProfile);
let uri = 'connection:connectionId'; // must use default connection uri for test to work.
let options: IConnectionCompletionOptions = {
params: {
@@ -751,7 +750,7 @@ suite('SQL ConnectionManagementService tests', () => {
});
test('getConnection should grab connection that is connected', async () => {
let profile = <ConnectionProfile>assign({}, connectionProfile);
let profile = <ConnectionProfile>Object.assign({}, connectionProfile);
let uri = 'connection:connectionId'; // must use default connection uri for test to work.
let badString = 'bad_string';
let options: IConnectionCompletionOptions = {
@@ -784,7 +783,7 @@ suite('SQL ConnectionManagementService tests', () => {
});
test('connectIfNotConnected should not try to connect with already connected profile', async () => {
let profile = <ConnectionProfile>assign({}, connectionProfile);
let profile = <ConnectionProfile>Object.assign({}, connectionProfile);
let uri = 'connection:connectionId'; // must use default connection uri for test to work.
let options: IConnectionCompletionOptions = {
params: {
@@ -818,7 +817,7 @@ suite('SQL ConnectionManagementService tests', () => {
});
test('getConnectionString should get connection string of connectionId', async () => {
let profile = <ConnectionProfile>assign({}, connectionProfile);
let profile = <ConnectionProfile>Object.assign({}, connectionProfile);
let uri = 'connection:connectionId'; // must use default connection uri for test to work.
let badString = 'bad_string';
let options: IConnectionCompletionOptions = {
@@ -858,7 +857,7 @@ suite('SQL ConnectionManagementService tests', () => {
test('rebuildIntellisenseCache should call rebuildIntelliSenseCache on provider', async () => {
let profile = <ConnectionProfile>assign({}, connectionProfile);
let profile = <ConnectionProfile>Object.assign({}, connectionProfile);
let uri = 'connection:connectionId'; // must use default connection uri for test to work.
let options: IConnectionCompletionOptions = {
params: {
@@ -893,7 +892,7 @@ suite('SQL ConnectionManagementService tests', () => {
});
test('buildConnectionInfo should get connection string of connectionId', async () => {
let profile = <ConnectionProfile>assign({}, connectionProfile);
let profile = <ConnectionProfile>Object.assign({}, connectionProfile);
let uri = 'connection:connectionId'; // must use default connection uri for test to work.
let options: IConnectionCompletionOptions = {
params: {
@@ -928,9 +927,9 @@ suite('SQL ConnectionManagementService tests', () => {
});
test('removeConnectionProfileCredentials should return connection profile without password', () => {
let profile = assign({}, connectionProfile);
let profile = Object.assign({}, connectionProfile);
connectionStore.setup(x => x.getProfileWithoutPassword(TypeMoq.It.isAny())).returns(() => {
let profileWithoutPass = assign({}, connectionProfile);
let profileWithoutPass = Object.assign({}, connectionProfile);
profileWithoutPass.password = undefined;
return <ConnectionProfile>profileWithoutPass;
});
@@ -939,7 +938,7 @@ suite('SQL ConnectionManagementService tests', () => {
});
test('getConnectionProfileById should return profile when given profileId', async () => {
let profile = <ConnectionProfile>assign({}, connectionProfile);
let profile = <ConnectionProfile>Object.assign({}, connectionProfile);
let uri = 'connection:connectionId'; // must use default connection uri for test to work.
let badString = 'bad_string';
let options: IConnectionCompletionOptions = {
@@ -973,7 +972,7 @@ suite('SQL ConnectionManagementService tests', () => {
});
test('Edit Connection - Changing connection profile name for same URI should persist after edit', async () => {
let profile = assign({}, connectionProfile);
let profile = Object.assign({}, connectionProfile);
let uri1 = 'test_uri1';
let newname = 'connection renamed';
let options: IConnectionCompletionOptions = {
@@ -998,7 +997,7 @@ suite('SQL ConnectionManagementService tests', () => {
};
await connect(uri1, options, true, profile);
let newProfile = assign({}, connectionProfile);
let newProfile = Object.assign({}, connectionProfile);
newProfile.connectionName = newname;
options.params.isEditConnection = true;
await connect(uri1, options, true, newProfile);
@@ -1008,7 +1007,7 @@ suite('SQL ConnectionManagementService tests', () => {
test('Edit Connection - Connecting a different URI with same profile via edit should not change profile ID.', async () => {
let uri1 = 'test_uri1';
let uri2 = 'test_uri2';
let profile = assign({}, connectionProfile);
let profile = Object.assign({}, connectionProfile);
profile.id = '0451';
let options: IConnectionCompletionOptions = {
params: {
@@ -1320,7 +1319,7 @@ suite('SQL ConnectionManagementService tests', () => {
});
test('registerIconProvider should register icon provider for connectionManagementService', async () => {
let profile = <ConnectionProfile>assign({}, connectionProfile);
let profile = <ConnectionProfile>Object.assign({}, connectionProfile);
let serverInfo: azdata.ServerInfo = {
serverMajorVersion: 0,
serverMinorVersion: 0,
@@ -1464,9 +1463,9 @@ suite('SQL ConnectionManagementService tests', () => {
let dbName = 'master';
let serverName = 'test_server';
let userName = 'test_user';
let connectionProfileWithoutDb: IConnectionProfile = assign(connectionProfile,
let connectionProfileWithoutDb: IConnectionProfile = Object.assign(connectionProfile,
{ serverName: serverName, databaseName: '', userName: userName, getOptionsKey: () => undefined });
let connectionProfileWithDb: IConnectionProfile = assign(connectionProfileWithoutDb, { databaseName: dbName });
let connectionProfileWithDb: IConnectionProfile = Object.assign(connectionProfileWithoutDb, { databaseName: dbName });
// Save the database with a URI that has the database name filled in, to mirror Carbon's behavior
let ownerUri = Utils.generateUri(connectionProfileWithDb);
await connect(ownerUri, undefined, false, connectionProfileWithoutDb);
@@ -1486,9 +1485,9 @@ suite('SQL ConnectionManagementService tests', () => {
let newDbName = 'renamed_master';
let serverName = 'test_server';
let userName = 'test_user';
let connectionProfileWithoutDb: IConnectionProfile = assign(connectionProfile,
let connectionProfileWithoutDb: IConnectionProfile = Object.assign(connectionProfile,
{ serverName: serverName, databaseName: '', userName: userName, getOptionsKey: () => undefined });
let connectionProfileWithDb: IConnectionProfile = assign(connectionProfileWithoutDb, { databaseName: dbName });
let connectionProfileWithDb: IConnectionProfile = Object.assign(connectionProfileWithoutDb, { databaseName: dbName });
// Save the database with a URI that has the database name filled in, to mirror Carbon's behavior
let ownerUri = Utils.generateUri(connectionProfileWithDb);
let listDatabasesThenable = (connectionUri: string) => {
@@ -1545,7 +1544,7 @@ suite('SQL ConnectionManagementService tests', () => {
});
test('getConnectionCredentials returns the credentials dictionary for an active connection profile', async () => {
let profile = assign({}, connectionProfile);
let profile = Object.assign({}, connectionProfile);
profile.options = { password: profile.password };
profile.id = 'test_id';
connectionStatusManager.addConnection(profile, 'test_uri');
@@ -1607,7 +1606,7 @@ suite('SQL ConnectionManagementService tests', () => {
});
test('getConnectionUriFromId returns a URI of an active connection with the given id', () => {
let profile = assign({}, connectionProfile);
let profile = Object.assign({}, connectionProfile);
profile.options = { password: profile.password };
profile.id = 'test_id';
let uri = 'test_initial_uri';
@@ -1626,7 +1625,7 @@ suite('SQL ConnectionManagementService tests', () => {
});
test('getConectionUriFromId returns undefined if the given connection is not active', () => {
let profile = assign({}, connectionProfile);
let profile = Object.assign({}, connectionProfile);
profile.options = { password: profile.password };
profile.id = 'test_id';
connectionStatusManager.addConnection(profile, Utils.generateUri(profile));

View File

@@ -871,7 +871,7 @@ class TreeRenderer extends Disposable implements ITreeRenderer<ITreeItem, FuzzyS
}
private setAlignment(container: HTMLElement, treeItem: ITreeItem) {
DOM.toggleClass(container.parentElement!, 'align-icon-with-twisty', this.aligner.alignIconWithTwisty(treeItem));
container.parentElement!.classList.toggle('align-icon-with-twisty', this.aligner.alignIconWithTwisty(treeItem));
}
private isFileKindThemeIcon(icon: ThemeIcon | undefined): boolean {