mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-21 09:35:38 -05:00
Merge from vscode a348d103d1256a06a2c9b3f9b406298a9fef6898 (#15681)
* Merge from vscode a348d103d1256a06a2c9b3f9b406298a9fef6898 * Fixes and cleanup * Distro * Fix hygiene yarn * delete no yarn lock changes file * Fix hygiene * Fix layer check * Fix CI * Skip lib checks * Remove tests deleted in vs code * Fix tests * Distro * Fix tests and add removed extension point * Skip failing notebook tests for now * Disable broken tests and cleanup build folder * Update yarn.lock and fix smoke tests * Bump sqlite * fix contributed actions and file spacing * Fix user data path * Update yarn.locks Co-authored-by: ADS Merger <karlb@microsoft.com>
This commit is contained in:
@@ -247,7 +247,7 @@ export class DashboardGridContainer extends DashboardTab implements OnDestroy {
|
||||
return new Array(max).fill(0).map((x, i) => i);
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
override ngOnDestroy() {
|
||||
this.dispose();
|
||||
}
|
||||
|
||||
@@ -283,6 +283,6 @@ export class DashboardGridContainer extends DashboardTab implements OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
public enableEdit(): void {
|
||||
public override enableEdit(): void {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,10 +17,10 @@ import { DashboardWidgetWrapper } from 'sql/workbench/contrib/dashboard/browser/
|
||||
import { TabChild } from 'sql/base/browser/ui/panel/tab.component';
|
||||
|
||||
import { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { DASHBOARD_BORDER } from 'vs/workbench/common/theme';
|
||||
import { IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { contrastBorder } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { DASHBOARD_BORDER } from 'sql/workbench/common/theme';
|
||||
|
||||
@Component({
|
||||
selector: 'dashboard-home-container',
|
||||
@@ -53,7 +53,7 @@ export class DashboardHomeContainer extends DashboardWidgetContainer {
|
||||
super(_cd);
|
||||
}
|
||||
|
||||
ngAfterContentInit() {
|
||||
override ngAfterContentInit() {
|
||||
this.updateTheme(this.themeService.getColorTheme());
|
||||
this._register(this.themeService.onDidColorThemeChange((event: IColorTheme) => {
|
||||
this.updateTheme(event);
|
||||
@@ -90,7 +90,7 @@ export class DashboardHomeContainer extends DashboardWidgetContainer {
|
||||
}
|
||||
}
|
||||
|
||||
public refresh(): void {
|
||||
public override refresh(): void {
|
||||
super.refresh();
|
||||
this._propertiesClass.refresh();
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ export class DashboardNavSection extends DashboardTab implements OnDestroy, OnCh
|
||||
}
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
override ngOnDestroy() {
|
||||
this.dispose();
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ export class DashboardNavSection extends DashboardTab implements OnDestroy, OnCh
|
||||
}
|
||||
}
|
||||
|
||||
public enableEdit(): void {
|
||||
public override enableEdit(): void {
|
||||
if (this._tabs) {
|
||||
this._tabs.forEach(tabContent => {
|
||||
tabContent.enableEdit();
|
||||
|
||||
@@ -66,7 +66,7 @@ export class DashboardWidgetContainer extends DashboardTab implements AfterConte
|
||||
this._widgetContent.refresh();
|
||||
}
|
||||
|
||||
public enableEdit(): void {
|
||||
public override enableEdit(): void {
|
||||
this._widgetContent.enableEdit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { values } from 'vs/base/common/collections';
|
||||
import { IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
import { DASHBOARD_BORDER } from 'sql/workbench/common/theme';
|
||||
|
||||
const componentMap: { [x: string]: Type<IDashboardWidget> } = {
|
||||
'properties-widget': PropertiesWidgetComponent,
|
||||
@@ -257,7 +258,7 @@ export class DashboardWidgetWrapper extends AngularDisposable implements OnInit
|
||||
if (!this._config.hideHeader) {
|
||||
const el = <HTMLElement>this._ref.nativeElement;
|
||||
const headerEl: HTMLElement = this.header.nativeElement;
|
||||
let borderColor = theme.getColor(themeColors.DASHBOARD_BORDER);
|
||||
let borderColor = theme.getColor(DASHBOARD_BORDER);
|
||||
let backgroundColor = theme.getColor(colors.editorBackground, true);
|
||||
const foregroundColor = theme.getColor(themeColors.SIDE_BAR_FOREGROUND, true);
|
||||
const border = theme.getColor(colors.contrastBorder, true);
|
||||
|
||||
@@ -107,7 +107,7 @@ export class WebviewContent extends AngularDisposable implements OnInit, IDashbo
|
||||
this._webview.mountTo(this._el.nativeElement);
|
||||
|
||||
this._onMessageDisposable = this._webview.onMessage(e => {
|
||||
this._onMessage.fire(e);
|
||||
this._onMessage.fire(e.message);
|
||||
});
|
||||
if (this._html) {
|
||||
this._webview.html = this._html;
|
||||
|
||||
@@ -30,7 +30,7 @@ export class EditDashboardAction extends Action {
|
||||
super(EditDashboardAction.ID, EditDashboardAction.EDITLABEL, EditDashboardAction.ICON);
|
||||
}
|
||||
|
||||
async run(): Promise<void> {
|
||||
override async run(): Promise<void> {
|
||||
this.editFn.apply(this.context);
|
||||
this.toggleLabel();
|
||||
}
|
||||
@@ -59,7 +59,7 @@ export class RefreshWidgetAction extends Action {
|
||||
super(RefreshWidgetAction.ID, RefreshWidgetAction.LABEL, RefreshWidgetAction.ICON);
|
||||
}
|
||||
|
||||
async run(): Promise<void> {
|
||||
override async run(): Promise<void> {
|
||||
this.refreshFn.apply(this.context);
|
||||
}
|
||||
}
|
||||
@@ -76,7 +76,7 @@ export class ToolbarAction extends Action {
|
||||
super(id, label, cssClass);
|
||||
}
|
||||
|
||||
async run(): Promise<void> {
|
||||
override async run(): Promise<void> {
|
||||
try {
|
||||
this.runFn.apply(this.context, [this.id]);
|
||||
} catch (e) {
|
||||
@@ -99,7 +99,7 @@ export class ToggleMoreWidgetAction extends Action {
|
||||
super(ToggleMoreWidgetAction.ID, ToggleMoreWidgetAction.LABEL, ToggleMoreWidgetAction.ICON);
|
||||
}
|
||||
|
||||
async run(context: StandardKeyboardEvent): Promise<void> {
|
||||
override async run(context: StandardKeyboardEvent): Promise<void> {
|
||||
this._contextMenuService.showContextMenu({
|
||||
getAnchor: () => context.target,
|
||||
getActions: () => this._actions,
|
||||
@@ -121,7 +121,7 @@ export class DeleteWidgetAction extends Action {
|
||||
super(DeleteWidgetAction.ID, DeleteWidgetAction.LABEL, DeleteWidgetAction.ICON);
|
||||
}
|
||||
|
||||
async run(): Promise<void> {
|
||||
override async run(): Promise<void> {
|
||||
this.angularEventService.sendAngularEvent(this._uri, AngularEventType.DELETE_WIDGET, { id: this._widgetId });
|
||||
}
|
||||
}
|
||||
@@ -153,7 +153,7 @@ export class PinUnpinTabAction extends Action {
|
||||
}
|
||||
}
|
||||
|
||||
public async run(): Promise<void> {
|
||||
public override async run(): Promise<void> {
|
||||
this._isPinned = !this._isPinned;
|
||||
this.updatePinStatus();
|
||||
this.angularEventService.sendAngularEvent(this._uri, AngularEventType.PINUNPIN_TAB, { tabId: this._tabId, isPinned: this._isPinned });
|
||||
@@ -176,7 +176,7 @@ export class AddFeatureTabAction extends Action {
|
||||
this._register(this._angularEventService.onAngularEvent(this._uri)(event => this.handleDashboardEvent(event)));
|
||||
}
|
||||
|
||||
async run(): Promise<void> {
|
||||
override async run(): Promise<void> {
|
||||
this._newDashboardTabService.showDialog(this._dashboardTabs, this._openedTabs, this._uri);
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ export class CollapseWidgetAction extends Action {
|
||||
this.expanded = !this.collpasedState;
|
||||
}
|
||||
|
||||
async run(): Promise<void> {
|
||||
override async run(): Promise<void> {
|
||||
this._toggleState();
|
||||
this._angularEventService.sendAngularEvent(this._uri, AngularEventType.COLLAPSE_WIDGET, this._widgetUuid);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import * as nls from 'vs/nls';
|
||||
import * as objects from 'vs/base/common/objects';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { Action, IAction, IActionViewItem } from 'vs/base/common/actions';
|
||||
import { Action, IAction, SubmenuAction } from 'vs/base/common/actions';
|
||||
import { ConfigurationTarget } from 'vs/platform/configuration/common/configuration';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
@@ -47,11 +47,13 @@ import { fillInActions } from 'vs/platform/actions/browser/menuEntryActionViewIt
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { NAV_SECTION } from 'sql/workbench/contrib/dashboard/browser/containers/dashboardNavSection.contribution';
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { DASHBOARD_BORDER, EDITOR_PANE_BACKGROUND, TOOLBAR_OVERFLOW_SHADOW } from 'vs/workbench/common/theme';
|
||||
import { EDITOR_PANE_BACKGROUND } from 'vs/workbench/common/theme';
|
||||
import { IColorTheme, registerThemingParticipant, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
|
||||
import { attachTabbedPanelStyler } from 'sql/workbench/common/styler';
|
||||
import { focusBorder } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { LabeledMenuItemActionItem } from 'sql/platform/actions/browser/menuEntryActionViewItem';
|
||||
import { DASHBOARD_BORDER, TOOLBAR_OVERFLOW_SHADOW } from 'sql/workbench/common/theme';
|
||||
import { IActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
|
||||
const dashboardRegistry = Registry.as<IDashboardRegistry>(DashboardExtensions.DashboardContributions);
|
||||
const homeTabGroupId = 'home';
|
||||
@@ -179,7 +181,7 @@ export abstract class DashboardPage extends AngularDisposable implements IConfig
|
||||
let secondary: IAction[] = [];
|
||||
const menu = this.menuService.createMenu(MenuId.DashboardToolbar, this.contextKeyService);
|
||||
let groups = menu.getActions({ arg: this.connectionManagementService.connectionInfo.connectionProfile.toIConnectionProfile(), shouldForwardArgs: true });
|
||||
fillInActions(groups, { primary, secondary }, false, (group: string) => group === undefined || group === '');
|
||||
fillInActions(groups, { primary, secondary }, false, '', Number.MAX_SAFE_INTEGER, (action: SubmenuAction, group: string, groupSize: number) => group === undefined || group === '');
|
||||
|
||||
primary.forEach(a => {
|
||||
if (a instanceof MenuItemAction) {
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { DASHBOARD_WIDGET_TITLE, DASHBOARD_WIDGET_SUBTEXT } from 'sql/workbench/common/theme';
|
||||
import 'vs/css!./dashboardPanel';
|
||||
import { registerThemingParticipant, IColorTheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
|
||||
import { DASHBOARD_WIDGET_SUBTEXT, DASHBOARD_WIDGET_TITLE } from 'vs/workbench/common/theme';
|
||||
|
||||
registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) => {
|
||||
// widget title
|
||||
|
||||
@@ -10,7 +10,6 @@ import { TabChild } from 'sql/base/browser/ui/panel/tab.component';
|
||||
import { SingleConnectionManagementService } from 'sql/workbench/services/bootstrap/browser/commonServiceInterface.service';
|
||||
|
||||
export abstract class DashboardTab extends TabChild {
|
||||
public abstract layout(): void;
|
||||
public abstract readonly id: string;
|
||||
public abstract readonly editable: boolean;
|
||||
public abstract refresh(): void;
|
||||
|
||||
@@ -7,7 +7,8 @@ import { DashboardEditor } from 'sql/workbench/contrib/dashboard/browser/dashboa
|
||||
import { DashboardInput } from 'sql/workbench/browser/editor/profiler/dashboardInput';
|
||||
|
||||
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
import { EditorDescriptor, IEditorRegistry, Extensions as EditorExtensions } from 'vs/workbench/browser/editor';
|
||||
import { EditorDescriptor, IEditorRegistry } from 'vs/workbench/browser/editor';
|
||||
import { EditorExtensions } from 'vs/workbench/common/editor';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { localize } from 'vs/nls';
|
||||
import { IConfigurationNode, IConfigurationRegistry, Extensions } from 'vs/platform/configuration/common/configurationRegistry';
|
||||
|
||||
@@ -72,7 +72,7 @@ export class OEManageConnectionAction extends Action {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
async run(actionContext: ObjectExplorerActionsContext): Promise<void> {
|
||||
override async run(actionContext: ObjectExplorerActionsContext): Promise<void> {
|
||||
this._treeSelectionHandler = this._instantiationService.createInstance(TreeSelectionHandler);
|
||||
this._treeSelectionHandler.onTreeActionStateChange(true);
|
||||
try {
|
||||
@@ -124,7 +124,7 @@ export class OEManageConnectionAction extends Action {
|
||||
this._treeSelectionHandler.onTreeActionStateChange(false);
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
override dispose(): void {
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ export class DashboardEditor extends EditorPane {
|
||||
|
||||
public static ID: string = 'workbench.editor.connectiondashboard';
|
||||
private _dashboardContainer: HTMLElement;
|
||||
protected _input: DashboardInput;
|
||||
protected override _input: DashboardInput;
|
||||
|
||||
constructor(
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
@@ -44,7 +44,7 @@ export class DashboardEditor extends EditorPane {
|
||||
super(DashboardEditor.ID, telemetryService, themeService, storageService);
|
||||
}
|
||||
|
||||
public get input(): DashboardInput {
|
||||
public override get input(): DashboardInput {
|
||||
return this._input;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ export class DashboardEditor extends EditorPane {
|
||||
/**
|
||||
* Sets focus on this editor. Specifically, it sets the focus on the hosted text editor.
|
||||
*/
|
||||
public focus(): void {
|
||||
public override focus(): void {
|
||||
|
||||
let profile: IConnectionProfile;
|
||||
if (this.input.connectionProfile instanceof ConnectionProfile) {
|
||||
@@ -77,7 +77,7 @@ export class DashboardEditor extends EditorPane {
|
||||
this._dashboardService.layout(dimension);
|
||||
}
|
||||
|
||||
public async setInput(input: DashboardInput, options: EditorOptions, context: IEditorOpenContext): Promise<void> {
|
||||
public override async setInput(input: DashboardInput, options: EditorOptions, context: IEditorOpenContext): Promise<void> {
|
||||
if (this.input && this.input.matches(input)) {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
@@ -135,7 +135,7 @@ export class DashboardEditor extends EditorPane {
|
||||
input.setUniqueSelector(uniqueSelector);
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
public override dispose(): void {
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import { IAngularEventingService } from 'sql/platform/angularEventing/browser/an
|
||||
import { ExecuteCommandAction } from 'vs/platform/actions/common/actions';
|
||||
|
||||
export class ExplorerManageAction extends ManageAction {
|
||||
public static readonly ID = 'explorerwidget.manage';
|
||||
public static override readonly ID = 'explorerwidget.manage';
|
||||
constructor(
|
||||
id: string, label: string,
|
||||
@IConnectionManagementService connectionManagementService: IConnectionManagementService,
|
||||
@@ -18,13 +18,13 @@ export class ExplorerManageAction extends ManageAction {
|
||||
super(id, label, connectionManagementService, angularEventingService);
|
||||
}
|
||||
|
||||
public async run(actionContext: ManageActionContext): Promise<void> {
|
||||
public override async run(actionContext: ManageActionContext): Promise<void> {
|
||||
await super.run(actionContext);
|
||||
}
|
||||
}
|
||||
|
||||
export class CustomExecuteCommandAction extends ExecuteCommandAction {
|
||||
run(context: ManageActionContext): Promise<any> {
|
||||
override run(context: ManageActionContext): Promise<any> {
|
||||
return super.run(context.profile);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ export class ExplorerTable extends Disposable {
|
||||
const primary: IAction[] = [];
|
||||
const secondary: IAction[] = [];
|
||||
const result = { primary, secondary };
|
||||
createAndFillInContextMenuActions(menu, { shouldForwardArgs: true }, result, g => g === 'inline');
|
||||
createAndFillInContextMenuActions(menu, { shouldForwardArgs: true }, result, 'inline');
|
||||
|
||||
this.contextMenuService.showContextMenu({
|
||||
getAnchor: () => anchor,
|
||||
|
||||
@@ -46,7 +46,7 @@ export class ExplorerWidget extends DashboardWidget implements IDashboardWidget,
|
||||
constructor(
|
||||
@Inject(forwardRef(() => CommonServiceInterface)) private readonly _bootstrap: CommonServiceInterface,
|
||||
@Inject(forwardRef(() => Router)) private readonly _router: Router,
|
||||
@Inject(WIDGET_CONFIG) protected _config: WidgetConfig,
|
||||
@Inject(WIDGET_CONFIG) _config: WidgetConfig,
|
||||
@Inject(forwardRef(() => ElementRef)) private readonly _el: ElementRef,
|
||||
@Inject(IWorkbenchThemeService) private readonly themeService: IWorkbenchThemeService,
|
||||
@Inject(IContextViewService) private readonly contextViewService: IContextViewService,
|
||||
@@ -60,6 +60,7 @@ export class ExplorerWidget extends DashboardWidget implements IDashboardWidget,
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef
|
||||
) {
|
||||
super(changeRef);
|
||||
this._config = _config;
|
||||
this._loadingMessage = this._config.context === 'database' ? nls.localize('loadingObjects', "loading objects") : nls.localize('loadingDatabases', "loading databases");
|
||||
this._loadingCompletedMessage = this._config.context === 'database' ? nls.localize('loadingObjectsCompleted', "loading objects completed.") : nls.localize('loadingDatabasesCompleted', "loading databases completed.");
|
||||
this.init();
|
||||
|
||||
@@ -24,7 +24,7 @@ export class RunInsightQueryAction extends Action {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
public async run(context: InsightActionContext): Promise<void> {
|
||||
public override async run(context: InsightActionContext): Promise<void> {
|
||||
let queryString: string = undefined;
|
||||
let eol: string = this._textResourcePropertiesService.getEOL(undefined);
|
||||
if (context.insight && context.insight.query) {
|
||||
|
||||
@@ -71,7 +71,7 @@ export class InsightsWidget extends DashboardWidget implements IDashboardWidget,
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ComponentFactoryResolver)) private _componentFactoryResolver: ComponentFactoryResolver,
|
||||
@Inject(forwardRef(() => CommonServiceInterface)) private dashboardService: CommonServiceInterface,
|
||||
@Inject(WIDGET_CONFIG) protected _config: WidgetConfig,
|
||||
@Inject(WIDGET_CONFIG) _config: WidgetConfig,
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef,
|
||||
@Inject(forwardRef(() => Injector)) private _injector: Injector,
|
||||
@Inject(IInstantiationService) private instantiationService: IInstantiationService,
|
||||
@@ -164,7 +164,7 @@ export class InsightsWidget extends DashboardWidget implements IDashboardWidget,
|
||||
this._changeRef.detectChanges();
|
||||
}
|
||||
|
||||
get actions(): Array<Action> {
|
||||
override get actions(): Array<Action> {
|
||||
const actions: Array<Action> = [];
|
||||
if (this.insightConfig.details && (this.insightConfig.details.query || this.insightConfig.details.queryFile)) {
|
||||
actions.push(this.instantiationService.createInstance(InsightAction, InsightAction.ID, InsightAction.LABEL));
|
||||
|
||||
@@ -35,7 +35,7 @@ export default class BarChart extends ChartInsight {
|
||||
super(_changeRef, themeService, telemetryService);
|
||||
}
|
||||
|
||||
public setConfig(config: IBarChartConfig): void {
|
||||
public override setConfig(config: IBarChartConfig): void {
|
||||
let options = {};
|
||||
if (config.xAxisMax) {
|
||||
const opts = {
|
||||
@@ -127,7 +127,7 @@ export default class BarChart extends ChartInsight {
|
||||
super.setConfig(config);
|
||||
}
|
||||
|
||||
protected updateTheme(e: IColorTheme): void {
|
||||
protected override updateTheme(e: IColorTheme): void {
|
||||
super.updateTheme(e);
|
||||
const foregroundColor = e.getColor(colors.editorForeground);
|
||||
const foreground = foregroundColor ? foregroundColor.toString() : null;
|
||||
|
||||
@@ -10,7 +10,7 @@ import { ChartType } from 'sql/workbench/contrib/charts/common/interfaces';
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
|
||||
export default class DoughnutChart extends PieChart {
|
||||
protected readonly chartType: ChartType = ChartType.Doughnut;
|
||||
protected override readonly chartType: ChartType = ChartType.Doughnut;
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) _changeRef: ChangeDetectorRef,
|
||||
|
||||
@@ -10,7 +10,7 @@ import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
import { ChartType } from 'sql/workbench/contrib/charts/common/interfaces';
|
||||
|
||||
export default class HorizontalBarChart extends BarChart {
|
||||
protected readonly chartType: ChartType = ChartType.HorizontalBar;
|
||||
protected override readonly chartType: ChartType = ChartType.HorizontalBar;
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) _changeRef: ChangeDetectorRef,
|
||||
|
||||
@@ -21,9 +21,9 @@ export interface ILineConfig extends IBarChartConfig {
|
||||
const defaultLineConfig = mixin(deepClone(defaultChartConfig), { dataType: 'number' }) as ILineConfig;
|
||||
|
||||
export default class LineChart extends BarChart {
|
||||
protected readonly chartType: ChartType = ChartType.Line;
|
||||
protected _config: ILineConfig;
|
||||
protected _defaultConfig = defaultLineConfig;
|
||||
protected override readonly chartType: ChartType = ChartType.Line;
|
||||
protected override _config: ILineConfig;
|
||||
protected override _defaultConfig = defaultLineConfig;
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) _changeRef: ChangeDetectorRef,
|
||||
@@ -33,14 +33,14 @@ export default class LineChart extends BarChart {
|
||||
super(_changeRef, themeService, telemetryService);
|
||||
}
|
||||
|
||||
public init() {
|
||||
public override init() {
|
||||
if (this._config.dataType === DataType.Point) {
|
||||
this.addAxisLabels();
|
||||
}
|
||||
super.init();
|
||||
}
|
||||
|
||||
public get chartData(): Array<IDataSet | IPointDataSet> {
|
||||
public override get chartData(): Array<IDataSet | IPointDataSet> {
|
||||
if (this._config.dataType === DataType.Number) {
|
||||
return super.getChartData();
|
||||
} else {
|
||||
@@ -48,7 +48,7 @@ export default class LineChart extends BarChart {
|
||||
}
|
||||
}
|
||||
|
||||
protected clearMemoize() {
|
||||
protected override clearMemoize() {
|
||||
super.clearMemoize();
|
||||
LineChart.MEMOIZER.clear();
|
||||
}
|
||||
@@ -68,7 +68,7 @@ export default class LineChart extends BarChart {
|
||||
return values(dataSetMap);
|
||||
}
|
||||
|
||||
public get labels(): Array<string> {
|
||||
public override get labels(): Array<string> {
|
||||
if (this._config.dataType === DataType.Number) {
|
||||
return super.getLabels();
|
||||
} else {
|
||||
|
||||
@@ -15,8 +15,8 @@ import { ChartType } from 'sql/workbench/contrib/charts/common/interfaces';
|
||||
const defaultScatterConfig = mixin(deepClone(defaultChartConfig), { dataType: 'point', dataDirection: 'horizontal' }) as ILineConfig;
|
||||
|
||||
export default class ScatterChart extends LineChart {
|
||||
protected readonly chartType: ChartType = ChartType.Scatter;
|
||||
protected _defaultConfig = defaultScatterConfig;
|
||||
protected override readonly chartType: ChartType = ChartType.Scatter;
|
||||
protected override _defaultConfig = defaultScatterConfig;
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) _changeRef: ChangeDetectorRef,
|
||||
|
||||
@@ -18,7 +18,7 @@ import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
const defaultTimeSeriesConfig = mixin(deepClone(defaultChartConfig), { dataType: 'point', dataDirection: 'horizontal' }) as ILineConfig;
|
||||
|
||||
export default class TimeSeriesChart extends LineChart {
|
||||
protected _defaultConfig = defaultTimeSeriesConfig;
|
||||
protected override _defaultConfig = defaultTimeSeriesConfig;
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) _changeRef: ChangeDetectorRef,
|
||||
@@ -28,7 +28,7 @@ export default class TimeSeriesChart extends LineChart {
|
||||
super(_changeRef, themeService, telemetryService);
|
||||
}
|
||||
|
||||
protected addAxisLabels(): void {
|
||||
protected override addAxisLabels(): void {
|
||||
const xLabel = this._config.xAxisLabel || this.getLabels()[1] || 'x';
|
||||
const yLabel = this._config.yAxisLabel || this.getLabels()[2] || 'y';
|
||||
|
||||
@@ -61,7 +61,7 @@ export default class TimeSeriesChart extends LineChart {
|
||||
this.options = assign({}, mixin(this.options, options));
|
||||
}
|
||||
|
||||
protected getDataAsPoint(): Array<IPointDataSet> {
|
||||
protected override getDataAsPoint(): Array<IPointDataSet> {
|
||||
const dataSetMap: { [label: string]: IPointDataSet } = {};
|
||||
this._data.rows.map(row => {
|
||||
if (row && row.length >= 3) {
|
||||
|
||||
@@ -16,7 +16,7 @@ import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { subscriptionToDisposable } from 'sql/base/browser/lifecycle';
|
||||
import { PropertiesContainer, PropertyItem } from 'sql/base/browser/ui/propertiesContainer/propertiesContainer.component';
|
||||
import { registerThemingParticipant, IColorTheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
|
||||
import { PROPERTIES_CONTAINER_PROPERTY_NAME, PROPERTIES_CONTAINER_PROPERTY_VALUE } from 'vs/workbench/common/theme';
|
||||
import { PROPERTIES_CONTAINER_PROPERTY_NAME, PROPERTIES_CONTAINER_PROPERTY_VALUE } from 'sql/workbench/common/theme';
|
||||
|
||||
@Component({
|
||||
selector: 'properties-widget',
|
||||
@@ -34,10 +34,11 @@ export class PropertiesWidgetComponent extends DashboardWidget implements IDashb
|
||||
@Inject(forwardRef(() => CommonServiceInterface)) private _bootstrap: CommonServiceInterface,
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef,
|
||||
@Inject(forwardRef(() => ElementRef)) private _el: ElementRef,
|
||||
@Inject(WIDGET_CONFIG) protected _config: WidgetConfig,
|
||||
@Inject(WIDGET_CONFIG) _config: WidgetConfig,
|
||||
@Inject(ILogService) private logService: ILogService
|
||||
) {
|
||||
super(changeRef);
|
||||
this._config = _config;
|
||||
this.init();
|
||||
}
|
||||
|
||||
|
||||
@@ -38,13 +38,14 @@ export class WebviewWidget extends DashboardWidget implements IDashboardWidget,
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => CommonServiceInterface)) private readonly _dashboardService: DashboardServiceInterface,
|
||||
@Inject(WIDGET_CONFIG) protected readonly _config: WidgetConfig,
|
||||
@Inject(WIDGET_CONFIG) _config: WidgetConfig,
|
||||
@Inject(forwardRef(() => ElementRef)) private readonly _el: ElementRef,
|
||||
@Inject(IDashboardViewService) private readonly dashboardViewService: IDashboardViewService,
|
||||
@Inject(IWebviewService) private readonly webviewService: IWebviewService,
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef
|
||||
) {
|
||||
super(changeRef);
|
||||
this._config = _config;
|
||||
this._id = (_config.widget[selector] as IWebviewWidgetConfig).id;
|
||||
}
|
||||
|
||||
@@ -106,7 +107,7 @@ export class WebviewWidget extends DashboardWidget implements IDashboardWidget,
|
||||
|
||||
this._webview.mountTo(this._el.nativeElement);
|
||||
this._onMessageDisposable = this._webview.onMessage(e => {
|
||||
this._onMessage.fire(e);
|
||||
this._onMessage.fire(e.message);
|
||||
});
|
||||
if (this._html) {
|
||||
this._webview.html = this._html;
|
||||
|
||||
Reference in New Issue
Block a user