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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
18 additions and
0 deletions
-
ui-ngx/src/app/modules/home/components/widget/lib/alarm/alarms-table-widget.component.ts
-
ui-ngx/src/app/modules/home/components/widget/lib/entity/entities-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$) |
|
|
|
|
|
|
|
@ -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$) |
|
|
|
|