|
|
|
@ -56,7 +56,7 @@ import { WINDOW } from '@core/services/window.service'; |
|
|
|
import { WindowMessage } from '@shared/models/window-message.model'; |
|
|
|
import { deepClone, guid, isDefined, isDefinedAndNotNull, isNotEmptyStr } from '@app/core/utils'; |
|
|
|
import { |
|
|
|
DashboardContext, |
|
|
|
DashboardContext, DashboardPageInitData, |
|
|
|
DashboardPageLayout, |
|
|
|
DashboardPageLayoutContext, |
|
|
|
DashboardPageLayouts, |
|
|
|
@ -365,15 +365,23 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC |
|
|
|
ngOnInit() { |
|
|
|
this.rxSubscriptions.push(this.route.data.subscribe( |
|
|
|
(data) => { |
|
|
|
let dashboardPageInitData: DashboardPageInitData; |
|
|
|
if (this.embedded) { |
|
|
|
data.dashboard = this.dashboardUtils.validateAndUpdateDashboard(this.dashboard); |
|
|
|
data.currentDashboardId = this.dashboard.id ? this.dashboard.id.id : null; |
|
|
|
data.widgetEditMode = false; |
|
|
|
data.singlePageMode = false; |
|
|
|
dashboardPageInitData = { |
|
|
|
dashboard: this.dashboardUtils.validateAndUpdateDashboard(this.dashboard), |
|
|
|
currentDashboardId: this.dashboard.id ? this.dashboard.id.id : null, |
|
|
|
widgetEditMode: false, |
|
|
|
singlePageMode: false |
|
|
|
}; |
|
|
|
} else { |
|
|
|
data.currentDashboardId = this.route.snapshot.params.dashboardId; |
|
|
|
dashboardPageInitData = { |
|
|
|
dashboard: data.dashboard, |
|
|
|
currentDashboardId: this.route.snapshot.params.dashboardId, |
|
|
|
widgetEditMode: data.widgetEditMode, |
|
|
|
singlePageMode: data.singlePageMode |
|
|
|
}; |
|
|
|
} |
|
|
|
this.init(data); |
|
|
|
this.init(dashboardPageInitData); |
|
|
|
this.runChangeDetection(); |
|
|
|
} |
|
|
|
)); |
|
|
|
@ -406,7 +414,7 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private init(data: any) { |
|
|
|
private init(data: DashboardPageInitData) { |
|
|
|
|
|
|
|
this.reset(); |
|
|
|
|
|
|
|
@ -1492,11 +1500,12 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC |
|
|
|
versionControlPopover.tbComponentRef.instance.versionRestored.subscribe(() => { |
|
|
|
this.dashboardService.getDashboard(this.currentDashboardId).subscribe((dashboard) => { |
|
|
|
dashboard = this.dashboardUtils.validateAndUpdateDashboard(dashboard); |
|
|
|
const data = { |
|
|
|
const data: DashboardPageInitData = { |
|
|
|
dashboard, |
|
|
|
widgetEditMode: false, |
|
|
|
currentDashboardId: this.currentDashboardId |
|
|
|
} as any; |
|
|
|
currentDashboardId: this.currentDashboardId, |
|
|
|
widgetEditMode: this.widgetEditMode, |
|
|
|
singlePageMode: this.singlePageMode |
|
|
|
}; |
|
|
|
this.init(data); |
|
|
|
this.dashboardCtx.stateController.cleanupPreservedStates(); |
|
|
|
this.dashboardCtx.stateController.resetState(); |
|
|
|
|