From 8af88fd199e77fa6787b6686dea1cf1f6ab111bd Mon Sep 17 00:00:00 2001 From: Igor Kulikov Date: Fri, 14 Jan 2022 19:29:43 +0200 Subject: [PATCH] Skip query params page link subscription in non page mode --- .../entity/entities-table.component.ts | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/entity/entities-table.component.ts b/ui-ngx/src/app/modules/home/components/entity/entities-table.component.ts index bc12b31f01..a64a40ef64 100644 --- a/ui-ngx/src/app/modules/home/components/entity/entities-table.component.ts +++ b/ui-ngx/src/app/modules/home/components/entity/entities-table.component.ts @@ -281,20 +281,22 @@ export class EntitiesTableComponent extends PageComponent implements IEntitiesTa ) .subscribe(); - this.route.queryParams.pipe(skip(1)).subscribe((params: PageQueryParam) => { - this.paginator.pageIndex = Number(params.page) || 0; - this.paginator.pageSize = Number(params.pageSize) || this.defaultPageSize; - this.sort.active = params.property || this.entitiesTableConfig.defaultSortOrder.property; - this.sort.direction = (params.direction || this.entitiesTableConfig.defaultSortOrder.direction).toLowerCase() as SortDirection; - if (params.hasOwnProperty('textSearch') && !isEmptyStr(params.textSearch)) { - this.textSearchMode = true; - this.pageLink.textSearch = decodeURI(params.textSearch); - } else { - this.textSearchMode = false; - this.pageLink.textSearch = null; - } - this.updateData(); - }); + if (this.pageMode) { + this.route.queryParams.pipe(skip(1)).subscribe((params: PageQueryParam) => { + this.paginator.pageIndex = Number(params.page) || 0; + this.paginator.pageSize = Number(params.pageSize) || this.defaultPageSize; + this.sort.active = params.property || this.entitiesTableConfig.defaultSortOrder.property; + this.sort.direction = (params.direction || this.entitiesTableConfig.defaultSortOrder.direction).toLowerCase() as SortDirection; + if (params.hasOwnProperty('textSearch') && !isEmptyStr(params.textSearch)) { + this.textSearchMode = true; + this.pageLink.textSearch = decodeURI(params.textSearch); + } else { + this.textSearchMode = false; + this.pageLink.textSearch = null; + } + this.updateData(); + }); + } this.updatePaginationSubscriptions(); this.viewInited = true;