Commit bbc4dd7dd8056ac92c12d5d5be3df83699f5ec55
Committed by
Vladyslav Prykhodko
1 parent
934020d1
UI: Fixed work 'widget filter type' after migrating dashboard - change detection OnPush
Showing
2 changed files
with
6 additions
and
3 deletions
... | ... | @@ -1298,6 +1298,7 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC |
1298 | 1298 | types: widgetTypesList, |
1299 | 1299 | typesUpdated: (newTypes) => { |
1300 | 1300 | this.filterWidgetTypes = newTypes.filter(type => type.display).map(type => type.type); |
1301 | + this.cd.markForCheck(); | |
1301 | 1302 | } |
1302 | 1303 | } as DisplayWidgetTypesPanelData |
1303 | 1304 | }, |
... | ... | @@ -1308,7 +1309,7 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC |
1308 | 1309 | ]; |
1309 | 1310 | const injector = Injector.create({parent: this.viewContainerRef.injector, providers}); |
1310 | 1311 | overlayRef.attach(new ComponentPortal(DisplayWidgetTypesPanelComponent, this.viewContainerRef, injector)); |
1311 | - this.cd.detectChanges(); | |
1312 | + this.cd.markForCheck(); | |
1312 | 1313 | } |
1313 | 1314 | |
1314 | 1315 | onCloseSearchBundle() { | ... | ... |
... | ... | @@ -14,7 +14,7 @@ |
14 | 14 | /// limitations under the License. |
15 | 15 | /// |
16 | 16 | |
17 | -import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; | |
17 | +import { ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; | |
18 | 18 | import { WidgetsBundle } from '@shared/models/widgets-bundle.model'; |
19 | 19 | import { IAliasController } from '@core/api/widget-api.models'; |
20 | 20 | import { NULL_UUID } from '@shared/models/id/has-uuid'; |
... | ... | @@ -88,7 +88,8 @@ export class DashboardWidgetSelectComponent implements OnInit { |
88 | 88 | widgetsBundleSelected: EventEmitter<WidgetsBundle> = new EventEmitter<WidgetsBundle>(); |
89 | 89 | |
90 | 90 | constructor(private widgetsService: WidgetService, |
91 | - private sanitizer: DomSanitizer) { | |
91 | + private sanitizer: DomSanitizer, | |
92 | + private cd: ChangeDetectorRef) { | |
92 | 93 | this.widgetsBundles$ = this.search$.asObservable().pipe( |
93 | 94 | distinctUntilChanged(), |
94 | 95 | switchMap(search => this.fetchWidgetBundle(search)) |
... | ... | @@ -128,6 +129,7 @@ export class DashboardWidgetSelectComponent implements OnInit { |
128 | 129 | ); |
129 | 130 | setTimeout(() => { |
130 | 131 | this.widgetTypes = widgetTypes; |
132 | + this.cd.markForCheck(); | |
131 | 133 | }); |
132 | 134 | return widgetInfos; |
133 | 135 | }), | ... | ... |