Browse Source

UI: Fixed detect change state in dashboard

pull/12551/head
Vladyslav_Prykhodko 2 years ago
parent
commit
be41d477f8
  1. 14
      ui-ngx/src/app/modules/home/components/widget/lib/action/action-widget.models.ts

14
ui-ngx/src/app/modules/home/components/widget/lib/action/action-widget.models.ts

@ -25,6 +25,7 @@ import { WidgetContext } from '@home/models/widget-component.models';
import { import {
BehaviorSubject, BehaviorSubject,
forkJoin, forkJoin,
merge,
Observable, Observable,
Observer, Observer,
of, of,
@ -33,7 +34,7 @@ import {
switchMap, switchMap,
throwError throwError
} from 'rxjs'; } from 'rxjs';
import { catchError, delay, map, share, take } from 'rxjs/operators'; import { catchError, debounceTime, delay, map, share, take } from 'rxjs/operators';
import { AfterViewInit, ChangeDetectorRef, Directive, Input, OnDestroy, OnInit, TemplateRef } from '@angular/core'; import { AfterViewInit, ChangeDetectorRef, Directive, Input, OnDestroy, OnInit, TemplateRef } from '@angular/core';
import { import {
DataToValueSettings, DataToValueSettings,
@ -657,8 +658,15 @@ export class DashboardStateWithParamsGetter<V> extends ValueGetter<V> {
if (this.simulated) { if (this.simulated) {
return of({id: 'default', params: {}}); return of({id: 'default', params: {}});
} else { } else {
return this.ctx.stateController.dashboardCtrl.dashboardCtx.stateId.pipe( return merge(
map(id => ({id, params: deepClone(this.ctx.stateController.getStateParams())})) this.ctx.stateController.dashboardCtrl.dashboardCtx.stateId,
this.ctx.stateController.dashboardCtrl.dashboardCtx.stateChanged
).pipe(
debounceTime(10),
map(() => ({
id: this.ctx.stateController.getStateId(),
params: deepClone(this.ctx.stateController.getStateParams())
}))
); );
} }
} }

Loading…
Cancel
Save