mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -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() {
|
||||
this.dashboardService.dashboardContextKey.set(this.context);
|
||||
if (!this.dashboardService.connectionManagementService.connectionInfo) {
|
||||
this.dashboardService.messageService.show(Severity.Warning, nls.localize('missingConnectionInfo', 'No connection information could be found for this dashboard'));
|
||||
} else {
|
||||
|
||||
@@ -44,7 +44,6 @@ export class DatabaseDashboardPage extends DashboardPage implements OnInit {
|
||||
this.refresh(true);
|
||||
this._cd.detectChanges();
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
@@ -44,7 +44,7 @@ import * as nls from 'vs/nls';
|
||||
import { IPartService } from 'vs/workbench/services/part/common/partService';
|
||||
import { deepClone } from 'vs/base/common/objects';
|
||||
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';
|
||||
|
||||
@@ -157,6 +157,9 @@ export class DashboardServiceInterface extends AngularDisposable {
|
||||
private _onCloseTab = new Emitter<string>();
|
||||
public readonly onCloseTab: Event<string> = this._onCloseTab.event;
|
||||
|
||||
private _dashboardContextKey = new RawContextKey<string>('dashboardContext', undefined);
|
||||
public dashboardContextKey: IContextKey<string>;
|
||||
|
||||
private _numberOfPageNavigations = 0;
|
||||
|
||||
constructor(
|
||||
@@ -250,6 +253,7 @@ export class DashboardServiceInterface extends AngularDisposable {
|
||||
this._bootstrapParams = this._bootstrapService.getBootstrapParams<DashboardComponentParams>(this._uniqueSelector);
|
||||
this.uri = this._bootstrapParams.ownerUri;
|
||||
this._contextKeyService = this._bootstrapParams.scopedContextService;
|
||||
this.dashboardContextKey = this._dashboardContextKey.bindTo(this._contextKeyService);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user