From cf2c1f53b90c1ffa5be58b3c9bfea7d82f9154a6 Mon Sep 17 00:00:00 2001 From: LeoMorgan113 Date: Thu, 9 Oct 2025 18:42:23 +0300 Subject: [PATCH] Added fix for filters update --- .../widget/lib/alarm/alarms-table-widget.component.ts | 10 ++++++++++ .../lib/entity/entities-table-widget.component.ts | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/alarm/alarms-table-widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/alarm/alarms-table-widget.component.ts index 3972ceecb0..f0a52ea923 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/alarm/alarms-table-widget.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/alarm/alarms-table-widget.component.ts @@ -328,6 +328,16 @@ export class AlarmsTableWidgetComponent extends PageComponent implements OnInit, this.updateData(); }); + this.ctx.aliasController?.filtersChanged.pipe( + takeUntil(this.destroy$) + ).subscribe((filters) => { + let currentFilterId = this.ctx.datasources?.[0]?.filterId; + if (this.displayPagination && currentFilterId && filters.includes(currentFilterId)) { + this.paginator.pageIndex = 0; + } + this.updateData(); + }); + if (this.displayPagination) { this.sort.sortChange.pipe(takeUntil(this.destroy$)).subscribe(() => this.paginator.pageIndex = 0); } diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/entity/entities-table-widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/entity/entities-table-widget.component.ts index f95c8c26d7..0feda80f60 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/entity/entities-table-widget.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/entity/entities-table-widget.component.ts @@ -263,6 +263,16 @@ export class EntitiesTableWidgetComponent extends PageComponent implements OnIni this.updateData(); }); + this.ctx.aliasController?.filtersChanged.pipe( + takeUntil(this.destroy$) + ).subscribe((filters) => { + let currentFilterId = this.ctx.datasources?.[0]?.filterId; + if (this.displayPagination && currentFilterId && filters.includes(currentFilterId)) { + this.paginator.pageIndex = 0; + } + this.updateData(); + }); + if (this.displayPagination) { this.sort.sortChange.pipe(takeUntil(this.destroy$)).subscribe(() => this.paginator.pageIndex = 0); }