mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Add dashboard context (database vs server) to scoped context (#893)
* explicitly add dashboard context to scoped context * formatting
This commit is contained in:
@@ -95,6 +95,7 @@ export abstract class DashboardPage extends AngularDisposable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected init() {
|
protected init() {
|
||||||
|
this.dashboardService.dashboardContextKey.set(this.context);
|
||||||
if (!this.dashboardService.connectionManagementService.connectionInfo) {
|
if (!this.dashboardService.connectionManagementService.connectionInfo) {
|
||||||
this.dashboardService.messageService.show(Severity.Warning, nls.localize('missingConnectionInfo', 'No connection information could be found for this dashboard'));
|
this.dashboardService.messageService.show(Severity.Warning, nls.localize('missingConnectionInfo', 'No connection information could be found for this dashboard'));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ export class DatabaseDashboardPage extends DashboardPage implements OnInit {
|
|||||||
this.refresh(true);
|
this.refresh(true);
|
||||||
this._cd.detectChanges();
|
this._cd.detectChanges();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ import * as nls from 'vs/nls';
|
|||||||
import { IPartService } from 'vs/workbench/services/part/common/partService';
|
import { IPartService } from 'vs/workbench/services/part/common/partService';
|
||||||
import { deepClone } from 'vs/base/common/objects';
|
import { deepClone } from 'vs/base/common/objects';
|
||||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
import { IContextKeyService, RawContextKey, IContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||||
|
|
||||||
const DASHBOARD_SETTINGS = 'dashboard';
|
const DASHBOARD_SETTINGS = 'dashboard';
|
||||||
|
|
||||||
@@ -157,6 +157,9 @@ export class DashboardServiceInterface extends AngularDisposable {
|
|||||||
private _onCloseTab = new Emitter<string>();
|
private _onCloseTab = new Emitter<string>();
|
||||||
public readonly onCloseTab: Event<string> = this._onCloseTab.event;
|
public readonly onCloseTab: Event<string> = this._onCloseTab.event;
|
||||||
|
|
||||||
|
private _dashboardContextKey = new RawContextKey<string>('dashboardContext', undefined);
|
||||||
|
public dashboardContextKey: IContextKey<string>;
|
||||||
|
|
||||||
private _numberOfPageNavigations = 0;
|
private _numberOfPageNavigations = 0;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@@ -250,6 +253,7 @@ export class DashboardServiceInterface extends AngularDisposable {
|
|||||||
this._bootstrapParams = this._bootstrapService.getBootstrapParams<DashboardComponentParams>(this._uniqueSelector);
|
this._bootstrapParams = this._bootstrapService.getBootstrapParams<DashboardComponentParams>(this._uniqueSelector);
|
||||||
this.uri = this._bootstrapParams.ownerUri;
|
this.uri = this._bootstrapParams.ownerUri;
|
||||||
this._contextKeyService = this._bootstrapParams.scopedContextService;
|
this._contextKeyService = this._bootstrapParams.scopedContextService;
|
||||||
|
this.dashboardContextKey = this._dashboardContextKey.bindTo(this._contextKeyService);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user