Browse Source

making page persistent after edit/delete

pull/17258/head
Sinan997 3 years ago
committed by Mahmut Gundogdu
parent
commit
4b6268ecb0
  1. 7
      npm/ng-packs/packages/core/src/lib/services/list.service.ts
  2. 7
      npm/ng-packs/packages/identity/proxy/src/lib/proxy/identity/identity-user.service.ts
  3. 5
      npm/ng-packs/packages/identity/src/lib/components/users/users.component.ts
  4. 2
      npm/ng-packs/packages/theme-shared/extensions/src/lib/components/extensible-table/extensible-table.component.ts

7
npm/ng-packs/packages/core/src/lib/services/list.service.ts

@ -132,15 +132,16 @@ export class ListService<QueryParamsType = ABP.PageQueryParams | any> implements
}
private resetPageWhenUnchanged() {
const skipCount = this._page * this._maxResultCount; // 10
const maxPage = Number(Number(this._totalCount / this._maxResultCount).toFixed()) // 2
const skipCount = this._page * this._maxResultCount; // 20
if(skipCount === this._totalCount){
if(this.page > 0){
if(this.page === maxPage && this.page > 0){
this._skipCount = skipCount - this._maxResultCount
this.page = this.page - 1;
}
}else{
this._skipCount = skipCount;
}
}
private next() {

7
npm/ng-packs/packages/identity/proxy/src/lib/proxy/identity/identity-user.service.ts

@ -52,15 +52,14 @@ export class IdentityUserService {
},
{ apiName: this.apiName });
getList = (input: GetIdentityUsersInput) => {
console.log({input});
return this.restService.request<any, PagedResultDto<IdentityUserDto>>({
getList = (input: GetIdentityUsersInput) =>
this.restService.request<any, PagedResultDto<IdentityUserDto>>({
method: 'GET',
url: '/api/identity/users',
params: { filter: input.filter, sorting: input.sorting, skipCount: input.skipCount, maxResultCount: input.maxResultCount },
},
{ apiName: this.apiName });
}
getRoles = (id: string) =>

5
npm/ng-packs/packages/identity/src/lib/components/users/users.component.ts

@ -184,10 +184,7 @@ export class UsersComponent implements OnInit {
}
private hookToQuery() {
this.list.hookToQuery(query => this.service.getList(query)).subscribe(res => {
this.data = res;
this.list.totalCount = res.totalCount
});
this.list.hookToQuery(query => this.service.getList(query)).subscribe(res => (this.data = res));
}
openPermissionsModal(providerKey: string, entityDisplayName?: string) {

2
npm/ng-packs/packages/theme-shared/extensions/src/lib/components/extensible-table/extensible-table.component.ts

@ -150,7 +150,7 @@ export class ExtensibleTableComponent<R = any> implements OnChanges {
ngOnChanges({ data }: SimpleChanges) {
if (!data?.currentValue) return;
this.list.totalCount = this.recordsTotal
this.data = data.currentValue.map((record: any, index: number) => {
this.propList.forEach(prop => {
const propData = { getInjected: this.getInjected, record, index } as any;

Loading…
Cancel
Save