mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-30 01:25:38 -05:00
Remove logging and clone utlities (#5309)
* remove log utility functions; remove custom mixin * fix tests * add log service as required by telemetry utils * remove unused code * replace some console.logs with logservice
This commit is contained in:
@@ -33,7 +33,8 @@ import { AccountListRenderer, AccountListDelegate } from 'sql/platform/accounts/
|
||||
import { AccountProviderAddedEventParams, UpdateAccountListEventParams } from 'sql/platform/accounts/common/eventTypes';
|
||||
import { IClipboardService } from 'sql/platform/clipboard/common/clipboardService';
|
||||
import * as TelemetryKeys from 'sql/platform/telemetry/telemetryKeys';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
class AccountPanel extends ViewletPanel {
|
||||
public index: number;
|
||||
@@ -113,7 +114,7 @@ export class AccountDialog extends Modal {
|
||||
public get onCloseEvent(): Event<void> { return this._onCloseEmitter.event; }
|
||||
|
||||
constructor(
|
||||
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
|
||||
@ILayoutService layoutService: ILayoutService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IInstantiationService private _instantiationService: IInstantiationService,
|
||||
@IContextMenuService private _contextMenuService: IContextMenuService,
|
||||
@@ -121,7 +122,8 @@ export class AccountDialog extends Modal {
|
||||
@IConfigurationService private _configurationService: IConfigurationService,
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@IClipboardService clipboardService: IClipboardService
|
||||
@IClipboardService clipboardService: IClipboardService,
|
||||
@ILogService logService: ILogService
|
||||
) {
|
||||
super(
|
||||
localize('linkedAccounts', 'Linked accounts'),
|
||||
@@ -130,6 +132,7 @@ export class AccountDialog extends Modal {
|
||||
layoutService,
|
||||
clipboardService,
|
||||
themeService,
|
||||
logService,
|
||||
contextKeyService,
|
||||
{ hasSpinner: true }
|
||||
);
|
||||
|
||||
@@ -21,7 +21,8 @@ import { attachModalDialogStyler, attachButtonStyler } from 'sql/platform/theme/
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import * as TelemetryKeys from 'sql/platform/telemetry/telemetryKeys';
|
||||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
export class AutoOAuthDialog extends Modal {
|
||||
private _copyAndOpenButton: Button;
|
||||
@@ -42,12 +43,13 @@ export class AutoOAuthDialog extends Modal {
|
||||
public get onCloseEvent(): Event<void> { return this._onCloseEvent.event; }
|
||||
|
||||
constructor(
|
||||
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
|
||||
@ILayoutService layoutService: ILayoutService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IContextViewService private _contextViewService: IContextViewService,
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@IClipboardService clipboardService: IClipboardService
|
||||
@IClipboardService clipboardService: IClipboardService,
|
||||
@ILogService logService: ILogService
|
||||
) {
|
||||
super(
|
||||
'',
|
||||
@@ -56,6 +58,7 @@ export class AutoOAuthDialog extends Modal {
|
||||
layoutService,
|
||||
clipboardService,
|
||||
themeService,
|
||||
logService,
|
||||
contextKeyService,
|
||||
{
|
||||
isFlyout: true,
|
||||
|
||||
@@ -28,6 +28,7 @@ import { attachModalDialogStyler, attachButtonStyler } from 'sql/platform/theme/
|
||||
import { InputBox } from 'sql/base/browser/ui/inputBox/inputBox';
|
||||
import { IAccountPickerService } from 'sql/platform/accounts/common/accountPicker';
|
||||
import * as TelemetryKeys from 'sql/platform/telemetry/telemetryKeys';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
// TODO: Make the help link 1) extensible (01/08/2018, https://github.com/Microsoft/azuredatastudio/issues/450)
|
||||
// in case that other non-Azure sign in is to be used
|
||||
@@ -69,7 +70,8 @@ export class FirewallRuleDialog extends Modal {
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@IWindowsService private _windowsService: IWindowsService,
|
||||
@IClipboardService clipboardService: IClipboardService
|
||||
@IClipboardService clipboardService: IClipboardService,
|
||||
@ILogService logService: ILogService
|
||||
) {
|
||||
super(
|
||||
localize('createNewFirewallRule', "Create new firewall rule"),
|
||||
@@ -78,6 +80,7 @@ export class FirewallRuleDialog extends Modal {
|
||||
layoutService,
|
||||
clipboardService,
|
||||
themeService,
|
||||
logService,
|
||||
contextKeyService,
|
||||
{
|
||||
isFlyout: true,
|
||||
|
||||
@@ -8,11 +8,11 @@ import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { localize } from 'vs/nls';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
|
||||
import { error } from 'sql/base/common/log';
|
||||
import { IAccountManagementService } from 'sql/platform/accounts/common/interfaces';
|
||||
import { IDialogService, IConfirmation, IConfirmationResult } from 'vs/platform/dialogs/common/dialogs';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
/**
|
||||
* Actions to add a new account
|
||||
@@ -34,7 +34,8 @@ export class AddAccountAction extends Action {
|
||||
|
||||
constructor(
|
||||
private _providerId: string,
|
||||
@IAccountManagementService private _accountManagementService: IAccountManagementService
|
||||
@IAccountManagementService private _accountManagementService: IAccountManagementService,
|
||||
@ILogService private readonly logService: ILogService
|
||||
) {
|
||||
super(AddAccountAction.ID, AddAccountAction.LABEL);
|
||||
this.class = 'add-linked-account-action';
|
||||
@@ -54,7 +55,7 @@ export class AddAccountAction extends Action {
|
||||
this._addAccountCompleteEmitter.fire();
|
||||
return true;
|
||||
}, err => {
|
||||
error(`Error while adding account: ${err}`);
|
||||
this.logService.error(`Error while adding account: ${err}`);
|
||||
this._addAccountErrorEmitter.fire(err);
|
||||
this._addAccountCompleteEmitter.fire();
|
||||
}));
|
||||
@@ -132,7 +133,8 @@ export class RefreshAccountAction extends Action {
|
||||
public account: azdata.Account;
|
||||
|
||||
constructor(
|
||||
@IAccountManagementService private _accountManagementService: IAccountManagementService
|
||||
@IAccountManagementService private _accountManagementService: IAccountManagementService,
|
||||
@ILogService private readonly logService: ILogService
|
||||
) {
|
||||
super(RefreshAccountAction.ID, RefreshAccountAction.LABEL, 'refresh-account-action icon refresh');
|
||||
}
|
||||
@@ -141,7 +143,7 @@ export class RefreshAccountAction extends Action {
|
||||
return Promise.resolve(this._accountManagementService.refreshAccount(this.account)
|
||||
.then(() => true,
|
||||
err => {
|
||||
error(`Error while refreshing account: ${err}`);
|
||||
this.logService.error(`Error while refreshing account: ${err}`);
|
||||
return Promise.reject(err);
|
||||
}
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user