Merge pull request #6475 from ArtemDzhereleiko/bug-fix/entities-table-sort

[3.4] UI: Fixed entities table manual sort if pagination disabled
This commit is contained in:
Igor Kulikov 2022-06-10 17:51:32 +03:00 committed by GitHub
commit a9eed7357d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -295,8 +295,10 @@ export class EntitiesTableComponent extends PageComponent implements IEntitiesTa
if (this.pageMode) { if (this.pageMode) {
this.route.queryParams.pipe(skip(1)).subscribe((params: PageQueryParam) => { this.route.queryParams.pipe(skip(1)).subscribe((params: PageQueryParam) => {
if (this.displayPagination) {
this.paginator.pageIndex = Number(params.page) || 0; this.paginator.pageIndex = Number(params.page) || 0;
this.paginator.pageSize = Number(params.pageSize) || this.defaultPageSize; this.paginator.pageSize = Number(params.pageSize) || this.defaultPageSize;
}
this.sort.active = params.property || this.entitiesTableConfig.defaultSortOrder.property; this.sort.active = params.property || this.entitiesTableConfig.defaultSortOrder.property;
this.sort.direction = (params.direction || this.entitiesTableConfig.defaultSortOrder.direction).toLowerCase() as SortDirection; this.sort.direction = (params.direction || this.entitiesTableConfig.defaultSortOrder.direction).toLowerCase() as SortDirection;
if (params.hasOwnProperty('textSearch') && !isEmptyStr(params.textSearch)) { if (params.hasOwnProperty('textSearch') && !isEmptyStr(params.textSearch)) {