mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-29 01:25:37 -05:00
Renable Strict TSLint (#5018)
* removes more builder references * remove builder from profiler * formatting * fix profiler dailog * remove builder from oatuhdialog * remove the rest of builder references * formatting * add more strict null checks to base * enable strict tslint rules * fix formatting * fix compile error * fix the rest of the hygeny issues and add pipeline step * fix pipeline files
This commit is contained in:
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
import * as platform from 'vs/platform/registry/common/platform';
|
||||
import * as statusbar from 'vs/workbench/browser/parts/statusbar/statusbar';
|
||||
@@ -88,7 +86,7 @@ export class AccountManagementService implements IAccountManagementService {
|
||||
/**
|
||||
* Called from an account provider (via extension host -> main thread interop) when an
|
||||
* account's properties have been updated (usually when the account goes stale).
|
||||
* @param {Account} updatedAccount Account with the updated properties
|
||||
* @param updatedAccount Account with the updated properties
|
||||
*/
|
||||
public accountUpdated(updatedAccount: azdata.Account): Thenable<void> {
|
||||
let self = this;
|
||||
@@ -123,8 +121,8 @@ export class AccountManagementService implements IAccountManagementService {
|
||||
|
||||
/**
|
||||
* Asks the requested provider to prompt for an account
|
||||
* @param {string} providerId ID of the provider to ask to prompt for an account
|
||||
* @return {Thenable<Account>} Promise to return an account
|
||||
* @param providerId ID of the provider to ask to prompt for an account
|
||||
* @return Promise to return an account
|
||||
*/
|
||||
public addAccount(providerId: string): Thenable<void> {
|
||||
let self = this;
|
||||
@@ -155,8 +153,8 @@ export class AccountManagementService implements IAccountManagementService {
|
||||
|
||||
/**
|
||||
* Asks the requested provider to refresh an account
|
||||
* @param {Account} account account to refresh
|
||||
* @return {Thenable<Account>} Promise to return an account
|
||||
* @param account account to refresh
|
||||
* @return Promise to return an account
|
||||
*/
|
||||
public refreshAccount(account: azdata.Account): Thenable<azdata.Account> {
|
||||
let self = this;
|
||||
@@ -187,7 +185,7 @@ export class AccountManagementService implements IAccountManagementService {
|
||||
|
||||
/**
|
||||
* Retrieves metadata of all providers that have been registered
|
||||
* @returns {Thenable<AccountProviderMetadata[]>} Registered account providers
|
||||
* @returns Registered account providers
|
||||
*/
|
||||
public getAccountProviderMetadata(): Thenable<azdata.AccountProviderMetadata[]> {
|
||||
return Promise.resolve(Object.values(this._providers).map(provider => provider.metadata));
|
||||
@@ -195,8 +193,8 @@ export class AccountManagementService implements IAccountManagementService {
|
||||
|
||||
/**
|
||||
* Retrieves the accounts that belong to a specific provider
|
||||
* @param {string} providerId ID of the provider the returned accounts belong to
|
||||
* @returns {Thenable<Account[]>} Promise to return a list of accounts
|
||||
* @param providerId ID of the provider the returned accounts belong to
|
||||
* @returns Promise to return a list of accounts
|
||||
*/
|
||||
public getAccountsForProvider(providerId: string): Thenable<azdata.Account[]> {
|
||||
let self = this;
|
||||
@@ -214,9 +212,9 @@ export class AccountManagementService implements IAccountManagementService {
|
||||
|
||||
/**
|
||||
* Generates a security token by asking the account's provider
|
||||
* @param {Account} account Account to generate security token for
|
||||
* @param {azdata.AzureResource} resource The resource to get the security token for
|
||||
* @return {Thenable<{}>} Promise to return the security token
|
||||
* @param account Account to generate security token for
|
||||
* @param resource The resource to get the security token for
|
||||
* @return Promise to return the security token
|
||||
*/
|
||||
public getSecurityToken(account: azdata.Account, resource: azdata.AzureResource): Thenable<{}> {
|
||||
return this.doWithProvider(account.key.providerId, provider => {
|
||||
@@ -226,8 +224,8 @@ export class AccountManagementService implements IAccountManagementService {
|
||||
|
||||
/**
|
||||
* Removes an account from the account store and clears sensitive data in the provider
|
||||
* @param {AccountKey} accountKey Key for the account to remove
|
||||
* @returns {Thenable<void>} Promise with result of account removal, true if account was
|
||||
* @param accountKey Key for the account to remove
|
||||
* @returns Promise with result of account removal, true if account was
|
||||
* removed, false otherwise.
|
||||
*/
|
||||
public removeAccount(accountKey: azdata.AccountKey): Thenable<boolean> {
|
||||
@@ -263,7 +261,7 @@ export class AccountManagementService implements IAccountManagementService {
|
||||
// UI METHODS //////////////////////////////////////////////////////////
|
||||
/**
|
||||
* Opens the account list dialog
|
||||
* @return {TPromise<any>} Promise that finishes when the account list dialog opens
|
||||
* @return Promise that finishes when the account list dialog opens
|
||||
*/
|
||||
public openAccountListDialog(): Thenable<void> {
|
||||
let self = this;
|
||||
@@ -285,7 +283,7 @@ export class AccountManagementService implements IAccountManagementService {
|
||||
|
||||
/**
|
||||
* Begin auto OAuth device code open add account dialog
|
||||
* @return {TPromise<any>} Promise that finishes when the account list dialog opens
|
||||
* @return Promise that finishes when the account list dialog opens
|
||||
*/
|
||||
public beginAutoOAuthDeviceCode(providerId: string, title: string, message: string, userCode: string, uri: string): Thenable<void> {
|
||||
let self = this;
|
||||
@@ -325,8 +323,8 @@ export class AccountManagementService implements IAccountManagementService {
|
||||
// SERVICE MANAGEMENT METHODS //////////////////////////////////////////
|
||||
/**
|
||||
* Called by main thread to register an account provider from extension
|
||||
* @param {azdata.AccountProviderMetadata} providerMetadata Metadata of the provider that is being registered
|
||||
* @param {azdata.AccountProvider} provider References to the methods of the provider
|
||||
* @param providerMetadata Metadata of the provider that is being registered
|
||||
* @param provider References to the methods of the provider
|
||||
*/
|
||||
public registerProvider(providerMetadata: azdata.AccountProviderMetadata, provider: azdata.AccountProvider): Thenable<void> {
|
||||
let self = this;
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
|
||||
import {ConnectionProfileGroup} from 'sql/platform/connection/common/connectionProfileGroup';
|
||||
import { ConnectionProfileGroup } from 'sql/platform/connection/common/connectionProfileGroup';
|
||||
import { equalsIgnoreCase } from 'vs/base/common/strings';
|
||||
import { ICommandLineProcessing } from 'sql/workbench/services/commandLine/common/commandLine';
|
||||
import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
|
||||
@@ -20,10 +20,10 @@ import { IObjectExplorerService } from 'sql/workbench/services/objectExplorer/co
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { warn } from 'sql/base/common/log';
|
||||
import { ipcRenderer as ipc} from 'electron';
|
||||
import { ipcRenderer as ipc } from 'electron';
|
||||
import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IStatusbarService, StatusbarAlignment } from 'vs/platform/statusbar/common/statusbar';
|
||||
import { IStatusbarService } from 'vs/platform/statusbar/common/statusbar';
|
||||
import { localize } from 'vs/nls';
|
||||
|
||||
export class CommandLineService implements ICommandLineProcessing {
|
||||
@@ -32,7 +32,7 @@ export class CommandLineService implements ICommandLineProcessing {
|
||||
constructor(
|
||||
@ICapabilitiesService private _capabilitiesService: ICapabilitiesService,
|
||||
@IConnectionManagementService private _connectionManagementService: IConnectionManagementService,
|
||||
@IEnvironmentService private _environmentService: IEnvironmentService,
|
||||
@IEnvironmentService environmentService: IEnvironmentService,
|
||||
@IQueryEditorService private _queryEditorService: IQueryEditorService,
|
||||
@IObjectExplorerService private _objectExplorerService: IObjectExplorerService,
|
||||
@IEditorService private _editorService: IEditorService,
|
||||
@@ -41,16 +41,15 @@ export class CommandLineService implements ICommandLineProcessing {
|
||||
@IStatusbarService private _statusBarService: IStatusbarService
|
||||
) {
|
||||
if (ipc) {
|
||||
ipc.on('ads:processCommandLine', (event: any, args: ParsedArgs) => this.onLaunched(args));
|
||||
ipc.on('ads:processCommandLine', (event: any, args: ParsedArgs) => this.onLaunched(args));
|
||||
}
|
||||
// we only get the ipc from main during window reuse
|
||||
if (_environmentService) {
|
||||
this.onLaunched(_environmentService.args);
|
||||
if (environmentService) {
|
||||
this.onLaunched(environmentService.args);
|
||||
}
|
||||
}
|
||||
|
||||
private onLaunched(args: ParsedArgs)
|
||||
{
|
||||
private onLaunched(args: ParsedArgs) {
|
||||
const registry = platform.Registry.as<IConnectionProviderRegistry>(ConnectionProviderExtensions.ConnectionProviderContributions);
|
||||
let sqlProvider = registry.getProperties(Constants.mssqlProviderName);
|
||||
// We can't connect to object explorer until the MSSQL connection provider is registered
|
||||
@@ -81,7 +80,7 @@ export class CommandLineService implements ICommandLineProcessing {
|
||||
if (args.server) {
|
||||
profile = this.readProfileFromArgs(args);
|
||||
}
|
||||
}
|
||||
}
|
||||
let showConnectDialogOnStartup: boolean = this._configurationService.getValue('workbench.showConnectDialogOnStartup');
|
||||
if (showConnectDialogOnStartup && !commandName && !profile && !this._connectionManagementService.hasRegisteredServers()) {
|
||||
// prompt the user for a new connection on startup if no profiles are registered
|
||||
@@ -90,9 +89,8 @@ export class CommandLineService implements ICommandLineProcessing {
|
||||
}
|
||||
let connectedContext: azdata.ConnectedContext = undefined;
|
||||
if (profile) {
|
||||
if (this._statusBarService)
|
||||
{
|
||||
this._statusBarService.setStatusMessage(localize('connectingLabel','Connecting:') + profile.serverName, 2500);
|
||||
if (this._statusBarService) {
|
||||
this._statusBarService.setStatusMessage(localize('connectingLabel', 'Connecting:') + profile.serverName, 2500);
|
||||
}
|
||||
try {
|
||||
await this._connectionManagementService.connectIfNotConnected(profile, 'connection', true);
|
||||
@@ -105,15 +103,13 @@ export class CommandLineService implements ICommandLineProcessing {
|
||||
}
|
||||
}
|
||||
if (commandName) {
|
||||
if (this._statusBarService)
|
||||
{
|
||||
this._statusBarService.setStatusMessage(localize('runningCommandLabel','Running command:') + commandName, 2500);
|
||||
if (this._statusBarService) {
|
||||
this._statusBarService.setStatusMessage(localize('runningCommandLabel', 'Running command:') + commandName, 2500);
|
||||
}
|
||||
await this._commandService.executeCommand(commandName, connectedContext);
|
||||
} else if (profile) {
|
||||
if (this._statusBarService)
|
||||
{
|
||||
this._statusBarService.setStatusMessage(localize('openingNewQueryLabel','Opening new query:') + profile.serverName, 2500);
|
||||
if (this._statusBarService) {
|
||||
this._statusBarService.setStatusMessage(localize('openingNewQueryLabel', 'Opening new query:') + profile.serverName, 2500);
|
||||
}
|
||||
// Default to showing new query
|
||||
try {
|
||||
@@ -146,29 +142,26 @@ export class CommandLineService implements ICommandLineProcessing {
|
||||
return this._connectionManagementService ? this.tryMatchSavedProfile(profile) : profile;
|
||||
}
|
||||
|
||||
private tryMatchSavedProfile(profile: ConnectionProfile)
|
||||
{
|
||||
private tryMatchSavedProfile(profile: ConnectionProfile) {
|
||||
let match: ConnectionProfile = undefined;
|
||||
// If we can find a saved mssql provider connection that matches the args, use it
|
||||
let groups = this._connectionManagementService.getConnectionGroups([Constants.mssqlProviderName]);
|
||||
if (groups && groups.length > 0)
|
||||
{
|
||||
if (groups && groups.length > 0) {
|
||||
let rootGroup = groups[0];
|
||||
let connections = ConnectionProfileGroup.getConnectionsInGroup(rootGroup);
|
||||
match = connections.find((c) => this.matchProfile(profile, c)) ;
|
||||
match = connections.find((c) => this.matchProfile(profile, c));
|
||||
}
|
||||
return match ? match : profile;
|
||||
}
|
||||
|
||||
// determines if the 2 profiles are a functional match
|
||||
// profile1 is the profile generated from command line parameters
|
||||
private matchProfile(profile1: ConnectionProfile, profile2: ConnectionProfile): boolean
|
||||
{
|
||||
return equalsIgnoreCase(profile1.serverName,profile2.serverName)
|
||||
&& equalsIgnoreCase(profile1.providerName, profile2.providerName)
|
||||
// case sensitive servers can have 2 databases whose name differs only in case
|
||||
&& profile1.databaseName === profile2.databaseName
|
||||
&& equalsIgnoreCase(profile1.userName, profile2.userName)
|
||||
&& profile1.authenticationType === profile2.authenticationType;
|
||||
private matchProfile(profile1: ConnectionProfile, profile2: ConnectionProfile): boolean {
|
||||
return equalsIgnoreCase(profile1.serverName, profile2.serverName)
|
||||
&& equalsIgnoreCase(profile1.providerName, profile2.providerName)
|
||||
// case sensitive servers can have 2 databases whose name differs only in case
|
||||
&& profile1.databaseName === profile2.databaseName
|
||||
&& equalsIgnoreCase(profile1.userName, profile2.userName)
|
||||
&& profile1.authenticationType === profile2.authenticationType;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
|
||||
import { IConnectionComponentCallbacks, IConnectionComponentController, IConnectionValidateResult } from 'sql/workbench/services/connection/browser/connectionDialogService';
|
||||
import { AdvancedPropertiesController } from 'sql/workbench/parts/connection/browser/advancedPropertiesController';
|
||||
@@ -40,7 +38,7 @@ export class ConnectionController implements IConnectionComponentController {
|
||||
this._connectionManagementService = connectionManagementService;
|
||||
this._callback = callback;
|
||||
this._providerOptions = connectionProperties.connectionOptions;
|
||||
var specialOptions = this._providerOptions.filter(
|
||||
let specialOptions = this._providerOptions.filter(
|
||||
(property) => (property.specialValueType !== null && property.specialValueType !== undefined));
|
||||
this._connectionWidget = this._instantiationService.createInstance(ConnectionWidget, specialOptions, {
|
||||
onSetConnectButton: (enable: boolean) => this._callback.onSetConnectButton(enable),
|
||||
@@ -100,8 +98,8 @@ export class ConnectionController implements IConnectionComponentController {
|
||||
}
|
||||
|
||||
private handleonSetAzureTimeOut(): void {
|
||||
var timeoutPropertyName = 'connectTimeout';
|
||||
var timeoutOption = this._model.options[timeoutPropertyName];
|
||||
let timeoutPropertyName = 'connectTimeout';
|
||||
let timeoutOption = this._model.options[timeoutPropertyName];
|
||||
if (timeoutOption === undefined || timeoutOption === null) {
|
||||
this._model.options[timeoutPropertyName] = 30;
|
||||
}
|
||||
@@ -111,7 +109,7 @@ export class ConnectionController implements IConnectionComponentController {
|
||||
if (!this._advancedController) {
|
||||
this._advancedController = this._instantiationService.createInstance(AdvancedPropertiesController, () => this._connectionWidget.focusOnAdvancedButton());
|
||||
}
|
||||
var advancedOption = this._providerOptions.filter(
|
||||
let advancedOption = this._providerOptions.filter(
|
||||
(property) => (property.specialValueType === undefined || property.specialValueType === null));
|
||||
this._advancedController.showDialog(advancedOption, this._container, this._model.options);
|
||||
}
|
||||
@@ -133,8 +131,8 @@ export class ConnectionController implements IConnectionComponentController {
|
||||
}
|
||||
|
||||
private getAllServerGroups(providers?: string[]): IConnectionProfileGroup[] {
|
||||
var connectionGroupRoot = this._connectionManagementService.getConnectionGroups(providers);
|
||||
var connectionGroupNames: IConnectionProfileGroup[] = [];
|
||||
let connectionGroupRoot = this._connectionManagementService.getConnectionGroups(providers);
|
||||
let connectionGroupNames: IConnectionProfileGroup[] = [];
|
||||
if (connectionGroupRoot && connectionGroupRoot.length > 0) {
|
||||
this.getServerGroupHelper(connectionGroupRoot[0], connectionGroupNames);
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import {
|
||||
IConnectionManagementService,
|
||||
ConnectionType, INewConnectionParams, IConnectionCompletionOptions, IConnectionResult
|
||||
@@ -302,7 +300,7 @@ export class ConnectionDialogService implements IConnectionDialogService {
|
||||
|
||||
private handleFillInConnectionInputs(connectionInfo: IConnectionProfile): void {
|
||||
this._connectionManagementService.addSavedPassword(connectionInfo).then(connectionWithPassword => {
|
||||
var model = this.createModel(connectionWithPassword);
|
||||
let model = this.createModel(connectionWithPassword);
|
||||
this._model = model;
|
||||
this.uiController.fillInConnectionInputs(model);
|
||||
});
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import 'vs/css!./media/sqlConnection';
|
||||
|
||||
import { Button } from 'sql/base/browser/ui/button/button';
|
||||
@@ -110,12 +108,12 @@ export class ConnectionWidget {
|
||||
this._callbacks = callbacks;
|
||||
this._toDispose = [];
|
||||
this._optionsMaps = {};
|
||||
for (var i = 0; i < options.length; i++) {
|
||||
var option = options[i];
|
||||
for (let i = 0; i < options.length; i++) {
|
||||
let option = options[i];
|
||||
this._optionsMaps[option.specialValueType] = option;
|
||||
}
|
||||
|
||||
var authTypeOption = this._optionsMaps[ConnectionOptionSpecialType.authType];
|
||||
let authTypeOption = this._optionsMaps[ConnectionOptionSpecialType.authType];
|
||||
if (authTypeOption) {
|
||||
if (OS === OperatingSystem.Windows) {
|
||||
authTypeOption.defaultValue = this.getAuthTypeDisplayName(AuthenticationType.Integrated);
|
||||
@@ -571,7 +569,7 @@ export class ConnectionWidget {
|
||||
}
|
||||
|
||||
if (connectionInfo.authenticationType !== null && connectionInfo.authenticationType !== undefined) {
|
||||
var authTypeDisplayName = this.getAuthTypeDisplayName(connectionInfo.authenticationType);
|
||||
let authTypeDisplayName = this.getAuthTypeDisplayName(connectionInfo.authenticationType);
|
||||
this._authTypeSelectBox.selectWithOptionName(authTypeDisplayName);
|
||||
}
|
||||
|
||||
@@ -607,8 +605,8 @@ export class ConnectionWidget {
|
||||
}
|
||||
|
||||
private getAuthTypeDisplayName(authTypeName: string) {
|
||||
var displayName: string;
|
||||
var authTypeOption = this._optionsMaps[ConnectionOptionSpecialType.authType];
|
||||
let displayName: string;
|
||||
let authTypeOption = this._optionsMaps[ConnectionOptionSpecialType.authType];
|
||||
|
||||
if (authTypeOption) {
|
||||
authTypeOption.categoryValues.forEach(c => {
|
||||
@@ -621,8 +619,8 @@ export class ConnectionWidget {
|
||||
}
|
||||
|
||||
private getAuthTypeName(authTypeDisplayName: string) {
|
||||
var authTypeName: string;
|
||||
var authTypeOption = this._optionsMaps[ConnectionOptionSpecialType.authType];
|
||||
let authTypeName: string;
|
||||
let authTypeOption = this._optionsMaps[ConnectionOptionSpecialType.authType];
|
||||
authTypeOption.categoryValues.forEach(c => {
|
||||
if (c.displayName === authTypeDisplayName) {
|
||||
authTypeName = c.name;
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { INewConnectionParams, IConnectionResult, IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
|
||||
@@ -13,21 +12,12 @@ export interface IConnectionDialogService {
|
||||
_serviceBrand: any;
|
||||
/**
|
||||
* Opens the connection dialog and returns the promise for successfully opening the dialog
|
||||
* @param connectionManagementService
|
||||
* @param params
|
||||
* @param model
|
||||
* @param connectionResult
|
||||
*/
|
||||
showDialog(connectionManagementService: IConnectionManagementService, params: INewConnectionParams, model: IConnectionProfile, connectionResult?: IConnectionResult): Thenable<void>;
|
||||
|
||||
/**
|
||||
* Opens the connection dialog and returns the promise when connection is made
|
||||
* or dialog is closed
|
||||
* @param connectionManagementService
|
||||
* @param params
|
||||
* @param model
|
||||
* @param connectionResult
|
||||
*/
|
||||
openDialogAndWait(connectionManagementService: IConnectionManagementService, params?: INewConnectionParams, model?: IConnectionProfile, connectionResult?: IConnectionResult, doConnect?: boolean): Thenable<IConnectionProfile>;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import 'vs/css!sql/media/icons/common-icons';
|
||||
import 'vs/css!./media/newDashboardTabDialog';
|
||||
|
||||
@@ -27,7 +25,6 @@ import * as TelemetryKeys from 'sql/platform/telemetry/telemetryKeys';
|
||||
import { NewDashboardTabViewModel, IDashboardUITab } from 'sql/workbench/services/dashboard/common/newDashboardTabViewModel';
|
||||
import { IDashboardTab } from 'sql/platform/dashboard/common/dashboardRegistry';
|
||||
import { IClipboardService } from 'sql/platform/clipboard/common/clipboardService';
|
||||
import { Orientation } from 'vs/base/browser/ui/sash/sash';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
|
||||
class ExtensionListDelegate implements IListVirtualDelegate<IDashboardUITab> {
|
||||
@@ -67,7 +64,7 @@ class ExtensionListRenderer implements IListRenderer<IDashboardUITab, ExtensionL
|
||||
const tableTemplate: ExtensionListTemplate = Object.create(null);
|
||||
tableTemplate.root = DOM.append(container, DOM.$('div.list-row.extensionTab-list'));
|
||||
tableTemplate.icon = DOM.append(tableTemplate.root, DOM.$('div.icon'));
|
||||
var titleContainer = DOM.append(tableTemplate.root, DOM.$('div.extension-details'));
|
||||
let titleContainer = DOM.append(tableTemplate.root, DOM.$('div.extension-details'));
|
||||
tableTemplate.title = DOM.append(titleContainer, DOM.$('div.title'));
|
||||
tableTemplate.description = DOM.append(titleContainer, DOM.$('div.description'));
|
||||
tableTemplate.publisher = DOM.append(titleContainer, DOM.$('div.publisher'));
|
||||
@@ -96,7 +93,7 @@ class ExtensionListRenderer implements IListRenderer<IDashboardUITab, ExtensionL
|
||||
export class NewDashboardTabDialog extends Modal {
|
||||
public static EXTENSIONLIST_HEIGHT = 101;
|
||||
|
||||
// MEMBER VARIABLES ////////////////////////////////////////////////////
|
||||
// MEMBER letIABLES ////////////////////////////////////////////////////
|
||||
private _addNewTabButton: Button;
|
||||
private _cancelButton: Button;
|
||||
private _extensionList: List<IDashboardUITab>;
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
.error-dialog {
|
||||
|
||||
.error-dialog {
|
||||
padding: 15px;
|
||||
overflow: auto;
|
||||
height: 200px;
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import { ITree } from 'vs/base/parts/tree/browser/tree';
|
||||
import treedefaults = require('vs/base/parts/tree/browser/treeDefaults');
|
||||
import { IMouseEvent } from 'vs/base/browser/mouseEvent';
|
||||
@@ -21,12 +20,12 @@ export class FileBrowserController extends treedefaults.DefaultController {
|
||||
protected onLeftClick(tree: ITree, element: any, event: IMouseEvent, origin: string = 'mouse'): boolean {
|
||||
// In file browser, double clicking an element calls tree.dispose(). There should not be any tree events after selection.
|
||||
if (event.detail === 2) {
|
||||
var payload = { origin: origin, originalEvent: event };
|
||||
let payload = { origin: origin, originalEvent: event };
|
||||
if (tree.getInput() === element) {
|
||||
tree.clearFocus(payload);
|
||||
tree.clearSelection(payload);
|
||||
} else {
|
||||
var isMouseDown = event && event.browserEvent && event.browserEvent.type === 'mousedown';
|
||||
let isMouseDown = event && event.browserEvent && event.browserEvent.type === 'mousedown';
|
||||
if (!isMouseDown) {
|
||||
event.preventDefault(); // we cannot preventDefault onMouseDown because this would break DND otherwise
|
||||
}
|
||||
@@ -41,16 +40,16 @@ export class FileBrowserController extends treedefaults.DefaultController {
|
||||
}
|
||||
|
||||
protected onEnter(tree: ITree, event: IKeyboardEvent): boolean {
|
||||
var payload = { origin: 'keyboard', originalEvent: event };
|
||||
let payload = { origin: 'keyboard', originalEvent: event };
|
||||
|
||||
if (tree.getHighlight()) {
|
||||
return false;
|
||||
}
|
||||
var focus = tree.getFocus();
|
||||
let focus = tree.getFocus();
|
||||
if (focus) {
|
||||
// In file browser, pressing enter key on an element will close dialog and call tree.dispose(). There should not be any tree events after selection.
|
||||
tree.setSelection([focus], payload);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import { IFileBrowserService } from 'sql/platform/fileBrowser/common/interfaces';
|
||||
import { FileNode } from 'sql/workbench/services/fileBrowser/common/fileNode';
|
||||
import { ITree, IDataSource } from 'vs/base/parts/tree/browser/tree';
|
||||
@@ -47,7 +45,7 @@ export class FileBrowserDataSource implements IDataSource {
|
||||
public getChildren(tree: ITree, element: any): Promise<any> {
|
||||
return new Promise<any>((resolve) => {
|
||||
if (element instanceof FileNode) {
|
||||
var node = <FileNode>element;
|
||||
let node = <FileNode>element;
|
||||
if (node.children) {
|
||||
resolve(node.children);
|
||||
} else {
|
||||
@@ -69,4 +67,4 @@ export class FileBrowserDataSource implements IDataSource {
|
||||
public getParent(tree: ITree, element: any): Promise<any> {
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import { FileNode } from 'sql/workbench/services/fileBrowser/common/fileNode';
|
||||
import { ITree, IRenderer } from 'vs/base/parts/tree/browser/tree';
|
||||
import { FileKind } from 'vs/platform/files/common/files';
|
||||
@@ -61,8 +60,8 @@ export class FileBrowserRenderer implements IRenderer {
|
||||
templateData.label.element.style.display = 'flex';
|
||||
const extraClasses = ['explorer-item'];
|
||||
|
||||
var fileuri = URI.file(element.fullPath);
|
||||
var filekind;
|
||||
let fileuri = URI.file(element.fullPath);
|
||||
let filekind;
|
||||
if (element.parent === null) {
|
||||
filekind = FileKind.ROOT_FOLDER;
|
||||
} else if (element.isFile === false) {
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import { IFileBrowserService } from 'sql/platform/fileBrowser/common/interfaces';
|
||||
import { localize } from 'vs/nls';
|
||||
|
||||
@@ -18,7 +16,7 @@ export class FileBrowserViewModel {
|
||||
private _fileValidationServiceType: string;
|
||||
public formattedFileFilters: string[];
|
||||
|
||||
constructor( @IFileBrowserService private _fileBrowserService: IFileBrowserService) {
|
||||
constructor(@IFileBrowserService private _fileBrowserService: IFileBrowserService) {
|
||||
}
|
||||
|
||||
public onAddFileTree(onAddFileTreeCallback) {
|
||||
@@ -44,8 +42,8 @@ export class FileBrowserViewModel {
|
||||
this._fileFilters = fileFilters;
|
||||
}
|
||||
this.formattedFileFilters = [];
|
||||
for (var i = 0; i < this._fileFilters.length; i++) {
|
||||
var filterStr = this._fileFilters[i].label + '(' + this._fileFilters[i].filters.join(';') + ')';
|
||||
for (let i = 0; i < this._fileFilters.length; i++) {
|
||||
let filterStr = this._fileFilters[i].label + '(' + this._fileFilters[i].filters.join(';') + ')';
|
||||
this.formattedFileFilters.push(filterStr);
|
||||
}
|
||||
}
|
||||
@@ -63,4 +61,4 @@ export class FileBrowserViewModel {
|
||||
public closeFileBrowser() {
|
||||
this._fileBrowserService.closeFileBrowser(this._ownerUri);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { generateUuid } from 'vs/base/common/uuid';
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,7 +17,7 @@ export class InsightsDialogService implements IInsightsDialogService {
|
||||
private _insightsDialogView: InsightsDialogView;
|
||||
private _insightsDialogModel: IInsightsDialogModel;
|
||||
|
||||
constructor( @IInstantiationService private _instantiationService: IInstantiationService) { }
|
||||
constructor(@IInstantiationService private _instantiationService: IInstantiationService) { }
|
||||
|
||||
// query string
|
||||
public show(input: IInsightsConfig, connectionProfile: IConnectionProfile): void {
|
||||
|
||||
@@ -403,7 +403,6 @@ export class InsightsDialogView extends Modal {
|
||||
|
||||
/**
|
||||
* Creates the context that should be passed to the action passed on the selected element for the top table
|
||||
* @param element
|
||||
*/
|
||||
private topInsightContext(element: ListResource): IConnectionProfile {
|
||||
let database = this._insight.actions.database || this._connectionProfile.databaseName;
|
||||
@@ -451,7 +450,6 @@ export class InsightsDialogView extends Modal {
|
||||
|
||||
/**
|
||||
* Creates the context that should be passed to the action passed on the selected element for the bottom table
|
||||
* @param element
|
||||
*/
|
||||
private bottomInsightContext(element: ListResource, cell: Slick.Cell): IInsightDialogActionContext {
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ export class NotebookService extends Disposable implements INotebookService {
|
||||
notebookRegistry.providers.forEach(p => {
|
||||
// Don't need to re-register SQL_NOTEBOOK_PROVIDER
|
||||
if (p.provider !== SQL_NOTEBOOK_PROVIDER) {
|
||||
this.updateRegisteredProviders({id: p.provider, registration: p});
|
||||
this.updateRegisteredProviders({ id: p.provider, registration: p });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
|
||||
// Note: the code in the v3 and v4 namespaces has been adapted (with significant changes) from https://github.com/nteract/nteract/tree/master/packages/commutable
|
||||
|
||||
'use strict';
|
||||
|
||||
import { nb } from 'azdata';
|
||||
|
||||
import * as json from 'vs/base/common/json';
|
||||
@@ -347,7 +345,7 @@ namespace v3 {
|
||||
pdf: 'application/pdf'
|
||||
};
|
||||
type MimeTypeKey = keyof typeof VALID_MIMETYPES;
|
||||
type MimePayload = {[P in MimeTypeKey]?: nb.MultilineString };
|
||||
type MimePayload = { [P in MimeTypeKey]?: nb.MultilineString };
|
||||
|
||||
interface MimeOutput<T extends string = string> extends MimePayload {
|
||||
output_type: T;
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as os from 'os';
|
||||
import { nb, QueryExecuteSubsetResult, IDbColumn, BatchSummary, IResultMessage, ResultSetSummary } from 'azdata';
|
||||
@@ -432,7 +431,7 @@ export class SQLFuture extends Disposable implements FutureInternal {
|
||||
if (rowCount > 0) {
|
||||
subsetResult = await this._queryRunner.getQueryRows(0, rowCount, resultSet.batchId, resultSet.id);
|
||||
} else {
|
||||
subsetResult = { message: '', resultSubset: { rowCount: 0, rows: [] }};
|
||||
subsetResult = { message: '', resultSubset: { rowCount: 0, rows: [] } };
|
||||
}
|
||||
let msg: nb.IIOPubMessage = {
|
||||
channel: 'iopub',
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { NodeType } from 'sql/workbench/parts/objectExplorer/common/nodeType';
|
||||
import { TreeNode, TreeItemCollapsibleState } from 'sql/workbench/parts/objectExplorer/common/treeNode';
|
||||
@@ -190,8 +189,8 @@ export class ObjectExplorerService implements IObjectExplorerService {
|
||||
|
||||
public deleteObjectExplorerNode(connection: IConnectionProfile): Thenable<void> {
|
||||
let self = this;
|
||||
var connectionUri = connection.id;
|
||||
var nodeTree = this._activeObjectExplorerNodes[connectionUri];
|
||||
let connectionUri = connection.id;
|
||||
let nodeTree = this._activeObjectExplorerNodes[connectionUri];
|
||||
if (nodeTree) {
|
||||
return self.closeSession(connection.providerName, nodeTree.getSession()).then(() => {
|
||||
delete self._activeObjectExplorerNodes[connectionUri];
|
||||
|
||||
@@ -23,7 +23,7 @@ export interface IQueryEditorService {
|
||||
_serviceBrand: any;
|
||||
|
||||
// Creates new untitled document for SQL queries and opens it in a new editor tab
|
||||
newSqlEditor(sqlContent?: string, connectionProviderName?: string, isDirty?: boolean, objectName?:string ): Promise<IConnectableInput>;
|
||||
newSqlEditor(sqlContent?: string, connectionProviderName?: string, isDirty?: boolean, objectName?: string): Promise<IConnectableInput>;
|
||||
|
||||
// Creates a new query plan document
|
||||
newQueryPlanEditor(xmlShowPlan: string): Promise<any>;
|
||||
@@ -34,9 +34,8 @@ export interface IQueryEditorService {
|
||||
/**
|
||||
* Handles updating of SQL files on a save as event. These need special consideration
|
||||
* due to query results and other information being tied to the URI of the file
|
||||
* @param {URI} oldResource URI of the file before the save as was completed
|
||||
* @param {URI} newResource URI of the file after the save as operation was completed
|
||||
* @memberof IQueryEditorService
|
||||
* @param oldResource URI of the file before the save as was completed
|
||||
* @param newResource URI of the file after the save as operation was completed
|
||||
*/
|
||||
onSaveAsCompleted(oldResource: URI, newResource: URI): void;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user