Browse Source

Merge pull request #14134 from LeoMorgan113/feature/table-filter-update-fix

Fix for filtering entity and alarm tables
pull/14260/head
Igor Kulikov 11 months ago
committed by GitHub
parent
commit
150d4e387e
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 9
      ui-ngx/src/app/modules/home/components/widget/lib/alarm/alarms-table-widget.component.ts
  2. 9
      ui-ngx/src/app/modules/home/components/widget/lib/entity/entities-table-widget.component.ts

9
ui-ngx/src/app/modules/home/components/widget/lib/alarm/alarms-table-widget.component.ts

@ -330,6 +330,15 @@ export class AlarmsTableWidgetComponent extends PageComponent implements OnInit,
if (this.displayPagination) {
this.sort.sortChange.pipe(takeUntil(this.destroy$)).subscribe(() => this.paginator.pageIndex = 0);
this.ctx.aliasController?.filtersChanged.pipe(
takeUntil(this.destroy$)
).subscribe((filters) => {
let currentFilterId = this.ctx.defaultSubscription.options.alarmSource?.filterId;
if (currentFilterId && filters.includes(currentFilterId)) {
this.paginator.firstPage();
}
});
}
((this.displayPagination ? merge(this.sort.sortChange, this.paginator.page) : this.sort.sortChange) as Observable<any>).pipe(
takeUntil(this.destroy$)

9
ui-ngx/src/app/modules/home/components/widget/lib/entity/entities-table-widget.component.ts

@ -265,6 +265,15 @@ export class EntitiesTableWidgetComponent extends PageComponent implements OnIni
if (this.displayPagination) {
this.sort.sortChange.pipe(takeUntil(this.destroy$)).subscribe(() => this.paginator.pageIndex = 0);
this.ctx.aliasController?.filtersChanged.pipe(
takeUntil(this.destroy$)
).subscribe((filters) => {
let currentFilterId = this.ctx.defaultSubscription.options.datasources?.[0]?.filterId;
if (currentFilterId && filters.includes(currentFilterId)) {
this.paginator.firstPage();
}
});
}
((this.displayPagination ? merge(this.sort.sortChange, this.paginator.page) : this.sort.sortChange) as Observable<any>).pipe(
takeUntil(this.destroy$)

Loading…
Cancel
Save