mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-05 09:35:39 -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:
@@ -16,8 +16,9 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { bootstrapAngular } from 'sql/platform/bootstrap/node/bootstrapService';
|
||||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { append, $ } from 'vs/base/browser/dom';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
|
||||
export class BackupDialog extends Modal {
|
||||
private _body: HTMLElement;
|
||||
@@ -26,13 +27,14 @@ export class BackupDialog extends Modal {
|
||||
|
||||
constructor(
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
|
||||
@ILayoutService layoutService: ILayoutService,
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@IInstantiationService private _instantiationService: IInstantiationService,
|
||||
@IClipboardService clipboardService: IClipboardService
|
||||
@IClipboardService clipboardService: IClipboardService,
|
||||
@ILogService logService: ILogService
|
||||
) {
|
||||
super('', TelemetryKeys.Backup, telemetryService, layoutService, clipboardService, themeService, contextKeyService, { isAngular: true, hasErrors: true });
|
||||
super('', TelemetryKeys.Backup, telemetryService, layoutService, clipboardService, themeService, logService, contextKeyService, { isAngular: true, hasErrors: true });
|
||||
}
|
||||
|
||||
protected renderBody(container: HTMLElement) {
|
||||
|
||||
@@ -9,7 +9,6 @@ import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import * as nls from 'vs/nls';
|
||||
import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
|
||||
import { error } from 'sql/base/common/log';
|
||||
import { WidgetConfig } from 'sql/workbench/parts/dashboard/common/dashboardWidget';
|
||||
import { Extensions, IInsightRegistry } from 'sql/platform/dashboard/common/insightRegistry';
|
||||
import { ConnectionManagementInfo } from 'sql/platform/connection/common/connectionManagementInfo';
|
||||
@@ -23,6 +22,7 @@ import { NAV_SECTION } from 'sql/workbench/parts/dashboard/containers/dashboardN
|
||||
import { IDashboardContainerRegistry, Extensions as DashboardContainerExtensions } from 'sql/platform/dashboard/common/dashboardContainerRegistry';
|
||||
import { SingleConnectionManagementService } from 'sql/platform/bootstrap/node/commonServiceInterface.service';
|
||||
import * as Constants from 'sql/platform/connection/common/constants';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
const dashboardcontainerRegistry = Registry.as<IDashboardContainerRegistry>(DashboardContainerExtensions.dashboardContainerContributions);
|
||||
const containerTypes = [
|
||||
@@ -173,14 +173,14 @@ function hasCompatibleProvider(provider: string | string[], contextKeyService: I
|
||||
* Get registered container if it is specified as the key
|
||||
* @param container dashboard container
|
||||
*/
|
||||
export function getDashboardContainer(container: object): { result: boolean, message: string, container: object } {
|
||||
export function getDashboardContainer(container: object, logService: ILogService): { result: boolean, message: string, container: object } {
|
||||
const key = Object.keys(container)[0];
|
||||
const containerTypeFound = containerTypes.find(c => (c === key));
|
||||
if (!containerTypeFound) {
|
||||
const dashboardContainer = dashboardcontainerRegistry.getRegisteredContainer(key);
|
||||
if (!dashboardContainer) {
|
||||
const errorMessage = nls.localize('unknownDashboardContainerError', '{0} is an unknown container.', key);
|
||||
error(errorMessage);
|
||||
logService.error(errorMessage);
|
||||
return { result: false, message: errorMessage, container: undefined };
|
||||
} else {
|
||||
container = dashboardContainer.container;
|
||||
|
||||
@@ -36,6 +36,7 @@ import Severity from 'vs/base/common/severity';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
const dashboardRegistry = Registry.as<IDashboardRegistry>(DashboardExtensions.DashboardContributions);
|
||||
|
||||
@@ -97,7 +98,8 @@ export abstract class DashboardPage extends AngularDisposable implements IConfig
|
||||
@Inject(IInstantiationService) private instantiationService: IInstantiationService,
|
||||
@Inject(INotificationService) private notificationService: INotificationService,
|
||||
@Inject(IAngularEventingService) private angularEventingService: IAngularEventingService,
|
||||
@Inject(IConfigurationService) private configurationService: IConfigurationService
|
||||
@Inject(IConfigurationService) private configurationService: IConfigurationService,
|
||||
@Inject(ILogService) private logService: ILogService
|
||||
) {
|
||||
super();
|
||||
}
|
||||
@@ -261,7 +263,7 @@ export abstract class DashboardPage extends AngularDisposable implements IConfig
|
||||
}
|
||||
|
||||
private initTabComponents(value: IDashboardTab): { id: string; title: string; container: object; alwaysShow: boolean; } {
|
||||
const containerResult = dashboardHelper.getDashboardContainer(value.container);
|
||||
const containerResult = dashboardHelper.getDashboardContainer(value.container, this.logService);
|
||||
if (!containerResult.result) {
|
||||
return { id: value.id, title: value.title, container: { 'error-container': undefined }, alwaysShow: value.alwaysShow };
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import * as dashboardHelper from 'sql/workbench/parts/dashboard/common/dashboard
|
||||
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
@Component({
|
||||
selector: 'dashboard-nav-section',
|
||||
@@ -53,7 +54,8 @@ export class DashboardNavSection extends DashboardTab implements OnDestroy, OnCh
|
||||
@ViewChild(PanelComponent) private _panel: PanelComponent;
|
||||
constructor(
|
||||
@Inject(forwardRef(() => CommonServiceInterface)) protected dashboardService: CommonServiceInterface,
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) protected _cd: ChangeDetectorRef
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) protected _cd: ChangeDetectorRef,
|
||||
@Inject(ILogService) private logService: ILogService
|
||||
) {
|
||||
super();
|
||||
}
|
||||
@@ -91,7 +93,7 @@ export class DashboardNavSection extends DashboardTab implements OnDestroy, OnCh
|
||||
private loadNewTabs(dashboardTabs: NavSectionConfig[]) {
|
||||
if (dashboardTabs && dashboardTabs.length > 0) {
|
||||
dashboardTabs.map(v => {
|
||||
const containerResult = dashboardHelper.getDashboardContainer(v.container);
|
||||
const containerResult = dashboardHelper.getDashboardContainer(v.container, this.logService);
|
||||
if (!containerResult.result) {
|
||||
return { id: v.id, title: v.title, container: { 'error-container': undefined } };
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ import {
|
||||
import { ComponentHostDirective } from 'sql/workbench/parts/dashboard/common/componentHost.directive';
|
||||
import { WidgetConfig, WIDGET_CONFIG, IDashboardWidget } from 'sql/workbench/parts/dashboard/common/dashboardWidget';
|
||||
import { Extensions, IInsightRegistry } from 'sql/platform/dashboard/common/insightRegistry';
|
||||
import { error } from 'sql/base/common/log';
|
||||
import { RefreshWidgetAction, ToggleMoreWidgetAction, DeleteWidgetAction, CollapseWidgetAction } from 'sql/workbench/parts/dashboard/common/actions';
|
||||
import { AngularDisposable } from 'sql/base/node/lifecycle';
|
||||
|
||||
@@ -36,6 +35,7 @@ import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { memoize } from 'vs/base/common/decorators';
|
||||
import { generateUuid } from 'vs/base/common/uuid';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
const componentMap: { [x: string]: Type<IDashboardWidget> } = {
|
||||
'properties-widget': PropertiesWidgetComponent,
|
||||
@@ -92,7 +92,8 @@ export class DashboardWidgetWrapper extends AngularDisposable implements OnInit
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) private _changeref: ChangeDetectorRef,
|
||||
@Inject(forwardRef(() => Injector)) private _injector: Injector,
|
||||
@Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService,
|
||||
@Inject(IInstantiationService) private instantiationService: IInstantiationService
|
||||
@Inject(IInstantiationService) private instantiationService: IInstantiationService,
|
||||
@Inject(ILogService) private logService: ILogService
|
||||
) {
|
||||
super();
|
||||
}
|
||||
@@ -146,13 +147,13 @@ export class DashboardWidgetWrapper extends AngularDisposable implements OnInit
|
||||
|
||||
private loadWidget(): void {
|
||||
if (Object.keys(this._config.widget).length !== 1) {
|
||||
error('Exactly 1 widget must be defined per space');
|
||||
this.logService.error('Exactly 1 widget must be defined per space');
|
||||
return;
|
||||
}
|
||||
const key = Object.keys(this._config.widget)[0];
|
||||
const selector = this.getOrCreateSelector(key);
|
||||
if (selector === undefined) {
|
||||
error('Could not find selector', key);
|
||||
this.logService.error('Could not find selector', key);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -183,7 +184,7 @@ export class DashboardWidgetWrapper extends AngularDisposable implements OnInit
|
||||
this._changeref.detectChanges();
|
||||
}
|
||||
} catch (e) {
|
||||
error('Error rendering widget', key, e);
|
||||
this.logService.error('Error rendering widget', key, e);
|
||||
return;
|
||||
}
|
||||
const el = <HTMLElement>componentRef.location.nativeElement;
|
||||
|
||||
@@ -86,6 +86,7 @@ import { InsightsWidget } from 'sql/workbench/parts/dashboard/widgets/insights/i
|
||||
import { WebviewWidget } from 'sql/workbench/parts/dashboard/widgets/webview/webviewWidget.component';
|
||||
import { JobStepsViewComponent } from 'sql/workbench/parts/jobManagement/electron-browser/jobStepsView.component';
|
||||
import { IInstantiationService, _util } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
const widgetComponents = [
|
||||
PropertiesWidgetComponent,
|
||||
@@ -156,6 +157,7 @@ export const DashboardModule = (params, selector: string, instantiationService:
|
||||
@Inject(forwardRef(() => ComponentFactoryResolver)) private _resolver: ComponentFactoryResolver,
|
||||
@Inject(forwardRef(() => Router)) private _router: Router,
|
||||
@Inject(ITelemetryService) private telemetryService: ITelemetryService,
|
||||
@Inject(ILogService) private readonly logService: ILogService,
|
||||
@Inject(ISelector) private selector: string
|
||||
) {
|
||||
}
|
||||
@@ -168,7 +170,7 @@ export const DashboardModule = (params, selector: string, instantiationService:
|
||||
this._router.events.subscribe(e => {
|
||||
if (e instanceof NavigationEnd) {
|
||||
this.navigations++;
|
||||
TelemetryUtils.addTelemetry(this.telemetryService, TelemetryKeys.DashboardNavigated, {
|
||||
TelemetryUtils.addTelemetry(this.telemetryService, this.logService, TelemetryKeys.DashboardNavigated, {
|
||||
numberOfNavigations: this.navigations
|
||||
});
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import * as nls from 'vs/nls';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
export class DatabaseDashboardPage extends DashboardPage implements OnInit {
|
||||
protected propertiesWidget: WidgetConfig = {
|
||||
@@ -44,9 +45,10 @@ export class DatabaseDashboardPage extends DashboardPage implements OnInit {
|
||||
@Inject(IInstantiationService) instantiationService: IInstantiationService,
|
||||
@Inject(INotificationService) notificationService: INotificationService,
|
||||
@Inject(IAngularEventingService) angularEventingService: IAngularEventingService,
|
||||
@Inject(IConfigurationService) configurationService: IConfigurationService
|
||||
@Inject(IConfigurationService) configurationService: IConfigurationService,
|
||||
@Inject(ILogService) logService: ILogService
|
||||
) {
|
||||
super(dashboardService, el, _cd, instantiationService, notificationService, angularEventingService, configurationService);
|
||||
super(dashboardService, el, _cd, instantiationService, notificationService, angularEventingService, configurationService, logService);
|
||||
this._register(dashboardService.onUpdatePage(() => {
|
||||
this.refresh(true);
|
||||
this._cd.detectChanges();
|
||||
|
||||
@@ -18,6 +18,7 @@ import * as nls from 'vs/nls';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
export class ServerDashboardPage extends DashboardPage implements OnInit {
|
||||
protected propertiesWidget: WidgetConfig = {
|
||||
@@ -45,9 +46,10 @@ export class ServerDashboardPage extends DashboardPage implements OnInit {
|
||||
@Inject(IInstantiationService) instantiationService: IInstantiationService,
|
||||
@Inject(INotificationService) notificationService: INotificationService,
|
||||
@Inject(IAngularEventingService) angularEventingService: IAngularEventingService,
|
||||
@Inject(IConfigurationService) configurationService: IConfigurationService
|
||||
@Inject(IConfigurationService) configurationService: IConfigurationService,
|
||||
@Inject(ILogService) logService: ILogService
|
||||
) {
|
||||
super(dashboardService, el, _cd, instantiationService, notificationService, angularEventingService, configurationService);
|
||||
super(dashboardService, el, _cd, instantiationService, notificationService, angularEventingService, configurationService, logService);
|
||||
|
||||
// special-case handling for MSSQL data provider
|
||||
const connInfo = this.dashboardService.connectionManagementService.connectionInfo;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Component, Input, Inject, ChangeDetectorRef, forwardRef, ElementRef, ViewChild } from '@angular/core';
|
||||
import { Component, Input, Inject, ChangeDetectorRef, forwardRef, ViewChild } from '@angular/core';
|
||||
import { BaseChartDirective } from 'ng2-charts';
|
||||
|
||||
import * as TelemetryKeys from 'sql/platform/telemetry/telemetryKeys';
|
||||
@@ -16,9 +16,10 @@ import { LegendPosition, ChartType, defaultChartConfig, IChartConfig, IDataSet,
|
||||
import * as colors from 'vs/platform/theme/common/colorRegistry';
|
||||
import * as types from 'vs/base/common/types';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IColorTheme, IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import * as nls from 'vs/nls';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
declare const Chart: any;
|
||||
|
||||
@@ -52,16 +53,16 @@ export abstract class ChartInsight extends Disposable implements IInsightsView {
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) private _changeRef: ChangeDetectorRef,
|
||||
@Inject(forwardRef(() => ElementRef)) private _el: ElementRef,
|
||||
@Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService,
|
||||
@Inject(ITelemetryService) private telemetryService: ITelemetryService
|
||||
@Inject(IThemeService) private themeService: IThemeService,
|
||||
@Inject(ITelemetryService) private telemetryService: ITelemetryService,
|
||||
@Inject(ILogService) private readonly logService: ILogService
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
init() {
|
||||
this._register(this.themeService.onDidColorThemeChange(e => this.updateTheme(e)));
|
||||
this.updateTheme(this.themeService.getColorTheme());
|
||||
this._register(this.themeService.onThemeChange(e => this.updateTheme(e)));
|
||||
this.updateTheme(this.themeService.getTheme());
|
||||
// Note: must use a boolean to not render the canvas until all properties such as the labels and chart type are set.
|
||||
// This is because chart.js doesn't auto-update anything other than dataset when re-rendering so defaults are used
|
||||
// hence it's easier to not render until ready
|
||||
@@ -75,7 +76,7 @@ export abstract class ChartInsight extends Disposable implements IInsightsView {
|
||||
this._hasError = true;
|
||||
this._changeRef.detectChanges();
|
||||
}
|
||||
TelemetryUtils.addTelemetry(this.telemetryService, TelemetryKeys.ChartCreated, { type: this.chartType });
|
||||
TelemetryUtils.addTelemetry(this.telemetryService, this.logService, TelemetryKeys.ChartCreated, { type: this.chartType });
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -93,7 +94,7 @@ export abstract class ChartInsight extends Disposable implements IInsightsView {
|
||||
return this._options;
|
||||
}
|
||||
|
||||
protected updateTheme(e: IColorTheme): void {
|
||||
protected updateTheme(e: ITheme): void {
|
||||
const foregroundColor = e.getColor(colors.editorForeground);
|
||||
const foreground = foregroundColor ? foregroundColor.toString() : null;
|
||||
const backgroundColor = e.getColor(colors.editorBackground);
|
||||
|
||||
@@ -7,11 +7,12 @@ import { ChartInsight } from 'sql/workbench/parts/dashboard/widgets/insights/vie
|
||||
import { mixin } from 'sql/base/common/objects';
|
||||
import { ChartType, IChartConfig, customMixin } from 'sql/workbench/parts/dashboard/widgets/insights/views/charts/interfaces';
|
||||
|
||||
import { IColorTheme, IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import * as colors from 'vs/platform/theme/common/colorRegistry';
|
||||
import { editorLineNumbers } from 'vs/editor/common/view/editorColorRegistry';
|
||||
import { ChangeDetectorRef, Inject, ElementRef, forwardRef } from '@angular/core';
|
||||
import { ChangeDetectorRef, Inject, forwardRef } from '@angular/core';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
export interface IBarChartConfig extends IChartConfig {
|
||||
yAxisMin: number;
|
||||
@@ -27,11 +28,11 @@ export default class BarChart extends ChartInsight {
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) _changeRef: ChangeDetectorRef,
|
||||
@Inject(forwardRef(() => ElementRef)) _el: ElementRef,
|
||||
@Inject(IWorkbenchThemeService) themeService: IWorkbenchThemeService,
|
||||
@Inject(ITelemetryService) telemetryService: ITelemetryService
|
||||
@Inject(IThemeService) themeService: IThemeService,
|
||||
@Inject(ITelemetryService) telemetryService: ITelemetryService,
|
||||
@Inject(ILogService) logService: ILogService
|
||||
) {
|
||||
super(_changeRef, _el, themeService, telemetryService);
|
||||
super(_changeRef, themeService, telemetryService, logService);
|
||||
}
|
||||
|
||||
public setConfig(config: IBarChartConfig): void {
|
||||
@@ -126,7 +127,7 @@ export default class BarChart extends ChartInsight {
|
||||
super.setConfig(config);
|
||||
}
|
||||
|
||||
protected updateTheme(e: IColorTheme): void {
|
||||
protected updateTheme(e: ITheme): void {
|
||||
super.updateTheme(e);
|
||||
const foregroundColor = e.getColor(colors.editorForeground);
|
||||
const foreground = foregroundColor ? foregroundColor.toString() : null;
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { mixin } from 'vs/base/common/objects';
|
||||
import { clone } from 'sql/base/common/objects';
|
||||
import { mixin, deepClone } from 'vs/base/common/objects';
|
||||
import { IJSONSchema } from 'vs/base/common/jsonSchema';
|
||||
import * as nls from 'vs/nls';
|
||||
|
||||
@@ -42,6 +41,6 @@ const properties: IJSONSchema = {
|
||||
}
|
||||
};
|
||||
|
||||
export const barChartSchema = mixin(clone(chartInsightSchema), properties) as IJSONSchema;
|
||||
export const barChartSchema = mixin(deepClone(chartInsightSchema), properties) as IJSONSchema;
|
||||
|
||||
registerInsight('bar', '', barChartSchema, BarChart);
|
||||
|
||||
@@ -5,19 +5,20 @@
|
||||
|
||||
import PieChart from './pieChart.component';
|
||||
import { ChartType } from 'sql/workbench/parts/dashboard/widgets/insights/views/charts/interfaces';
|
||||
import { ChangeDetectorRef, Inject, forwardRef, ElementRef } from '@angular/core';
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { ChangeDetectorRef, Inject, forwardRef } from '@angular/core';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
|
||||
export default class DoughnutChart extends PieChart {
|
||||
protected readonly chartType: ChartType = ChartType.Doughnut;
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) _changeRef: ChangeDetectorRef,
|
||||
@Inject(forwardRef(() => ElementRef)) _el: ElementRef,
|
||||
@Inject(IWorkbenchThemeService) themeService: IWorkbenchThemeService,
|
||||
@Inject(ITelemetryService) telemetryService: ITelemetryService
|
||||
@Inject(IThemeService) themeService: IThemeService,
|
||||
@Inject(ITelemetryService) telemetryService: ITelemetryService,
|
||||
@Inject(ILogService) logService: ILogService
|
||||
) {
|
||||
super(_changeRef, _el, themeService, telemetryService);
|
||||
super(_changeRef, themeService, telemetryService, logService);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { clone } from 'sql/base/common/objects';
|
||||
import { mixin } from 'vs/base/common/objects';
|
||||
import { mixin, deepClone } from 'vs/base/common/objects';
|
||||
import { IJSONSchema } from 'vs/base/common/jsonSchema';
|
||||
import { registerInsight } from 'sql/platform/dashboard/common/insightRegistry';
|
||||
import { chartInsightSchema } from 'sql/workbench/parts/dashboard/widgets/insights/views/charts/chartInsight.contribution';
|
||||
@@ -15,6 +14,6 @@ const properties: IJSONSchema = {
|
||||
|
||||
};
|
||||
|
||||
const doughnutChartSchema = mixin(clone(chartInsightSchema), properties) as IJSONSchema;
|
||||
const doughnutChartSchema = mixin(deepClone(chartInsightSchema), properties) as IJSONSchema;
|
||||
|
||||
registerInsight('doughnut', '', doughnutChartSchema, DoughnutChart);
|
||||
|
||||
@@ -5,19 +5,20 @@
|
||||
|
||||
import BarChart from './barChart.component';
|
||||
import { ChartType } from 'sql/workbench/parts/dashboard/widgets/insights/views/charts/interfaces';
|
||||
import { forwardRef, Inject, ChangeDetectorRef, ElementRef } from '@angular/core';
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { forwardRef, Inject, ChangeDetectorRef } from '@angular/core';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
export default class HorizontalBarChart extends BarChart {
|
||||
protected readonly chartType: ChartType = ChartType.HorizontalBar;
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) _changeRef: ChangeDetectorRef,
|
||||
@Inject(forwardRef(() => ElementRef)) _el: ElementRef,
|
||||
@Inject(IWorkbenchThemeService) themeService: IWorkbenchThemeService,
|
||||
@Inject(ITelemetryService) telemetryService: ITelemetryService
|
||||
@Inject(IThemeService) themeService: IThemeService,
|
||||
@Inject(ITelemetryService) telemetryService: ITelemetryService,
|
||||
@Inject(ILogService) logService: ILogService
|
||||
) {
|
||||
super(_changeRef, _el, themeService, telemetryService);
|
||||
super(_changeRef, themeService, telemetryService, logService);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { clone } from 'sql/base/common/objects';
|
||||
import { mixin } from 'vs/base/common/objects';
|
||||
import { mixin, deepClone } from 'vs/base/common/objects';
|
||||
import { IJSONSchema } from 'vs/base/common/jsonSchema';
|
||||
|
||||
import { registerInsight } from 'sql/platform/dashboard/common/insightRegistry';
|
||||
@@ -16,6 +15,6 @@ const properties: IJSONSchema = {
|
||||
|
||||
};
|
||||
|
||||
const horizontalBarSchema = mixin(clone(barChartSchema), properties) as IJSONSchema;
|
||||
const horizontalBarSchema = mixin(deepClone(barChartSchema), properties) as IJSONSchema;
|
||||
|
||||
registerInsight('horizontalBar', '', horizontalBarSchema, HorizontalBarChart);
|
||||
|
||||
@@ -3,21 +3,21 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { mixin } from 'vs/base/common/objects';
|
||||
import { mixin, deepClone } from 'vs/base/common/objects';
|
||||
|
||||
import BarChart, { IBarChartConfig } from './barChart.component';
|
||||
import { memoize, unmemoize } from 'sql/base/common/decorators';
|
||||
import { clone } from 'sql/base/common/objects';
|
||||
import { ChartType, DataType, defaultChartConfig, IDataSet, IPointDataSet } from 'sql/workbench/parts/dashboard/widgets/insights/views/charts/interfaces';
|
||||
import { ChangeDetectorRef, Inject, forwardRef, ElementRef } from '@angular/core';
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { ChangeDetectorRef, Inject, forwardRef } from '@angular/core';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
export interface ILineConfig extends IBarChartConfig {
|
||||
dataType?: DataType;
|
||||
}
|
||||
|
||||
const defaultLineConfig = mixin(clone(defaultChartConfig), { dataType: 'number' }) as ILineConfig;
|
||||
const defaultLineConfig = mixin(deepClone(defaultChartConfig), { dataType: 'number' }) as ILineConfig;
|
||||
|
||||
export default class LineChart extends BarChart {
|
||||
protected readonly chartType: ChartType = ChartType.Line;
|
||||
@@ -26,11 +26,11 @@ export default class LineChart extends BarChart {
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) _changeRef: ChangeDetectorRef,
|
||||
@Inject(forwardRef(() => ElementRef)) _el: ElementRef,
|
||||
@Inject(IWorkbenchThemeService) themeService: IWorkbenchThemeService,
|
||||
@Inject(ITelemetryService) telemetryService: ITelemetryService
|
||||
@Inject(IThemeService) themeService: IThemeService,
|
||||
@Inject(ITelemetryService) telemetryService: ITelemetryService,
|
||||
@Inject(ILogService) logService: ILogService
|
||||
) {
|
||||
super(_changeRef, _el, themeService, telemetryService);
|
||||
super(_changeRef, themeService, telemetryService, logService);
|
||||
}
|
||||
|
||||
public init() {
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { mixin } from 'vs/base/common/objects';
|
||||
import { clone } from 'sql/base/common/objects';
|
||||
import { mixin, deepClone } from 'vs/base/common/objects';
|
||||
import { IJSONSchema } from 'vs/base/common/jsonSchema';
|
||||
import * as nls from 'vs/nls';
|
||||
|
||||
@@ -25,6 +24,6 @@ const properties: IJSONSchema = {
|
||||
}
|
||||
};
|
||||
|
||||
export const lineSchema = mixin(clone(barChartSchema), properties) as IJSONSchema;
|
||||
export const lineSchema = mixin(deepClone(barChartSchema), properties) as IJSONSchema;
|
||||
|
||||
registerInsight('line', '', lineSchema, LineChart);
|
||||
|
||||
@@ -5,19 +5,20 @@
|
||||
|
||||
import { ChartInsight } from 'sql/workbench/parts/dashboard/widgets/insights/views/charts/chartInsight.component';
|
||||
import { ChartType } from 'sql/workbench/parts/dashboard/widgets/insights/views/charts/interfaces';
|
||||
import { ChangeDetectorRef, Inject, forwardRef, ElementRef } from '@angular/core';
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { ChangeDetectorRef, Inject, forwardRef } from '@angular/core';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
export default class PieChart extends ChartInsight {
|
||||
protected readonly chartType: ChartType = ChartType.Pie;
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) _changeRef: ChangeDetectorRef,
|
||||
@Inject(forwardRef(() => ElementRef)) _el: ElementRef,
|
||||
@Inject(IWorkbenchThemeService) themeService: IWorkbenchThemeService,
|
||||
@Inject(ITelemetryService) telemetryService: ITelemetryService
|
||||
@Inject(IThemeService) themeService: IThemeService,
|
||||
@Inject(ITelemetryService) telemetryService: ITelemetryService,
|
||||
@Inject(ILogService) logService: ILogService
|
||||
) {
|
||||
super(_changeRef, _el, themeService, telemetryService);
|
||||
super(_changeRef, themeService, telemetryService, logService);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { mixin } from 'vs/base/common/objects';
|
||||
import { clone } from 'sql/base/common/objects';
|
||||
import { mixin, deepClone } from 'vs/base/common/objects';
|
||||
import { IJSONSchema } from 'vs/base/common/jsonSchema';
|
||||
import { registerInsight } from 'sql/platform/dashboard/common/insightRegistry';
|
||||
import { chartInsightSchema } from 'sql/workbench/parts/dashboard/widgets/insights/views/charts/chartInsight.contribution';
|
||||
@@ -15,6 +14,6 @@ const properties: IJSONSchema = {
|
||||
|
||||
};
|
||||
|
||||
const pieSchema = mixin(clone(chartInsightSchema), properties) as IJSONSchema;
|
||||
const pieSchema = mixin(deepClone(chartInsightSchema), properties) as IJSONSchema;
|
||||
|
||||
registerInsight('pie', '', pieSchema, PieChart);
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import LineChart, { ILineConfig } from './lineChart.component';
|
||||
import { clone } from 'sql/base/common/objects';
|
||||
import { ChartType, defaultChartConfig } from 'sql/workbench/parts/dashboard/widgets/insights/views/charts/interfaces';
|
||||
|
||||
import { mixin } from 'vs/base/common/objects';
|
||||
import { ChangeDetectorRef, Inject, forwardRef, ElementRef } from '@angular/core';
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { mixin, deepClone } from 'vs/base/common/objects';
|
||||
import { ChangeDetectorRef, Inject, forwardRef } from '@angular/core';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
const defaultScatterConfig = mixin(clone(defaultChartConfig), { dataType: 'point', dataDirection: 'horizontal' }) as ILineConfig;
|
||||
const defaultScatterConfig = mixin(deepClone(defaultChartConfig), { dataType: 'point', dataDirection: 'horizontal' }) as ILineConfig;
|
||||
|
||||
export default class ScatterChart extends LineChart {
|
||||
protected readonly chartType: ChartType = ChartType.Scatter;
|
||||
@@ -20,10 +20,10 @@ export default class ScatterChart extends LineChart {
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) _changeRef: ChangeDetectorRef,
|
||||
@Inject(forwardRef(() => ElementRef)) _el: ElementRef,
|
||||
@Inject(IWorkbenchThemeService) themeService: IWorkbenchThemeService,
|
||||
@Inject(ITelemetryService) telemetryService: ITelemetryService
|
||||
@Inject(IThemeService) themeService: IThemeService,
|
||||
@Inject(ITelemetryService) telemetryService: ITelemetryService,
|
||||
@Inject(ILogService) logService: ILogService
|
||||
) {
|
||||
super(_changeRef, _el, themeService, telemetryService);
|
||||
super(_changeRef, themeService, telemetryService, logService);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { mixin } from 'vs/base/common/objects';
|
||||
import { clone } from 'sql/base/common/objects';
|
||||
import { mixin, deepClone } from 'vs/base/common/objects';
|
||||
import { IJSONSchema } from 'vs/base/common/jsonSchema';
|
||||
|
||||
import { registerInsight } from 'sql/platform/dashboard/common/insightRegistry';
|
||||
@@ -15,6 +14,6 @@ import ScatterChart from './scatterChart.component';
|
||||
const properties: IJSONSchema = {
|
||||
};
|
||||
|
||||
const scatterSchema = mixin(clone(barChartSchema), properties) as IJSONSchema;
|
||||
const scatterSchema = mixin(deepClone(barChartSchema), properties) as IJSONSchema;
|
||||
|
||||
registerInsight('scatter', '', scatterSchema, ScatterChart);
|
||||
|
||||
@@ -4,27 +4,27 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import LineChart, { ILineConfig } from './lineChart.component';
|
||||
import { clone } from 'sql/base/common/objects';
|
||||
import { ChartType, defaultChartConfig, IPointDataSet } from 'sql/workbench/parts/dashboard/widgets/insights/views/charts/interfaces';
|
||||
|
||||
import { mixin } from 'vs/base/common/objects';
|
||||
import { mixin, deepClone } from 'vs/base/common/objects';
|
||||
import { Color } from 'vs/base/common/color';
|
||||
import { ChangeDetectorRef, Inject, forwardRef, ElementRef } from '@angular/core';
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { ChangeDetectorRef, Inject, forwardRef } from '@angular/core';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
const defaultTimeSeriesConfig = mixin(clone(defaultChartConfig), { dataType: 'point', dataDirection: 'horizontal' }) as ILineConfig;
|
||||
const defaultTimeSeriesConfig = mixin(deepClone(defaultChartConfig), { dataType: 'point', dataDirection: 'horizontal' }) as ILineConfig;
|
||||
|
||||
export default class TimeSeriesChart extends LineChart {
|
||||
protected _defaultConfig = defaultTimeSeriesConfig;
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) _changeRef: ChangeDetectorRef,
|
||||
@Inject(forwardRef(() => ElementRef)) _el: ElementRef,
|
||||
@Inject(IWorkbenchThemeService) themeService: IWorkbenchThemeService,
|
||||
@Inject(ITelemetryService) telemetryService: ITelemetryService
|
||||
@Inject(IThemeService) themeService: IThemeService,
|
||||
@Inject(ITelemetryService) telemetryService: ITelemetryService,
|
||||
@Inject(ILogService) logService: ILogService
|
||||
) {
|
||||
super(_changeRef, _el, themeService, telemetryService);
|
||||
super(_changeRef, themeService, telemetryService, logService);
|
||||
}
|
||||
|
||||
protected addAxisLabels(): void {
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { mixin } from 'vs/base/common/objects';
|
||||
import { clone } from 'sql/base/common/objects';
|
||||
import { mixin, deepClone } from 'vs/base/common/objects';
|
||||
import { IJSONSchema } from 'vs/base/common/jsonSchema';
|
||||
|
||||
import { registerInsight } from 'sql/platform/dashboard/common/insightRegistry';
|
||||
@@ -15,6 +14,6 @@ import TimeSeriesChart from './timeSeriesChart.component';
|
||||
const properties: IJSONSchema = {
|
||||
};
|
||||
|
||||
const timeSeriesSchema = mixin(clone(barChartSchema), properties) as IJSONSchema;
|
||||
const timeSeriesSchema = mixin(deepClone(barChartSchema), properties) as IJSONSchema;
|
||||
|
||||
registerInsight('timeSeries', '', timeSeriesSchema, TimeSeriesChart);
|
||||
|
||||
@@ -9,7 +9,6 @@ import { DashboardWidget, IDashboardWidget, WidgetConfig, WIDGET_CONFIG } from '
|
||||
import { CommonServiceInterface } from 'sql/platform/bootstrap/node/commonServiceInterface.service';
|
||||
import { ConnectionManagementInfo } from 'sql/platform/connection/common/connectionManagementInfo';
|
||||
import { toDisposableSubscription } from 'sql/base/node/rxjsUtils';
|
||||
import { error } from 'sql/base/common/log';
|
||||
import { IDashboardRegistry, Extensions as DashboardExtensions } from 'sql/platform/dashboard/common/dashboardRegistry';
|
||||
|
||||
import { DatabaseInfo, ServerInfo } from 'azdata';
|
||||
@@ -18,6 +17,7 @@ import { EventType, addDisposableListener } from 'vs/base/browser/dom';
|
||||
import * as types from 'vs/base/common/types';
|
||||
import * as nls from 'vs/nls';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
export interface PropertiesConfig {
|
||||
properties: Array<Property>;
|
||||
@@ -72,12 +72,9 @@ export class PropertiesWidgetComponent extends DashboardWidget implements IDashb
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) private _changeRef: ChangeDetectorRef,
|
||||
@Inject(forwardRef(() => ElementRef)) private _el: ElementRef,
|
||||
@Inject(WIDGET_CONFIG) protected _config: WidgetConfig,
|
||||
consoleError?: ((message?: any, ...optionalParams: any[]) => void)
|
||||
@Inject(ILogService) private logService: ILogService
|
||||
) {
|
||||
super();
|
||||
if (consoleError) {
|
||||
this.consoleError = consoleError;
|
||||
}
|
||||
this.init();
|
||||
}
|
||||
|
||||
@@ -127,7 +124,7 @@ export class PropertiesWidgetComponent extends DashboardWidget implements IDashb
|
||||
const providerProperties = dashboardRegistry.getProperties(provider as string);
|
||||
|
||||
if (!providerProperties) {
|
||||
this.consoleError('No property definitions found for provider', provider);
|
||||
this.logService.error('No property definitions found for provider', provider);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -137,7 +134,7 @@ export class PropertiesWidgetComponent extends DashboardWidget implements IDashb
|
||||
if (providerProperties.flavors.length === 1) {
|
||||
flavor = providerProperties.flavors[0];
|
||||
} else if (providerProperties.flavors.length === 0) {
|
||||
this.consoleError('No flavor definitions found for "', provider,
|
||||
this.logService.error('No flavor definitions found for "', provider,
|
||||
'. If there are not multiple flavors of this provider, add one flavor without a condition');
|
||||
return;
|
||||
} else {
|
||||
@@ -153,17 +150,17 @@ export class PropertiesWidgetComponent extends DashboardWidget implements IDashb
|
||||
case '<=':
|
||||
return condition <= item.condition.value;
|
||||
default:
|
||||
this.consoleError('Could not parse operator: "', item.condition.operator,
|
||||
this.logService.error('Could not parse operator: "', item.condition.operator,
|
||||
'" on item "', item, '"');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
if (flavorArray.length === 0) {
|
||||
this.consoleError('Could not determine flavor');
|
||||
this.logService.error('Could not determine flavor');
|
||||
return;
|
||||
} else if (flavorArray.length > 1) {
|
||||
this.consoleError('Multiple flavors matched correctly for this provider', provider);
|
||||
this.logService.error('Multiple flavors matched correctly for this provider', provider);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -173,17 +170,17 @@ export class PropertiesWidgetComponent extends DashboardWidget implements IDashb
|
||||
// determine what context we should be pulling from
|
||||
if (this._config.context === 'database') {
|
||||
if (!Array.isArray(flavor.databaseProperties)) {
|
||||
this.consoleError('flavor', flavor.flavor, ' does not have a definition for database properties');
|
||||
this.logService.error('flavor', flavor.flavor, ' does not have a definition for database properties');
|
||||
}
|
||||
|
||||
if (!Array.isArray(flavor.serverProperties)) {
|
||||
this.consoleError('flavor', flavor.flavor, ' does not have a definition for server properties');
|
||||
this.logService.error('flavor', flavor.flavor, ' does not have a definition for server properties');
|
||||
}
|
||||
|
||||
propertyArray = flavor.databaseProperties;
|
||||
} else {
|
||||
if (!Array.isArray(flavor.serverProperties)) {
|
||||
this.consoleError('flavor', flavor.flavor, ' does not have a definition for server properties');
|
||||
this.logService.error('flavor', flavor.flavor, ' does not have a definition for server properties');
|
||||
}
|
||||
|
||||
propertyArray = flavor.serverProperties;
|
||||
@@ -237,9 +234,4 @@ export class PropertiesWidgetComponent extends DashboardWidget implements IDashb
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
// overwrittable console.error for testing
|
||||
private consoleError(message?: any, ...optionalParams: any[]): void {
|
||||
error(message, optionalParams);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,8 +15,6 @@ import * as Services from 'sql/base/browser/ui/table/formatters';
|
||||
import { IEditDataComponentParams } from 'sql/platform/bootstrap/node/bootstrapParams';
|
||||
import { GridParentComponent } from 'sql/workbench/parts/grid/views/gridParentComponent';
|
||||
import { EditDataGridActionProvider } from 'sql/workbench/parts/grid/views/editData/editDataGridActions';
|
||||
import { error } from 'sql/base/common/log';
|
||||
import { clone } from 'sql/base/common/objects';
|
||||
import { IQueryEditorService } from 'sql/workbench/services/queryEditor/common/queryEditorService';
|
||||
import { IBootstrapParams } from 'sql/platform/bootstrap/node/bootstrapService';
|
||||
import { RowNumberColumn } from 'sql/base/browser/ui/table/plugins/rowNumberColumn.plugin';
|
||||
@@ -35,6 +33,8 @@ import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService
|
||||
import { KeyCode } from 'vs/base/common/keyCodes';
|
||||
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { EditUpdateCellResult } from 'azdata';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { deepClone } from 'vs/base/common/objects';
|
||||
export const EDITDATA_SELECTOR: string = 'editdata-component';
|
||||
|
||||
@Component({
|
||||
@@ -96,9 +96,10 @@ export class EditDataComponent extends GridParentComponent implements OnInit, On
|
||||
@Inject(IContextKeyService) contextKeyService: IContextKeyService,
|
||||
@Inject(IConfigurationService) configurationService: IConfigurationService,
|
||||
@Inject(IClipboardService) clipboardService: IClipboardService,
|
||||
@Inject(IQueryEditorService) queryEditorService: IQueryEditorService
|
||||
@Inject(IQueryEditorService) queryEditorService: IQueryEditorService,
|
||||
@Inject(ILogService) logService: ILogService
|
||||
) {
|
||||
super(el, cd, contextMenuService, keybindingService, contextKeyService, configurationService, clipboardService, queryEditorService);
|
||||
super(el, cd, contextMenuService, keybindingService, contextKeyService, configurationService, clipboardService, queryEditorService, logService);
|
||||
this._el.nativeElement.className = 'slickgridContainer';
|
||||
this.dataService = params.dataService;
|
||||
this.actionProvider = this.instantiationService.createInstance(EditDataGridActionProvider, this.dataService, this.onGridSelectAll(), this.onDeleteRow(), this.onRevertRow());
|
||||
@@ -133,7 +134,7 @@ export class EditDataComponent extends GridParentComponent implements OnInit, On
|
||||
self.handleEditSessionReady(self, event);
|
||||
break;
|
||||
default:
|
||||
error('Unexpected query event type "' + event.type + '" sent');
|
||||
this.logService.error('Unexpected query event type "' + event.type + '" sent');
|
||||
break;
|
||||
}
|
||||
self._cd.detectChanges();
|
||||
@@ -381,7 +382,7 @@ export class EditDataComponent extends GridParentComponent implements OnInit, On
|
||||
self.dataSet = dataSet;
|
||||
|
||||
// Create a dataSet to render without rows to reduce DOM size
|
||||
let undefinedDataSet = clone(dataSet);
|
||||
let undefinedDataSet = deepClone(dataSet);
|
||||
undefinedDataSet.columnDefinitions = dataSet.columnDefinitions;
|
||||
undefinedDataSet.dataRows = undefined;
|
||||
undefinedDataSet.resized = new EventEmitter();
|
||||
|
||||
@@ -19,7 +19,6 @@ import * as actions from 'sql/workbench/parts/grid/views/gridActions';
|
||||
import * as Services from 'sql/base/browser/ui/table/formatters';
|
||||
import * as GridContentEvents from 'sql/workbench/parts/grid/common/gridContentEvents';
|
||||
import { ResultsVisibleContext, ResultsGridFocussedContext, ResultsMessagesFocussedContext, QueryEditorVisibleContext } from 'sql/workbench/parts/query/common/queryContext';
|
||||
import { error } from 'sql/base/common/log';
|
||||
import { IQueryEditorService } from 'sql/workbench/services/queryEditor/common/queryEditorService';
|
||||
import { CellSelectionModel } from 'sql/base/browser/ui/table/plugins/cellSelectionModel.plugin';
|
||||
|
||||
@@ -32,6 +31,7 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
export abstract class GridParentComponent {
|
||||
// CONSTANTS
|
||||
@@ -95,7 +95,8 @@ export abstract class GridParentComponent {
|
||||
protected contextKeyService: IContextKeyService,
|
||||
protected configurationService: IConfigurationService,
|
||||
protected clipboardService: IClipboardService,
|
||||
protected queryEditorService: IQueryEditorService
|
||||
protected queryEditorService: IQueryEditorService,
|
||||
protected logService: ILogService
|
||||
) {
|
||||
this.toDispose = [];
|
||||
}
|
||||
@@ -160,7 +161,7 @@ export abstract class GridParentComponent {
|
||||
self.goToNextGrid();
|
||||
break;
|
||||
default:
|
||||
error('Unexpected grid content event type "' + type + '" sent');
|
||||
this.logService.error('Unexpected grid content event type "' + type + '" sent');
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -32,6 +32,7 @@ import { OVERRIDE_EDITOR_THEMING_SETTING } from 'sql/workbench/services/notebook
|
||||
import * as notebookUtils from 'sql/workbench/parts/notebook/notebookUtils';
|
||||
import { UntitledEditorModel } from 'vs/workbench/common/editor/untitledEditorModel';
|
||||
import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
export const CODE_SELECTOR: string = 'code-component';
|
||||
const MARKDOWN_CLASS = 'markdown';
|
||||
@@ -102,7 +103,8 @@ export class CodeComponent extends AngularDisposable implements OnInit, OnChange
|
||||
@Inject(IModelService) private _modelService: IModelService,
|
||||
@Inject(IModeService) private _modeService: IModeService,
|
||||
@Inject(IConfigurationService) private _configurationService: IConfigurationService,
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) private _changeRef: ChangeDetectorRef
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) private _changeRef: ChangeDetectorRef,
|
||||
@Inject(ILogService) private readonly logService: ILogService
|
||||
) {
|
||||
super();
|
||||
this._cellToggleMoreActions = this._instantiationService.createInstance(CellToggleMoreActions);
|
||||
@@ -141,9 +143,9 @@ export class CodeComponent extends AngularDisposable implements OnInit, OnChange
|
||||
let cellUri = this.cellModel.cellUri.toString();
|
||||
let connectionService = this.connectionService;
|
||||
if (!shouldConnect && connectionService && connectionService.isConnected(cellUri)) {
|
||||
connectionService.disconnect(cellUri).catch(e => console.log(e));
|
||||
connectionService.disconnect(cellUri).catch(e => this.logService.error(e));
|
||||
} else if (shouldConnect && this._model.activeConnection && this._model.activeConnection.id !== '-1') {
|
||||
connectionService.connect(this._model.activeConnection, cellUri).catch(e => console.log(e));
|
||||
connectionService.connect(this._model.activeConnection, cellUri).catch(e => this.logService.error(e));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import { ICellModel, CellExecutionState } from 'sql/workbench/parts/notebook/mod
|
||||
import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
|
||||
import { MultiStateAction, IMultiStateData } from 'sql/workbench/parts/notebook/notebookActions';
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
let notebookMoreActionMsg = localize('notebook.failed', "Please select active cell and try again");
|
||||
const emptyExecutionCountLabel = '[ ]';
|
||||
@@ -69,13 +70,15 @@ export class RunCellAction extends MultiStateAction<CellExecutionState> {
|
||||
private _context: CellContext;
|
||||
constructor(context: CellContext, @INotificationService private notificationService: INotificationService,
|
||||
@IConnectionManagementService private connectionManagementService: IConnectionManagementService,
|
||||
@IKeybindingService private keybindingService: IKeybindingService) {
|
||||
@IKeybindingService keybindingService: IKeybindingService,
|
||||
@ILogService logService: ILogService
|
||||
) {
|
||||
super(RunCellAction.ID, new IMultiStateData<CellExecutionState>([
|
||||
{ key: CellExecutionState.Hidden, value: { label: emptyExecutionCountLabel, className: '', tooltip: '', hideIcon: true } },
|
||||
{ key: CellExecutionState.Stopped, value: { label: '', className: 'toolbarIconRun', tooltip: localize('runCell', "Run cell"), commandId: 'notebook.command.runactivecell' } },
|
||||
{ key: CellExecutionState.Running, value: { label: '', className: 'toolbarIconStop', tooltip: localize('stopCell', "Cancel execution") } },
|
||||
{ key: CellExecutionState.Error, value: { label: '', className: 'toolbarIconRunError', tooltip: localize('errorRunCell', "Error on last run. Click to run again") } },
|
||||
], CellExecutionState.Hidden), keybindingService);
|
||||
], CellExecutionState.Hidden), keybindingService, logService);
|
||||
this.ensureContextIsUpdated(context);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import { nb, connection } from 'azdata';
|
||||
|
||||
import { localize } from 'vs/nls';
|
||||
@@ -24,6 +22,7 @@ import { ISingleNotebookEditOperation } from 'sql/workbench/api/common/sqlExtHos
|
||||
import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
|
||||
import { uriPrefixes } from 'sql/platform/connection/common/utils';
|
||||
import { keys } from 'vs/base/common/map';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
/*
|
||||
* Used to control whether a message in a dialog/wizard is displayed as an error,
|
||||
@@ -74,7 +73,11 @@ export class NotebookModel extends Disposable implements INotebookModel {
|
||||
private _clientSessionListeners: IDisposable[] = [];
|
||||
private _connectionUrisToDispose: string[] = [];
|
||||
|
||||
constructor(private _notebookOptions: INotebookModelOptions, startSessionImmediately?: boolean, public connectionProfile?: IConnectionProfile) {
|
||||
constructor(
|
||||
private _notebookOptions: INotebookModelOptions,
|
||||
public connectionProfile: IConnectionProfile | undefined,
|
||||
@ILogService private readonly logService: ILogService
|
||||
) {
|
||||
super();
|
||||
if (!_notebookOptions || !_notebookOptions.notebookUri || !_notebookOptions.notebookManagers) {
|
||||
throw new Error('path or notebook service not defined');
|
||||
@@ -588,7 +591,7 @@ export class NotebookModel extends Disposable implements INotebookModel {
|
||||
await this.updateKernelInfoOnKernelChange(kernel);
|
||||
} catch (err2) {
|
||||
// TODO should we handle this in any way?
|
||||
console.log(`doChangeKernel: ignoring error ${notebookUtils.getErrorMessage(err2)}`);
|
||||
this.logService.error(`doChangeKernel: ignoring error ${notebookUtils.getErrorMessage(err2)}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -777,7 +780,7 @@ export class NotebookModel extends Disposable implements INotebookModel {
|
||||
}
|
||||
await this.shutdownActiveSession();
|
||||
} catch (err) {
|
||||
console.log('An error occurred when closing the notebook: {0}', notebookUtils.getErrorMessage(err));
|
||||
this.logService.error('An error occurred when closing the notebook: {0}', notebookUtils.getErrorMessage(err));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -895,14 +898,14 @@ export class NotebookModel extends Disposable implements INotebookModel {
|
||||
private async disconnectNotebookConnection(conn: ConnectionProfile): Promise<void> {
|
||||
if (this.notebookOptions.connectionService.getConnectionUri(conn).includes(uriPrefixes.notebook)) {
|
||||
let uri = this._notebookOptions.connectionService.getConnectionUri(conn);
|
||||
await this.notebookOptions.connectionService.disconnect(uri).catch(e => console.log(e));
|
||||
await this.notebookOptions.connectionService.disconnect(uri).catch(e => this.logService.error(e));
|
||||
}
|
||||
}
|
||||
|
||||
// Disconnect any connections that were added through the "Add new connection" functionality in the Attach To dropdown
|
||||
private async disconnectAttachToConnections(): Promise<void> {
|
||||
notebookUtils.asyncForEach(this._connectionUrisToDispose, async conn => {
|
||||
await this.notebookOptions.connectionService.disconnect(conn).catch(e => console.log(e));
|
||||
await this.notebookOptions.connectionService.disconnect(conn).catch(e => this.logService.error(e));
|
||||
});
|
||||
this._connectionUrisToDispose = [];
|
||||
}
|
||||
|
||||
@@ -41,12 +41,12 @@ import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilit
|
||||
import { CellMagicMapper } from 'sql/workbench/parts/notebook/models/cellMagicMapper';
|
||||
import { IExtensionsViewlet, VIEWLET_ID } from 'vs/workbench/contrib/extensions/common/extensions';
|
||||
import { CellModel } from 'sql/workbench/parts/notebook/models/cell';
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { FileOperationError, FileOperationResult } from 'vs/platform/files/common/files';
|
||||
import { isValidBasename } from 'vs/base/common/extpath';
|
||||
import { basename } from 'vs/base/common/resources';
|
||||
import { createErrorWithActions, isErrorWithActions } from 'vs/base/common/errorsWithActions';
|
||||
import { createErrorWithActions } from 'vs/base/common/errorsWithActions';
|
||||
import { toErrorMessage } from 'vs/base/common/errorMessage';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
|
||||
|
||||
@@ -93,8 +93,8 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
|
||||
@Inject(IKeybindingService) private keybindingService: IKeybindingService,
|
||||
@Inject(IViewletService) private viewletService: IViewletService,
|
||||
@Inject(ICapabilitiesService) private capabilitiesService: ICapabilitiesService,
|
||||
@Inject(ICommandService) private commandService: ICommandService,
|
||||
@Inject(ITextFileService) private textFileService: ITextFileService
|
||||
@Inject(ITextFileService) private textFileService: ITextFileService,
|
||||
@Inject(ILogService) private readonly logService: ILogService
|
||||
) {
|
||||
super();
|
||||
this.updateProfile();
|
||||
@@ -292,7 +292,7 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
|
||||
defaultKernel: this._notebookParams.input.defaultKernel,
|
||||
layoutChanged: this._notebookParams.input.layoutChanged,
|
||||
capabilitiesService: this.capabilitiesService
|
||||
}, false, this.profile);
|
||||
}, this.profile, this.logService);
|
||||
model.onError((errInfo: INotification) => this.handleModelError(errInfo));
|
||||
await model.requestModelLoad(this._notebookParams.isTrusted);
|
||||
model.contentChanged((change) => this.handleContentChanged(change));
|
||||
@@ -400,7 +400,7 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
|
||||
|
||||
let attachToContainer = document.createElement('div');
|
||||
let attachToDropdown = new AttachToDropdown(attachToContainer, this.contextViewService, this.modelReady,
|
||||
this.connectionManagementService, this.connectionDialogService, this.notificationService, this.capabilitiesService);
|
||||
this.connectionManagementService, this.connectionDialogService, this.notificationService, this.capabilitiesService, this.logService);
|
||||
attachToDropdown.render(attachToContainer);
|
||||
attachSelectBoxStyler(attachToDropdown, this.themeService);
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import { IConnectionDialogService } from 'sql/workbench/services/connection/comm
|
||||
import { NotebookModel } from 'sql/workbench/parts/notebook/models/notebookModel';
|
||||
import { generateUri } from 'sql/platform/connection/common/utils';
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
const msgLoading = localize('loading', "Loading kernels...");
|
||||
const msgChanging = localize('changing', "Changing kernel...");
|
||||
@@ -164,7 +165,11 @@ export class IMultiStateData<T> {
|
||||
|
||||
export abstract class MultiStateAction<T> extends Action {
|
||||
|
||||
constructor(id: string, protected states: IMultiStateData<T>, private _keybindingService: IKeybindingService) {
|
||||
constructor(
|
||||
id: string,
|
||||
protected states: IMultiStateData<T>,
|
||||
private _keybindingService: IKeybindingService,
|
||||
private readonly logService: ILogService) {
|
||||
super(id, '');
|
||||
this.updateLabelAndIcon();
|
||||
}
|
||||
@@ -178,7 +183,7 @@ export abstract class MultiStateAction<T> extends Action {
|
||||
keyboardShortcut = binding ? binding.getLabel() : undefined;
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
this.logService.error(error);
|
||||
}
|
||||
this.label = this.states.label;
|
||||
this.tooltip = keyboardShortcut ? this.states.tooltip + ` (${keyboardShortcut})` : this.states.tooltip;
|
||||
@@ -313,11 +318,14 @@ export class KernelsDropdown extends SelectBox {
|
||||
export class AttachToDropdown extends SelectBox {
|
||||
private model: NotebookModel;
|
||||
|
||||
constructor(container: HTMLElement, contextViewProvider: IContextViewProvider, modelReady: Promise<INotebookModel>,
|
||||
constructor(
|
||||
container: HTMLElement, contextViewProvider: IContextViewProvider, modelReady: Promise<INotebookModel>,
|
||||
@IConnectionManagementService private _connectionManagementService: IConnectionManagementService,
|
||||
@IConnectionDialogService private _connectionDialogService: IConnectionDialogService,
|
||||
@INotificationService private _notificationService: INotificationService,
|
||||
@ICapabilitiesService private _capabilitiesService: ICapabilitiesService) {
|
||||
@ICapabilitiesService private _capabilitiesService: ICapabilitiesService,
|
||||
@ILogService private readonly logService: ILogService
|
||||
) {
|
||||
super([msgLoadingContexts], msgLoadingContexts, contextViewProvider, container, { labelText: attachToLabel, labelOnTop: false } as ISelectBoxOptionsWithLabel);
|
||||
if (modelReady) {
|
||||
modelReady
|
||||
@@ -366,7 +374,7 @@ export class AttachToDropdown extends SelectBox {
|
||||
this.openConnectionDialog(true);
|
||||
}
|
||||
}).catch(err =>
|
||||
console.log(err));
|
||||
this.logService.error(err));
|
||||
}
|
||||
model.onValidConnectionSelected(validConnection => {
|
||||
this.handleContextsChanged(!validConnection);
|
||||
|
||||
@@ -26,6 +26,7 @@ import { ServerGroupViewModel } from 'sql/workbench/parts/objectExplorer/common/
|
||||
import { attachButtonStyler, attachModalDialogStyler } from 'sql/platform/theme/common/styler';
|
||||
import * as TelemetryKeys from 'sql/platform/telemetry/telemetryKeys';
|
||||
import { IClipboardService } from 'sql/platform/clipboard/common/clipboardService';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
export class ServerGroupDialog extends Modal {
|
||||
private _addServerButton: Button;
|
||||
@@ -53,9 +54,10 @@ export class ServerGroupDialog extends Modal {
|
||||
@IContextViewService private _contextViewService: IContextViewService,
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@IClipboardService clipboardService: IClipboardService
|
||||
@IClipboardService clipboardService: IClipboardService,
|
||||
@ILogService logService: ILogService
|
||||
) {
|
||||
super(localize('ServerGroupsDialogTitle', 'Server Groups'), TelemetryKeys.ServerGroups, telemetryService, layoutService, clipboardService, themeService, contextKeyService);
|
||||
super(localize('ServerGroupsDialogTitle', 'Server Groups'), TelemetryKeys.ServerGroups, telemetryService, layoutService, clipboardService, themeService, logService, contextKeyService);
|
||||
}
|
||||
|
||||
public render() {
|
||||
|
||||
@@ -24,7 +24,8 @@ import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
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 EventItem {
|
||||
|
||||
@@ -309,14 +310,15 @@ export class ProfilerColumnEditorDialog extends Modal {
|
||||
private _treeContainer: HTMLElement;
|
||||
|
||||
constructor(
|
||||
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
|
||||
@ILayoutService layoutService: ILayoutService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@IContextViewService private _contextViewService: IContextViewService,
|
||||
@IClipboardService clipboardService: IClipboardService
|
||||
@IClipboardService clipboardService: IClipboardService,
|
||||
@ILogService logService: ILogService
|
||||
) {
|
||||
super(nls.localize('profilerColumnDialog.profiler', 'Profiler'), TelemetryKeys.Profiler, telemetryService, layoutService, clipboardService, themeService, contextKeyService);
|
||||
super(nls.localize('profilerColumnDialog.profiler', 'Profiler'), TelemetryKeys.Profiler, telemetryService, layoutService, clipboardService, themeService, logService, contextKeyService);
|
||||
}
|
||||
|
||||
public render(): void {
|
||||
|
||||
@@ -23,7 +23,8 @@ import { generateUuid } from 'vs/base/common/uuid';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { ProfilerFilter, ProfilerFilterClause, ProfilerFilterClauseOperator } from 'sql/workbench/services/profiler/common/interfaces';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
|
||||
|
||||
const ClearText: string = localize('profilerFilterDialog.clear', "Clear All");
|
||||
@@ -70,12 +71,13 @@ export class ProfilerFilterDialog extends Modal {
|
||||
constructor(
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IClipboardService clipboardService: IClipboardService,
|
||||
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
|
||||
@ILayoutService layoutService: ILayoutService,
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@ILogService logService: ILogService,
|
||||
@IContextViewService private contextViewService: IContextViewService
|
||||
) {
|
||||
super('', TelemetryKeys.ProfilerFilter, telemetryService, layoutService, clipboardService, themeService, contextKeyService, { isFlyout: false, hasTitleIcon: true });
|
||||
super('', TelemetryKeys.ProfilerFilter, telemetryService, layoutService, clipboardService, themeService, logService, contextKeyService, { isFlyout: false, hasTitleIcon: true });
|
||||
}
|
||||
|
||||
public open(input: ProfilerInput) {
|
||||
|
||||
@@ -21,7 +21,6 @@ import { hyperLinkFormatter, textFormatter } from 'sql/base/browser/ui/table/for
|
||||
import { CopyKeybind } from 'sql/base/browser/ui/table/plugins/copyKeybind.plugin';
|
||||
import { AdditionalKeyBindings } from 'sql/base/browser/ui/table/plugins/additionalKeyBindings.plugin';
|
||||
import { ITableStyles, ITableMouseEvent } from 'sql/base/browser/ui/table/interfaces';
|
||||
import { warn } from 'sql/base/common/log';
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
|
||||
@@ -43,6 +42,7 @@ import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/un
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IAction } from 'vs/base/common/actions';
|
||||
import { ScrollbarVisibility } from 'vs/base/common/scrollable';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
const ROW_HEIGHT = 29;
|
||||
const HEADER_HEIGHT = 26;
|
||||
@@ -134,7 +134,8 @@ export class GridPanel extends ViewletPanel {
|
||||
@IContextMenuService contextMenuService: IContextMenuService,
|
||||
@IConfigurationService configurationService: IConfigurationService,
|
||||
@IThemeService private themeService: IThemeService,
|
||||
@IInstantiationService private instantiationService: IInstantiationService
|
||||
@IInstantiationService private instantiationService: IInstantiationService,
|
||||
@ILogService private logService: ILogService
|
||||
) {
|
||||
super(options, keybindingService, contextMenuService, configurationService);
|
||||
this.splitView = new ScrollableSplitView(this.container, { enableResizing: false, verticalScrollbarVisibility: ScrollbarVisibility.Visible });
|
||||
@@ -257,7 +258,7 @@ export class GridPanel extends ViewletPanel {
|
||||
if (table) {
|
||||
table.updateResult(set);
|
||||
} else {
|
||||
warn('Got result set update request for non-existant table');
|
||||
this.logService.warn('Got result set update request for non-existant table');
|
||||
}
|
||||
}
|
||||
sizeChanges();
|
||||
|
||||
@@ -42,6 +42,7 @@ import { TabbedPanel, PanelTabIdentifier } from 'sql/base/browser/ui/panel/panel
|
||||
import { ServiceOptionType } from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||
import { IClipboardService } from 'sql/platform/clipboard/common/clipboardService';
|
||||
import { IFileBrowserDialogController } from 'sql/workbench/services/fileBrowser/common/fileBrowserDialogController';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
interface FileListElement {
|
||||
logicalFileName: string;
|
||||
@@ -135,8 +136,9 @@ export class RestoreDialog extends Modal {
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@IFileBrowserDialogController private fileBrowserDialogService: IFileBrowserDialogController,
|
||||
@IClipboardService clipboardService: IClipboardService,
|
||||
@ILogService logService: ILogService
|
||||
) {
|
||||
super(localize('RestoreDialogTitle', "Restore database"), TelemetryKeys.Restore, telemetryService, layoutService, clipboardService, themeService, contextKeyService, { hasErrors: true, isWide: true, hasSpinner: true });
|
||||
super(localize('RestoreDialogTitle', "Restore database"), TelemetryKeys.Restore, telemetryService, layoutService, clipboardService, themeService, logService, contextKeyService, { hasErrors: true, isWide: true, hasSpinner: true });
|
||||
this._restoreTitle = localize('restoreDialog.restoreTitle', "Restore database");
|
||||
this._databaseTitle = localize('restoreDialog.database', "Database");
|
||||
this._backupFileTitle = localize('restoreDialog.backupFile', "Backup file");
|
||||
|
||||
@@ -19,6 +19,8 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
||||
import { WebviewElement } from 'vs/workbench/contrib/webview/electron-browser/webviewElement';
|
||||
import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
export class WebViewDialog extends Modal {
|
||||
|
||||
@@ -40,12 +42,13 @@ export class WebViewDialog extends Modal {
|
||||
constructor(
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IClipboardService clipboardService: IClipboardService,
|
||||
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
|
||||
@ILayoutService layoutService: ILayoutService,
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@ILogService logService: ILogService,
|
||||
@IInstantiationService private _instantiationService: IInstantiationService
|
||||
) {
|
||||
super('', TelemetryKeys.WebView, telemetryService, layoutService, clipboardService, themeService, contextKeyService, { isFlyout: false, hasTitleIcon: true });
|
||||
super('', TelemetryKeys.WebView, telemetryService, layoutService, clipboardService, themeService, logService, contextKeyService, { isFlyout: false, hasTitleIcon: true });
|
||||
this._okLabel = localize('webViewDialog.ok', 'OK');
|
||||
this._closeLabel = localize('webViewDialog.close', 'Close');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user