mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Dashboard Minor code cleanup (#894)
* minor code clean up for dashboard * formatting
This commit is contained in:
@@ -12,11 +12,12 @@ import { DashboardServiceInterface } from './services/dashboardServiceInterface.
|
||||
import { IConnectionProfile } from 'sql/parts/connection/common/interfaces';
|
||||
import * as Utils from 'sql/parts/connection/common/utils';
|
||||
import { RefreshWidgetAction, EditDashboardAction } from 'sql/parts/dashboard/common/actions';
|
||||
import { DashboardPage } from 'sql/parts/dashboard/common/dashboardPage.component';
|
||||
import { AngularDisposable } from 'sql/base/common/lifecycle';
|
||||
|
||||
import { IColorTheme } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import * as themeColors from 'vs/workbench/common/theme';
|
||||
import { DashboardPage } from 'sql/parts/dashboard/common/dashboardPage.component';
|
||||
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
|
||||
export const DASHBOARD_SELECTOR: string = 'dashboard-component';
|
||||
@@ -25,8 +26,7 @@ export const DASHBOARD_SELECTOR: string = 'dashboard-component';
|
||||
selector: DASHBOARD_SELECTOR,
|
||||
templateUrl: decodeURI(require.toUrl('./dashboard.component.html'))
|
||||
})
|
||||
export class DashboardComponent implements OnInit, OnDestroy {
|
||||
private _subs: Array<IDisposable> = new Array();
|
||||
export class DashboardComponent extends AngularDisposable implements OnInit {
|
||||
private _currentPage: DashboardPage;
|
||||
|
||||
@ViewChild('header', { read: ElementRef }) private header: ElementRef;
|
||||
@@ -39,10 +39,12 @@ export class DashboardComponent implements OnInit, OnDestroy {
|
||||
@Inject(forwardRef(() => DashboardServiceInterface)) private _bootstrapService: DashboardServiceInterface,
|
||||
@Inject(forwardRef(() => Router)) private _router: Router,
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) private _changeRef: ChangeDetectorRef
|
||||
) { }
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this._subs.push(this._bootstrapService.themeService.onDidColorThemeChange(this.updateTheme, this));
|
||||
this._register(this._bootstrapService.themeService.onDidColorThemeChange(this.updateTheme, this));
|
||||
this.updateTheme(this._bootstrapService.themeService.getColorTheme());
|
||||
let profile: IConnectionProfile = this._bootstrapService.getOriginalConnectionProfile();
|
||||
this.actionbar = new ActionBar(this.actionbarContainer.nativeElement);
|
||||
@@ -61,12 +63,6 @@ export class DashboardComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this._subs.forEach((value) => {
|
||||
value.dispose();
|
||||
});
|
||||
}
|
||||
|
||||
private updateTheme(theme: IColorTheme): void {
|
||||
let headerEl = <HTMLElement>this.header.nativeElement;
|
||||
headerEl.style.borderBottomColor = theme.getColor(themeColors.SIDE_BAR_BACKGROUND, true).toString();
|
||||
|
||||
Reference in New Issue
Block a user