Revert "Update dataprotocol client" (#500)

* Revert "Fix #494 Connection error when connecting to an Azure SQL Server with no firewall rule (#497)"

This reverts commit edd867b6fc.

* Revert "Update dataprotocol client (#418)"

This reverts commit 7808496416.
This commit is contained in:
Anthony Dresser
2018-01-16 15:55:31 -08:00
committed by GitHub
parent edd867b6fc
commit 0cc7c540a9
110 changed files with 11677 additions and 3904 deletions

View File

@@ -136,7 +136,7 @@ export interface IConnectionManagementService {
clearRecentConnectionsList(): void;
clearRecentConnection(connectionProfile: IConnectionProfile): void;
clearRecentConnection(connectionProfile: IConnectionProfile) : void;
getActiveConnections(): ConnectionProfile[];
@@ -278,6 +278,24 @@ export interface IErrorMessageService {
showDialog(severity: Severity, headerTitle: string, message: string, messageDetails?: string, actions?: IAction[]): void;
}
export enum ServiceOptionType {
string = 0,
multistring = 1,
password = 2,
number = 3,
category = 4,
boolean = 5
}
export enum ConnectionOptionSpecialType {
serverName = 0,
databaseName = 1,
authType = 2,
userName = 3,
password = 4,
appName = 5
}
export enum RunQueryOnConnectionMode {
none = 0,
executeQuery = 1,

View File

@@ -52,11 +52,6 @@ export class ConnectionStore {
this._connectionConfig = new ConnectionConfig(this._configurationEditService,
this._workspaceConfigurationService, this._capabilitiesService, cachedServerCapabilities);
}
if (_capabilitiesService) {
_capabilitiesService.onProviderRegisteredEvent(e => {
this.saveCachedServerCapabilities();
});
}
}
public static get CRED_PREFIX(): string { return 'Microsoft.SqlTools'; }

View File

@@ -7,7 +7,7 @@
import data = require('data');
import * as interfaces from 'sql/parts/connection/common/interfaces';
import { ConnectionOptionSpecialType, ServiceOptionType } from 'sql/workbench/api/common/sqlExtHostTypes';
import { ConnectionOptionSpecialType, ServiceOptionType } from 'sql/parts/connection/common/connectionManagement';
import * as Constants from 'sql/parts/connection/common/constants';
export class ProviderConnectionInfo implements data.ConnectionInfo {
@@ -114,7 +114,7 @@ export class ProviderConnectionInfo implements data.ConnectionInfo {
return isPasswordRequired;
}
private getSpecialTypeOptionValue(type: string): string {
private getSpecialTypeOptionValue(type: number): string {
let name = this.getSpecialTypeOptionName(type);
if (name) {
return this.options[name];
@@ -172,7 +172,7 @@ export class ProviderConnectionInfo implements data.ConnectionInfo {
return providerId;
}
public getSpecialTypeOptionName(type: string): string {
public getSpecialTypeOptionName(type: number): string {
if (this._serverCapabilities) {
let optionMetadata = this._serverCapabilities.connectionProvider.options.find(o => o.specialValueType === type);
return !!optionMetadata ? optionMetadata.name : undefined;
@@ -181,7 +181,7 @@ export class ProviderConnectionInfo implements data.ConnectionInfo {
}
}
public setSpecialTypeOptionName(type: string, value: string): void {
public setSpecialTypeOptionName(type: number, value: string): void {
let name = this.getSpecialTypeOptionName(type);
if (!!name) {
this.options[name] = value;
@@ -238,3 +238,4 @@ export class ProviderConnectionInfo implements data.ConnectionInfo {
return parts;
}
}

View File

@@ -5,7 +5,7 @@
'use strict';
import { IConnectionManagementService } from 'sql/parts/connection/common/connectionManagement';
import { IConnectionManagementService, ConnectionOptionSpecialType } from 'sql/parts/connection/common/connectionManagement';
import { IConnectionComponentCallbacks, IConnectionComponentController, IConnectionValidateResult } from 'sql/parts/connection/connectionDialog/connectionDialogService';
import { ConnectionWidget } from 'sql/parts/connection/connectionDialog/connectionWidget';
import { AdvancedPropertiesController } from 'sql/parts/connection/connectionDialog/advancedPropertiesController';
@@ -15,7 +15,6 @@ import * as Constants from 'sql/parts/connection/common/constants';
import data = require('data');
import * as Utils from 'sql/parts/connection/common/utils';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { ConnectionOptionSpecialType } from 'sql/workbench/api/common/sqlExtHostTypes';
export class ConnectionController implements IConnectionComponentController {
private _container: HTMLElement;

View File

@@ -291,7 +291,8 @@ export class ConnectionDialogWidget extends Modal {
this.onConnectionClick({ payload: { origin: origin, originalEvent: eventish } }, element);
}
};
let actionProvider = this._instantiationService.createInstance(RecentConnectionActionsProvider);
let actionProvider = this._instantiationService.createInstance(RecentConnectionActionsProvider, this._instantiationService, this._connectionManagementService,
this._messageService);
let controller = new RecentConnectionTreeController(leftClick, actionProvider, this._connectionManagementService, this._contextMenuService);
actionProvider.onRecentConnectionRemoved(() => {
this.open(this._connectionManagementService.getRecentConnections().length > 0);

View File

@@ -16,7 +16,7 @@ import * as DialogHelper from 'sql/base/browser/ui/modal/dialogHelper';
import { IConnectionComponentCallbacks } from 'sql/parts/connection/connectionDialog/connectionDialogService';
import * as lifecycle from 'vs/base/common/lifecycle';
import { IConnectionProfile } from 'sql/parts/connection/common/interfaces';
import { ConnectionOptionSpecialType } from 'sql/workbench/api/common/sqlExtHostTypes';
import { ConnectionOptionSpecialType } from 'sql/parts/connection/common/connectionManagement';
import * as Constants from 'sql/parts/connection/common/constants';
import { ConnectionProfileGroup, IConnectionProfileGroup } from 'sql/parts/connection/common/connectionProfileGroup';
import { IThemeService } from 'vs/platform/theme/common/themeService';
@@ -87,7 +87,7 @@ export class ConnectionWidget {
}
var authTypeOption = this._optionsMaps[ConnectionOptionSpecialType.authType];
if (authTypeOption) {
if(authTypeOption) {
if (OS === OperatingSystem.Windows) {
authTypeOption.defaultValue = this.getAuthTypeDisplayName(Constants.integrated);
} else {
@@ -250,11 +250,11 @@ export class ConnectionWidget {
}
}
private setConnectButton(): void {
private setConnectButton() : void {
let authDisplayName: string = this.getAuthTypeDisplayName(this.authenticationType);
let authType: AuthenticationType = this.getMatchingAuthType(authDisplayName);
let showUsernameAndPassword: boolean = true;
if (authType) {
if(authType) {
showUsernameAndPassword = authType.showUsernameAndPassword;
}
showUsernameAndPassword ? this._callbacks.onSetConnectButton(!!this.serverName && !!this.userName) :
@@ -366,7 +366,7 @@ export class ConnectionWidget {
var displayName: string;
var authTypeOption = this._optionsMaps[ConnectionOptionSpecialType.authType];
if (authTypeOption) {
if(authTypeOption) {
authTypeOption.categoryValues.forEach(c => {
if (c.name === authTypeName) {
displayName = c.displayName;