|
|
|
@ -15,6 +15,7 @@ |
|
|
|
///
|
|
|
|
|
|
|
|
import { |
|
|
|
ChangeDetectionStrategy, |
|
|
|
ChangeDetectorRef, |
|
|
|
Component, ElementRef, |
|
|
|
Inject, |
|
|
|
@ -134,7 +135,7 @@ import { |
|
|
|
templateUrl: './dashboard-page.component.html', |
|
|
|
styleUrls: ['./dashboard-page.component.scss'], |
|
|
|
encapsulation: ViewEncapsulation.None, |
|
|
|
// changeDetection: ChangeDetectionStrategy.OnPush
|
|
|
|
changeDetection: ChangeDetectionStrategy.OnPush |
|
|
|
}) |
|
|
|
export class DashboardPageComponent extends PageComponent implements IDashboardController, OnInit, OnDestroy { |
|
|
|
|
|
|
|
@ -425,9 +426,9 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC |
|
|
|
} |
|
|
|
|
|
|
|
public runChangeDetection() { |
|
|
|
/*setTimeout(() => { |
|
|
|
this.ngZone.run(() => { |
|
|
|
this.cd.detectChanges(); |
|
|
|
});*/ |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public openToolbar() { |
|
|
|
@ -731,6 +732,7 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC |
|
|
|
const widget = importData.widget; |
|
|
|
const layoutId = importData.layoutId; |
|
|
|
this.layouts[layoutId].layoutCtx.widgets.addWidgetId(widget.id); |
|
|
|
this.runChangeDetection(); |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
@ -885,28 +887,17 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC |
|
|
|
} else if (this.isAddingWidget) { |
|
|
|
this.isAddingWidgetClosed = false; |
|
|
|
} |
|
|
|
setTimeout(() => { |
|
|
|
this.cd.detach(); |
|
|
|
}, 0); |
|
|
|
} |
|
|
|
|
|
|
|
detailsDrawerOpened() { |
|
|
|
this.cd.reattach(); |
|
|
|
} |
|
|
|
|
|
|
|
detailsDrawerClosedStart() { |
|
|
|
this.cd.detach(); |
|
|
|
} |
|
|
|
|
|
|
|
detailsDrawerClosed() { |
|
|
|
this.isEditingWidgetClosed = true; |
|
|
|
this.isAddingWidgetClosed = true; |
|
|
|
this.cd.reattach(); |
|
|
|
} |
|
|
|
|
|
|
|
private addWidgetToLayout(widget: Widget, layoutId: DashboardLayoutId) { |
|
|
|
this.dashboardUtils.addWidgetToLayout(this.dashboard, this.dashboardCtx.state, layoutId, widget); |
|
|
|
this.layouts[layoutId].layoutCtx.widgets.addWidgetId(widget.id); |
|
|
|
this.runChangeDetection(); |
|
|
|
} |
|
|
|
|
|
|
|
private selectTargetLayout(): Observable<DashboardLayoutId> { |
|
|
|
@ -1060,6 +1051,7 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC |
|
|
|
pos, this.entityAliasesUpdated.bind(this), this.filtersUpdated.bind(this)).subscribe( |
|
|
|
(widget) => { |
|
|
|
layoutCtx.widgets.addWidgetId(widget.id); |
|
|
|
this.runChangeDetection(); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
@ -1068,6 +1060,7 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC |
|
|
|
pos).subscribe( |
|
|
|
(widget) => { |
|
|
|
layoutCtx.widgets.addWidgetId(widget.id); |
|
|
|
this.runChangeDetection(); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
@ -1086,6 +1079,7 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC |
|
|
|
if (res) { |
|
|
|
if (layoutCtx.widgets.removeWidgetId(widget.id)) { |
|
|
|
this.dashboardUtils.removeWidgetFromLayout(this.dashboard, this.dashboardCtx.state, layoutCtx.id, widget.id); |
|
|
|
this.runChangeDetection(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
|