mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-27 09:35: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:
@@ -74,7 +74,7 @@ export class AccountPickerListRenderer implements IListRenderer<azdata.Account,
|
||||
if (account.displayInfo.userId && account.displayInfo.displayName) {
|
||||
templateData.displayName.innerText = account.displayInfo.displayName + ' (' + account.displayInfo.userId + ')';
|
||||
} else {
|
||||
templateData.displayName.innerText = account.displayInfo.displayName ;
|
||||
templateData.displayName.innerText = account.displayInfo.displayName;
|
||||
}
|
||||
|
||||
if (account.isStale) {
|
||||
|
||||
@@ -33,7 +33,7 @@ export class AccountPickerViewModel {
|
||||
// PUBLIC METHODS //////////////////////////////////////////////////////
|
||||
/**
|
||||
* Loads an initial list of accounts from the account management service
|
||||
* @return {Thenable<Account[]>} Promise to return the list of accounts
|
||||
* @return Promise to return the list of accounts
|
||||
*/
|
||||
public initialize(): Thenable<azdata.Account[]> {
|
||||
// Load a baseline of the accounts for the provider
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
import { AccountAdditionResult } from 'sql/platform/accounts/common/eventTypes';
|
||||
|
||||
@@ -50,21 +50,21 @@ export enum AzureResource {
|
||||
export interface IAccountStore {
|
||||
/**
|
||||
* Adds the provided account if the account doesn't exist. Updates the account if it already exists
|
||||
* @param {Account} account Account to add/update
|
||||
* @return {Thenable<AccountAdditionResult>} Results of the add/update operation
|
||||
* @param account Account to add/update
|
||||
* @return Results of the add/update operation
|
||||
*/
|
||||
addOrUpdate(account: azdata.Account): Thenable<AccountAdditionResult>;
|
||||
|
||||
/**
|
||||
* Retrieves all accounts, filtered by provider ID
|
||||
* @param {string} providerId ID of the provider to filter by
|
||||
* @return {Thenable<Account[]>} Promise to return all accounts that belong to the provided provider
|
||||
* @param providerId ID of the provider to filter by
|
||||
* @return Promise to return all accounts that belong to the provided provider
|
||||
*/
|
||||
getAccountsByProvider(providerId: string): Thenable<azdata.Account[]>;
|
||||
|
||||
/**
|
||||
* Retrieves all accounts in the store. Returns empty array if store is not initialized
|
||||
* @return {Thenable<Account[]>} Promise to return all accounts
|
||||
* @return Promise to return all accounts
|
||||
*/
|
||||
getAllAccounts(): Thenable<azdata.Account[]>;
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@ export interface IAngularEventingService {
|
||||
* Adds a listener for the dashboard to send events, should only be called once for each dashboard by the dashboard itself
|
||||
* @param uri Uri of the dashboard
|
||||
* @param cb Listening function
|
||||
* @returns
|
||||
*/
|
||||
onAngularEvent(uri: string, cb: (event: IAngularEvent) => void): Subscription;
|
||||
|
||||
|
||||
@@ -143,7 +143,6 @@ export class CapabilitiesService extends Disposable implements ICapabilitiesServ
|
||||
|
||||
/**
|
||||
* Register the capabilities provider and query the provider for its capabilities
|
||||
* @param provider
|
||||
*/
|
||||
public registerProvider(provider: azdata.CapabilitiesProvider): void {
|
||||
// request the capabilities from server
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilitiesService';
|
||||
import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
|
||||
import { ConnectionProfileGroup, IConnectionProfileGroup } from 'sql/platform/connection/common/connectionProfileGroup';
|
||||
@@ -69,7 +68,7 @@ export class ConnectionConfig implements IConnectionConfig {
|
||||
let newProfile = ConnectionProfile.convertToProfileStore(this._capabilitiesService, connectionProfile);
|
||||
|
||||
// Remove the profile if already set
|
||||
var sameProfileInList = profiles.find(value => {
|
||||
let sameProfileInList = profiles.find(value => {
|
||||
let providerConnectionProfile = ConnectionProfile.createFromStoredProfile(value, this._capabilitiesService);
|
||||
return providerConnectionProfile.matches(connectionProfile);
|
||||
});
|
||||
@@ -100,7 +99,6 @@ export class ConnectionConfig implements IConnectionConfig {
|
||||
|
||||
/**
|
||||
*Returns group id
|
||||
* @param groupName
|
||||
*/
|
||||
public addGroupFromProfile(profile: IConnectionProfile): Promise<string> {
|
||||
if (profile.groupId && profile.groupId !== Utils.defaultGroupId) {
|
||||
@@ -116,7 +114,6 @@ export class ConnectionConfig implements IConnectionConfig {
|
||||
|
||||
/**
|
||||
*Returns group id
|
||||
* @param groupName
|
||||
*/
|
||||
public addGroup(profileGroup: IConnectionProfileGroup): Promise<string> {
|
||||
if (profileGroup.id) {
|
||||
@@ -159,13 +156,12 @@ export class ConnectionConfig implements IConnectionConfig {
|
||||
|
||||
/**
|
||||
* Replace duplicate ids with new ones. Sets id for the profiles without id
|
||||
* @param profiles
|
||||
*/
|
||||
private fixConnectionIds(profiles: IConnectionProfileStore[]): boolean {
|
||||
let idsCache: { [label: string]: boolean } = {};
|
||||
let changed: boolean = false;
|
||||
for (var index = 0; index < profiles.length; index++) {
|
||||
var profile = profiles[index];
|
||||
for (let index = 0; index < profiles.length; index++) {
|
||||
let profile = profiles[index];
|
||||
if (!profile.id) {
|
||||
profile.id = generateUuid();
|
||||
changed = true;
|
||||
|
||||
@@ -3,17 +3,14 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as interfaces from 'sql/platform/connection/common/interfaces';
|
||||
|
||||
/**
|
||||
* Sets sensible defaults for key connection properties, especially
|
||||
* if connection to Azure
|
||||
*
|
||||
* @export connectionInfo/fixupConnectionCredentials
|
||||
* @param {interfaces.IConnectionCredentials} connCreds connection to be fixed up
|
||||
* @returns {interfaces.IConnectionCredentials} the updated connection
|
||||
* @param connCreds connection to be fixed up
|
||||
* @returns the updated connection
|
||||
*/
|
||||
export function fixupConnectionCredentials(connCreds: interfaces.IConnectionProfile): interfaces.IConnectionProfile {
|
||||
if (!connCreds.serverName) {
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* 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 { Event } from 'vs/base/common/event';
|
||||
import * as azdata from 'azdata';
|
||||
@@ -221,18 +219,15 @@ export interface IConnectionManagementService {
|
||||
* Sends a notification that the language flavor for a given URI has changed.
|
||||
* For SQL, this would be the specific SQL implementation being used.
|
||||
*
|
||||
* @param {string} uri the URI of the resource whose language has changed
|
||||
* @param {string} language the base language
|
||||
* @param {string} flavor the specific language flavor that's been set
|
||||
*
|
||||
* @memberof IConnectionManagementService
|
||||
* @param uri the URI of the resource whose language has changed
|
||||
* @param language the base language
|
||||
* @param flavor the specific language flavor that's been set
|
||||
*/
|
||||
doChangeLanguageFlavor(uri: string, language: string, flavor: string): void;
|
||||
|
||||
/**
|
||||
* Ensures that a default language flavor is set for a URI, if none has already been defined.
|
||||
* @param {string} uri document identifier
|
||||
* @memberof ConnectionManagementService
|
||||
* @param uri document identifier
|
||||
*/
|
||||
ensureDefaultLanguageFlavor(uri: string): void;
|
||||
|
||||
@@ -243,22 +238,22 @@ export interface IConnectionManagementService {
|
||||
|
||||
/**
|
||||
* Get a copy of the connection profile with its passwords removed
|
||||
* @param {IConnectionProfile} profile The connection profile to remove passwords from
|
||||
* @returns {IConnectionProfile} A copy of the connection profile with passwords removed
|
||||
* @param profile The connection profile to remove passwords from
|
||||
* @returns A copy of the connection profile with passwords removed
|
||||
*/
|
||||
removeConnectionProfileCredentials(profile: IConnectionProfile): IConnectionProfile;
|
||||
|
||||
/**
|
||||
* Get the credentials for a connected connection profile, as they would appear in the options dictionary
|
||||
* @param {string} profileId The id of the connection profile to get the password for
|
||||
* @returns {{ [name: string]: string }} A dictionary containing the credentials as they would be included
|
||||
* @param profileId The id of the connection profile to get the password for
|
||||
* @returns A dictionary containing the credentials as they would be included
|
||||
* in the connection profile's options dictionary, or undefined if the profile is not connected
|
||||
*/
|
||||
getActiveConnectionCredentials(profileId: string): { [name: string]: string };
|
||||
|
||||
/**
|
||||
* Get the ServerInfo for a connected connection profile
|
||||
* @param {string} profileId The id of the connection profile to get the password for
|
||||
* @param profileId The id of the connection profile to get the password for
|
||||
* @returns ServerInfo
|
||||
*/
|
||||
getServerInfo(profileId: string): azdata.ServerInfo;
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
|
||||
import * as azdata from 'azdata';
|
||||
|
||||
@@ -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 { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
|
||||
import * as WorkbenchUtils from 'sql/workbench/common/sqlWorkbenchUtils';
|
||||
@@ -703,8 +702,6 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
||||
/**
|
||||
* Returns a formatted URI in case the database field is empty for the original
|
||||
* URI, which happens when the connected database is master or the default database
|
||||
* @param uri
|
||||
* @param connectionProfile
|
||||
*/
|
||||
public getFormattedUri(uri: string, connectionProfile: IConnectionProfile): string {
|
||||
if (this._connectionStatusManager.isDefaultTypeUri(uri)) {
|
||||
@@ -718,11 +715,10 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
||||
* Sends a notification that the language flavor for a given URI has changed.
|
||||
* For SQL, this would be the specific SQL implementation being used.
|
||||
*
|
||||
* @param {string} uri the URI of the resource whose language has changed
|
||||
* @param {string} language the base language
|
||||
* @param {string} flavor the specific language flavor that's been set
|
||||
* @param uri the URI of the resource whose language has changed
|
||||
* @param language the base language
|
||||
* @param flavor the specific language flavor that's been set
|
||||
* @throws {Error} if the provider is not in the list of registered providers
|
||||
* @memberof ConnectionManagementService
|
||||
*/
|
||||
public doChangeLanguageFlavor(uri: string, language: string, provider: string): void {
|
||||
if (this._providers.has(provider)) {
|
||||
@@ -738,8 +734,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
||||
|
||||
/**
|
||||
* Ensures that a default language flavor is set for a URI, if none has already been defined.
|
||||
* @param {string} uri document identifier
|
||||
* @memberof ConnectionManagementService
|
||||
* @param uri document identifier
|
||||
*/
|
||||
public ensureDefaultLanguageFlavor(uri: string): void {
|
||||
if (!this.getProviderIdFromUri(uri)) {
|
||||
@@ -973,7 +968,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
||||
return new Promise<boolean>((resolve, reject) => {
|
||||
// If the URI is connected, disconnect it and the editor
|
||||
if (self.isConnected(owner.uri)) {
|
||||
var connection = self.getConnectionProfile(owner.uri);
|
||||
let connection = self.getConnectionProfile(owner.uri);
|
||||
owner.onDisconnect();
|
||||
resolve(self.doDisconnect(owner.uri, connection));
|
||||
|
||||
|
||||
@@ -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 { ConnectionManagementInfo } from 'sql/platform/connection/common/connectionManagementInfo';
|
||||
import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilitiesService';
|
||||
@@ -16,7 +15,7 @@ export class ConnectionStatusManager {
|
||||
|
||||
private _connections: { [id: string]: ConnectionManagementInfo };
|
||||
|
||||
constructor( @ICapabilitiesService private _capabilitiesService: ICapabilitiesService) {
|
||||
constructor(@ICapabilitiesService private _capabilitiesService: ICapabilitiesService) {
|
||||
this._connections = {};
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as Constants from 'sql/platform/connection/common/constants';
|
||||
import * as ConnInfo from 'sql/platform/connection/common/connectionInfo';
|
||||
import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
|
||||
@@ -24,7 +22,6 @@ const MAX_CONNECTIONS_DEFAULT = 25;
|
||||
* Manages the connections list including saved profiles and the most recently used connections
|
||||
*
|
||||
* @export
|
||||
* @class ConnectionStore
|
||||
*/
|
||||
export class ConnectionStore {
|
||||
private _memento: any;
|
||||
@@ -65,10 +62,9 @@ export class ConnectionStore {
|
||||
/**
|
||||
* Creates a formatted credential usable for uniquely identifying a SQL Connection.
|
||||
* This string can be decoded but is not optimized for this.
|
||||
* @static
|
||||
* @param {IConnectionProfile} connectionProfile connection profile - require
|
||||
* @param {string} itemType type of the item (MRU or Profile) - optional
|
||||
* @returns {string} formatted string with server, DB and username
|
||||
* @param connectionProfile connection profile - require
|
||||
* @param itemType type of the item (MRU or Profile) - optional
|
||||
* @returns formatted string with server, DB and username
|
||||
*/
|
||||
public formatCredentialId(connectionProfile: IConnectionProfile, itemType?: string): string {
|
||||
let connectionProfileInstance: ConnectionProfile = ConnectionProfile.fromIConnectionProfile(
|
||||
@@ -120,9 +116,9 @@ export class ConnectionStore {
|
||||
}
|
||||
resolve({ profile: credentialsItem, savedCred: !!savedCred });
|
||||
},
|
||||
reason => {
|
||||
reject(reason);
|
||||
});
|
||||
reason => {
|
||||
reject(reason);
|
||||
});
|
||||
} else {
|
||||
// No need to look up the password
|
||||
resolve({ profile: credentialsItem, savedCred: credentialsItem.savePassword });
|
||||
@@ -134,9 +130,9 @@ export class ConnectionStore {
|
||||
* Saves a connection profile to the user settings.
|
||||
* Password values are stored to a separate credential store if the "savePassword" option is true
|
||||
*
|
||||
* @param {IConnectionProfile} profile the profile to save
|
||||
* @param {forceWritePlaintextPassword} whether the plaintext password should be written to the settings file
|
||||
* @returns {Promise<IConnectionProfile>} a Promise that returns the original profile, for help in chaining calls
|
||||
* @param profile the profile to save
|
||||
* @param whether the plaintext password should be written to the settings file
|
||||
* @returns a Promise that returns the original profile, for help in chaining calls
|
||||
*/
|
||||
public saveProfile(profile: IConnectionProfile, forceWritePlaintextPassword?: boolean): Promise<IConnectionProfile> {
|
||||
const self = this;
|
||||
@@ -172,8 +168,8 @@ export class ConnectionStore {
|
||||
/**
|
||||
* Saves a connection profile group to the user settings.
|
||||
*
|
||||
* @param {IConnectionProfileGroup} profile the profile group to save
|
||||
* @returns {Promise<string>} a Promise that returns the id of connection group
|
||||
* @param profile the profile group to save
|
||||
* @returns a Promise that returns the id of connection group
|
||||
*/
|
||||
public saveProfileGroup(profile: IConnectionProfileGroup): Promise<string> {
|
||||
const self = this;
|
||||
@@ -205,7 +201,7 @@ export class ConnectionStore {
|
||||
* Gets the list of recently used connections. These will not include the password - a separate call to
|
||||
* {addSavedPassword} is needed to fill that before connecting
|
||||
*
|
||||
* @returns {azdata.ConnectionInfo} the array of connections, empty if none are found
|
||||
* @returns the array of connections, empty if none are found
|
||||
*/
|
||||
public getRecentlyUsedConnections(providers?: string[]): ConnectionProfile[] {
|
||||
let configValues: IConnectionProfile[] = this._memento[Constants.recentConnections];
|
||||
@@ -245,7 +241,7 @@ export class ConnectionStore {
|
||||
* Gets the list of active connections. These will not include the password - a separate call to
|
||||
* {addSavedPassword} is needed to fill that before connecting
|
||||
*
|
||||
* @returns {azdata.ConnectionInfo} the array of connections, empty if none are found
|
||||
* @returns the array of connections, empty if none are found
|
||||
*/
|
||||
public getActiveConnections(): ConnectionProfile[] {
|
||||
let configValues: IConnectionProfile[] = this._memento[Constants.activeConnections];
|
||||
@@ -272,9 +268,9 @@ export class ConnectionStore {
|
||||
* Connection is only added if there are no other connections with the same connection ID in the list.
|
||||
* Password values are stored to a separate credential store if the "savePassword" option is true
|
||||
*
|
||||
* @param {IConnectionCredentials} conn the connection to add
|
||||
* @param {boolean} addToMru Whether to add this connection to the MRU
|
||||
* @returns {Promise<void>} a Promise that returns when the connection was saved
|
||||
* @param conn the connection to add
|
||||
* @param addToMru Whether to add this connection to the MRU
|
||||
* @returns a Promise that returns when the connection was saved
|
||||
*/
|
||||
public async addActiveConnection(conn: IConnectionProfile, addToMru: boolean): Promise<void> {
|
||||
if (addToMru) {
|
||||
@@ -459,7 +455,7 @@ export class ConnectionStore {
|
||||
this.addGroupFullNameToMap(group.id, connectionGroup.fullName);
|
||||
if (connections) {
|
||||
let connectionsForGroup = connections.filter(conn => conn.groupId === connectionGroup.id);
|
||||
var conns = [];
|
||||
let conns = [];
|
||||
connectionsForGroup.forEach((conn) => {
|
||||
conn.groupFullName = connectionGroup.fullName;
|
||||
conns.push(conn);
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
|
||||
import { IConnectionProfileGroup, ConnectionProfileGroup } from 'sql/platform/connection/common/connectionProfileGroup';
|
||||
import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
|
||||
@@ -13,7 +11,6 @@ import { ConnectionProfile } from 'sql/platform/connection/common/connectionProf
|
||||
* Interface for a configuration file that stores connection profiles.
|
||||
*
|
||||
* @export
|
||||
* @interface IConnectionConfig
|
||||
*/
|
||||
export interface IConnectionConfig {
|
||||
addConnection(profile: IConnectionProfile): Promise<IConnectionProfile>;
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { isString } from 'vs/base/common/types';
|
||||
|
||||
@@ -228,7 +226,7 @@ export class ProviderConnectionInfo extends Disposable implements azdata.Connect
|
||||
idNames.sort();
|
||||
|
||||
let idValues: string[] = [];
|
||||
for (var index = 0; index < idNames.length; index++) {
|
||||
for (let index = 0; index < idNames.length; index++) {
|
||||
let value = this.options[idNames[index]];
|
||||
value = value ? value : '';
|
||||
idValues.push(`${idNames[index]}${ProviderConnectionInfo.nameValueSeparator}${value}`);
|
||||
|
||||
@@ -3,12 +3,9 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import { OptionsDialog } from 'sql/workbench/browser/modal/optionsDialog';
|
||||
import { DialogModal } from 'sql/platform/dialog/dialogModal';
|
||||
import { WizardModal } from 'sql/platform/dialog/wizardModal';
|
||||
import { Dialog, Wizard, DialogTab } from 'sql/platform/dialog/dialogTypes';
|
||||
import { Dialog, Wizard } from 'sql/platform/dialog/dialogTypes';
|
||||
import { IModalOptions } from 'sql/workbench/browser/modal/modal';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
|
||||
@@ -19,7 +16,7 @@ export class CustomDialogService {
|
||||
private _dialogModals = new Map<Dialog, DialogModal>();
|
||||
private _wizardModals = new Map<Wizard, WizardModal>();
|
||||
|
||||
constructor( @IInstantiationService private _instantiationService: IInstantiationService) { }
|
||||
constructor(@IInstantiationService private _instantiationService: IInstantiationService) { }
|
||||
|
||||
public showDialog(dialog: Dialog, dialogName?: string, options?: IModalOptions): void {
|
||||
let name = dialogName ? dialogName : 'CustomDialog';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -75,5 +75,5 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ export class FileBrowserService implements IFileBrowserService {
|
||||
&& fileBrowserOpenedParams.fileTree.rootNode
|
||||
&& fileBrowserOpenedParams.fileTree.selectedNode
|
||||
) {
|
||||
var fileTree = this.convertFileTree(null, fileBrowserOpenedParams.fileTree.rootNode, fileBrowserOpenedParams.fileTree.selectedNode.fullPath, fileBrowserOpenedParams.ownerUri);
|
||||
let fileTree = this.convertFileTree(null, fileBrowserOpenedParams.fileTree.rootNode, fileBrowserOpenedParams.fileTree.selectedNode.fullPath, fileBrowserOpenedParams.ownerUri);
|
||||
this._onAddFileTree.fire({ rootNode: fileTree.rootNode, selectedNode: fileTree.selectedNode, expandedNodes: fileTree.expandedNodes });
|
||||
} else {
|
||||
let genericErrorMessage = localize('fileBrowserErrorMessage', 'An error occured while loading the file browser.');
|
||||
@@ -84,7 +84,7 @@ export class FileBrowserService implements IFileBrowserService {
|
||||
const provider = this.getProvider(fileNode.ownerUri);
|
||||
if (provider) {
|
||||
provider.expandFolderNode(fileNode.ownerUri, fileNode.fullPath).then(result => {
|
||||
var mapKey = self.generateResolveMapKey(fileNode.ownerUri, fileNode.fullPath);
|
||||
let mapKey = self.generateResolveMapKey(fileNode.ownerUri, fileNode.fullPath);
|
||||
self._expandResolveMap[mapKey] = resolve;
|
||||
}, error => {
|
||||
reject(error);
|
||||
@@ -96,12 +96,12 @@ export class FileBrowserService implements IFileBrowserService {
|
||||
}
|
||||
|
||||
public onFolderNodeExpanded(handle: number, fileBrowserExpandedParams: azdata.FileBrowserExpandedParams) {
|
||||
var mapKey = this.generateResolveMapKey(fileBrowserExpandedParams.ownerUri, fileBrowserExpandedParams.expandPath);
|
||||
var expandResolve = this._expandResolveMap[mapKey];
|
||||
let mapKey = this.generateResolveMapKey(fileBrowserExpandedParams.ownerUri, fileBrowserExpandedParams.expandPath);
|
||||
let expandResolve = this._expandResolveMap[mapKey];
|
||||
if (expandResolve) {
|
||||
if (fileBrowserExpandedParams.succeeded === true) {
|
||||
// get the expanded folder node
|
||||
var expandedNode = this._pathToFileNodeMap[fileBrowserExpandedParams.expandPath];
|
||||
let expandedNode = this._pathToFileNodeMap[fileBrowserExpandedParams.expandPath];
|
||||
if (expandedNode) {
|
||||
if (fileBrowserExpandedParams.children && fileBrowserExpandedParams.children.length > 0) {
|
||||
expandedNode.children = this.convertChildren(expandedNode, fileBrowserExpandedParams.children, fileBrowserExpandedParams.ownerUri);
|
||||
@@ -158,9 +158,9 @@ export class FileBrowserService implements IFileBrowserService {
|
||||
|
||||
private convertFileTree(parentNode: FileNode, fileTreeNode: azdata.FileTreeNode, expandPath: string, ownerUri: string): FileBrowserTree {
|
||||
FileBrowserService.fileNodeId += 1;
|
||||
var expandedNodes: FileNode[] = [];
|
||||
var selectedNode: FileNode;
|
||||
var fileNode = new FileNode(FileBrowserService.fileNodeId.toString(),
|
||||
let expandedNodes: FileNode[] = [];
|
||||
let selectedNode: FileNode;
|
||||
let fileNode = new FileNode(FileBrowserService.fileNodeId.toString(),
|
||||
fileTreeNode.name,
|
||||
fileTreeNode.fullPath,
|
||||
fileTreeNode.isFile,
|
||||
@@ -174,9 +174,9 @@ export class FileBrowserService implements IFileBrowserService {
|
||||
}
|
||||
|
||||
if (fileTreeNode.children) {
|
||||
var convertedChildren = [];
|
||||
for (var i = 0; i < fileTreeNode.children.length; i++) {
|
||||
var convertedFileTree: FileBrowserTree = this.convertFileTree(fileNode, fileTreeNode.children[i], expandPath, ownerUri);
|
||||
let convertedChildren = [];
|
||||
for (let i = 0; i < fileTreeNode.children.length; i++) {
|
||||
let convertedFileTree: FileBrowserTree = this.convertFileTree(fileNode, fileTreeNode.children[i], expandPath, ownerUri);
|
||||
convertedChildren.push(convertedFileTree.rootNode);
|
||||
|
||||
if (convertedFileTree.expandedNodes.length > 0) {
|
||||
@@ -206,11 +206,11 @@ export class FileBrowserService implements IFileBrowserService {
|
||||
}
|
||||
|
||||
private convertChildren(expandedNode: FileNode, childrenToConvert: azdata.FileTreeNode[], ownerUri: string): FileNode[] {
|
||||
var childrenNodes = [];
|
||||
let childrenNodes = [];
|
||||
|
||||
for (var i = 0; i < childrenToConvert.length; i++) {
|
||||
for (let i = 0; i < childrenToConvert.length; i++) {
|
||||
FileBrowserService.fileNodeId += 1;
|
||||
var childNode = new FileNode(FileBrowserService.fileNodeId.toString(),
|
||||
let childNode = new FileNode(FileBrowserService.fileNodeId.toString(),
|
||||
childrenToConvert[i].name,
|
||||
childrenToConvert[i].fullPath,
|
||||
childrenToConvert[i].isFile,
|
||||
|
||||
@@ -104,7 +104,7 @@ export class RunJobAction extends Action {
|
||||
return new Promise<boolean>((resolve, reject) => {
|
||||
this.jobManagementService.jobAction(ownerUri, jobName, JobActions.Run).then(result => {
|
||||
if (result.success) {
|
||||
var startMsg = nls.localize('jobSuccessfullyStarted', ': The job was successfully started.');
|
||||
let startMsg = nls.localize('jobSuccessfullyStarted', ': The job was successfully started.');
|
||||
this.notificationService.info(jobName + startMsg);
|
||||
refreshAction.run(context);
|
||||
resolve(true);
|
||||
@@ -140,7 +140,7 @@ export class StopJobAction extends Action {
|
||||
this.jobManagementService.jobAction(ownerUri, jobName, JobActions.Stop).then(result => {
|
||||
if (result.success) {
|
||||
refreshAction.run(context);
|
||||
var stopMsg = nls.localize('jobSuccessfullyStopped', ': The job was successfully stopped.');
|
||||
let stopMsg = nls.localize('jobSuccessfullyStopped', ': The job was successfully stopped.');
|
||||
this.notificationService.info(jobName + stopMsg);
|
||||
resolve(true);
|
||||
} else {
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
|
||||
@@ -39,7 +37,7 @@ export class MetadataService implements IMetadataService {
|
||||
|
||||
private _providers: { [handle: string]: azdata.MetadataProvider; } = Object.create(null);
|
||||
|
||||
constructor( @IConnectionManagementService private _connectionService: IConnectionManagementService) {
|
||||
constructor(@IConnectionManagementService private _connectionService: IConnectionManagementService) {
|
||||
}
|
||||
|
||||
public getMetadata(connectionUri: string): Thenable<azdata.ProviderMetadata> {
|
||||
|
||||
@@ -396,14 +396,14 @@ export class ResultSerializer {
|
||||
|
||||
this._editorService.openEditor(input, { pinned: true })
|
||||
.then(
|
||||
(success) => {
|
||||
},
|
||||
(error: any) => {
|
||||
this._notificationService.notify({
|
||||
severity: Severity.Error,
|
||||
message: error
|
||||
});
|
||||
}
|
||||
(success) => {
|
||||
},
|
||||
(error: any) => {
|
||||
this._notificationService.notify({
|
||||
severity: Severity.Error,
|
||||
message: error
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* 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';
|
||||
|
||||
export const ISqlOAuthService = createDecorator<ISqlOAuthService>('sqlOAuthService');
|
||||
@@ -19,16 +17,16 @@ export interface ISqlOAuthService {
|
||||
|
||||
/**
|
||||
* Sends request to main thread to handle OAuth request
|
||||
* @param {string} eventId Unique ID of the request to return upon completion
|
||||
* @param {string} url URL to load to do OAuth
|
||||
* @param {boolean} silent Whether or not to show the OAuth window
|
||||
* @return {Thenable<string>} Promise to return an authorization code
|
||||
* @param eventId Unique ID of the request to return upon completion
|
||||
* @param url URL to load to do OAuth
|
||||
* @param silent Whether or not to show the OAuth window
|
||||
* @return Promise to return an authorization code
|
||||
*/
|
||||
performOAuthAuthorization(eventId: string, url: string, silent: boolean): void;
|
||||
|
||||
/**
|
||||
* Registers a handler for the oauth-reply event on the IPC channel
|
||||
* @param {(event, args) => void} handler Handler to call when the event is triggered
|
||||
* @param handler Handler to call when the event is triggered
|
||||
*/
|
||||
registerOAuthCallback(handler: (event, args) => void): void;
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as electron from 'electron';
|
||||
import { ISqlOAuthService } from 'sql/platform/oAuth/common/sqlOAuthService';
|
||||
|
||||
@@ -18,10 +16,10 @@ export class SqlOAuthService implements ISqlOAuthService {
|
||||
|
||||
/**
|
||||
* Sends request to main thread to handle OAuth request
|
||||
* @param {string} eventId Unique ID of the request to return upon completion
|
||||
* @param {string} url URL to load to do OAuth
|
||||
* @param {boolean} silent Whether or not to show the OAuth window
|
||||
* @return {Thenable<string>} Promise to return an authorization code
|
||||
* @param eventId Unique ID of the request to return upon completion
|
||||
* @param url URL to load to do OAuth
|
||||
* @param silent Whether or not to show the OAuth window
|
||||
* @return Promise to return an authorization code
|
||||
*/
|
||||
performOAuthAuthorization(eventId: string, url: string, silent: boolean): void {
|
||||
// Setup the args and send the IPC call
|
||||
@@ -37,7 +35,7 @@ export class SqlOAuthService implements ISqlOAuthService {
|
||||
|
||||
/**
|
||||
* Registers a handler for the oauth-reply event on the IPC channel
|
||||
* @param {(event, args) => void} handler Handler to call when the event is triggered
|
||||
* @param handler Handler to call when the event is triggered
|
||||
*/
|
||||
registerOAuthCallback(handler: (event, args) => void): void {
|
||||
electron.ipcRenderer.on('oauth-reply', handler);
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
|
||||
@@ -50,14 +48,10 @@ export class ScriptingService implements IScriptingService {
|
||||
private _providers: { [handle: string]: azdata.ScriptingProvider; } = Object.create(null);
|
||||
|
||||
private failedScriptingOperations: { [operationId: string]: azdata.ScriptingCompleteResult } = {};
|
||||
constructor( @IConnectionManagementService private _connectionService: IConnectionManagementService) { }
|
||||
constructor(@IConnectionManagementService private _connectionService: IConnectionManagementService) { }
|
||||
|
||||
/**
|
||||
* Call the service for scripting based on provider and scripting operation
|
||||
* @param connectionUri
|
||||
* @param metadata
|
||||
* @param operation
|
||||
* @param paramDetails
|
||||
*/
|
||||
public script(connectionUri: string, metadata: azdata.ObjectMetadata, operation: ScriptOperation, paramDetails: azdata.ScriptingParamDetails): Thenable<azdata.ScriptingResult> {
|
||||
let providerId: string = this._connectionService.getProviderIdFromUri(connectionUri);
|
||||
@@ -73,8 +67,6 @@ export class ScriptingService implements IScriptingService {
|
||||
|
||||
/**
|
||||
* Callback method for when scripting is complete
|
||||
* @param handle
|
||||
* @param scriptingCompleteResult
|
||||
*/
|
||||
public onScriptingComplete(handle: number, scriptingCompleteResult: azdata.ScriptingCompleteResult): void {
|
||||
if (scriptingCompleteResult && scriptingCompleteResult.hasError && scriptingCompleteResult.errorMessage) {
|
||||
|
||||
@@ -3,7 +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 { TaskNode, TaskStatus, TaskExecutionMode } from 'sql/workbench/parts/taskHistory/common/taskNode';
|
||||
import { IQueryEditorService } from 'sql/workbench/services/queryEditor/common/queryEditorService';
|
||||
@@ -192,7 +191,7 @@ export class TaskService implements ITaskService {
|
||||
}
|
||||
|
||||
public handleTaskComplete(eventArgs: TaskStatusChangeArgs): void {
|
||||
var task = this.getTaskInQueue(eventArgs.taskId);
|
||||
let task = this.getTaskInQueue(eventArgs.taskId);
|
||||
if (task) {
|
||||
task.status = eventArgs.status;
|
||||
if (eventArgs.message) {
|
||||
@@ -240,7 +239,7 @@ export class TaskService implements ITaskService {
|
||||
|
||||
public getNumberOfInProgressTasks(): number {
|
||||
if (this._taskQueue.hasChildren) {
|
||||
var inProgressTasks = this._taskQueue.children.filter(x => x.status === TaskStatus.InProgress);
|
||||
let inProgressTasks = this._taskQueue.children.filter(x => x.status === TaskStatus.InProgress);
|
||||
return inProgressTasks ? inProgressTasks.length : 0;
|
||||
}
|
||||
return 0;
|
||||
@@ -249,4 +248,4 @@ export class TaskService implements ITaskService {
|
||||
public getAllTasks(): TaskNode {
|
||||
return this._taskQueue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ export class SqlTelemetryContribution extends Disposable implements IWorkbenchCo
|
||||
|
||||
|
||||
/* send monthly uses once the user launches on a day that's in a month
|
||||
after the last time we sent a monthly usage count */
|
||||
after the last time we sent a monthly usage count */
|
||||
const monthlyUseCount: number = storageService.getNumber('telemetry.monthlyUseCount', StorageScope.GLOBAL, 0);
|
||||
if (this.didMonthChange(monthlyLastUseDate)) {
|
||||
telemetryService.publicLog('telemetry.monthlyUse', { monthlyFirstUse: true });
|
||||
@@ -136,9 +136,9 @@ export class SqlTelemetryContribution extends Disposable implements IWorkbenchCo
|
||||
}
|
||||
|
||||
/**
|
||||
Growth Metrics
|
||||
Active here means opened app atleast 1 time in a month
|
||||
*/
|
||||
* Growth Metrics
|
||||
* Active here means opened app atleast 1 time in a month
|
||||
*/
|
||||
export enum UserGrowthType {
|
||||
// first time opening app
|
||||
NewUser = 1,
|
||||
|
||||
Reference in New Issue
Block a user