load more plan/description don't push to top of page

This commit is contained in:
mchouliara 2024-09-20 12:46:36 +03:00
parent 31accd05a2
commit f7b4b4f0eb
3 changed files with 40 additions and 41 deletions

View File

@ -71,24 +71,22 @@
</div>
</div>
</div>
@if(!isLoading) {
<div class="col-md-12 col-sm-12 col-md-9">
<div *ngFor="let item of listingItems; let i = index">
<app-description-listing-item-component
[isPublic]="isPublic"
[description]="item"
[tenants]="tenants"
[showDivider]="i != (listingItems.length - 1)"
></app-description-listing-item-component>
</div>
<div *ngIf="hasListingItems && this.lookup?.page?.offset < this.totalCount - 1 && this.pageSize < this.totalCount - 1" class="d-flex justify-content-center pb-1">
<button mat-button type="button" class="rounded-btn load-more" (click)="loadMore()">{{'DESCRIPTION-LISTING.ACTIONS.LOAD-MORE' | translate}}</button>
</div>
</div>
<div *ngIf="!hasListingItems && hasFilters" class="col-md-12 d-flex justify-content-center pt-4 mt-4 mb-4 pb-4">
<span class="empty-list">{{'DESCRIPTION-LISTING.EMPTY-LIST' | translate}}</span>
</div>
}
<div class="col-md-12 col-sm-12 col-md-9">
<div *ngFor="let item of listingItems; let i = index">
<app-description-listing-item-component
[isPublic]="isPublic"
[description]="item"
[tenants]="tenants"
[showDivider]="i != (listingItems.length - 1)"
></app-description-listing-item-component>
</div>
<div *ngIf="hasListingItems && this.lookup?.page?.offset < this.totalCount - 1 && this.pageSize < this.totalCount - 1" class="d-flex justify-content-center pb-1">
<button mat-button type="button" class="rounded-btn load-more" (click)="loadMore()">{{'DESCRIPTION-LISTING.ACTIONS.LOAD-MORE' | translate}}</button>
</div>
</div>
<div *ngIf="!hasListingItems && hasFilters" class="col-md-12 d-flex justify-content-center pt-4 mt-4 mb-4 pb-4">
<span class="empty-list">{{'DESCRIPTION-LISTING.EMPTY-LIST' | translate}}</span>
</div>
</div>
</div>
</div>

View File

@ -56,28 +56,26 @@
</div>
</div>
</div>
@if(!isLoading) {
<div class="col-md-12 col-sm-12 col-md-9">
<div *ngFor="let item of listingItems; let i = index">
<app-plan-listing-item-component
[showAllVersionsAction]="!isVersionsListing"
[showDivider]="i != (listingItems.length - 1)"
[plan]="item"
[isPublic]="isPublic"
[tenants]="tenants"
></app-plan-listing-item-component>
</div>
<div *ngIf="hasListingItems && this.lookup?.page?.offset < this.totalCount - 1 && this.pageSize < this.totalCount - 1" class="d-flex justify-content-center pb-1">
<button type="button" mat-button class="rounded-btn load-more" (click)="loadMore()">{{'GENERAL.ACTIONS.LOAD-MORE' | translate}}</button>
</div>
</div>
<div *ngIf="!hasListingItems && !hasFilters" class="col-md-12 d-flex justify-content-center pt-4 mt-4 mb-4 pb-4">
<span class="empty-list">{{'PLAN-LISTING.EMPTY-LIST' | translate}}</span>
</div>
<div *ngIf="!hasListingItems && hasFilters" class="col-md-12 d-flex justify-content-center pt-4 mt-4 mb-4 pb-4">
<span class="empty-list">{{'PLAN-LISTING.FILTERS.NO-ITEMS-FOUND' | translate}}</span>
</div>
}
<div class="col-md-12 col-sm-12 col-md-9">
<div *ngFor="let item of listingItems; let i = index">
<app-plan-listing-item-component
[showAllVersionsAction]="!isVersionsListing"
[showDivider]="i != (listingItems.length - 1)"
[plan]="item"
[isPublic]="isPublic"
[tenants]="tenants"
></app-plan-listing-item-component>
</div>
<div *ngIf="hasListingItems && this.lookup?.page?.offset < this.totalCount - 1 && this.pageSize < this.totalCount - 1" class="d-flex justify-content-center pb-1">
<button type="button" mat-button class="rounded-btn load-more" (click)="loadMore()">{{'GENERAL.ACTIONS.LOAD-MORE' | translate}}</button>
</div>
</div>
<div *ngIf="!hasListingItems && !hasFilters" class="col-md-12 d-flex justify-content-center pt-4 mt-4 mb-4 pb-4">
<span class="empty-list">{{'PLAN-LISTING.EMPTY-LIST' | translate}}</span>
</div>
<div *ngIf="!hasListingItems && hasFilters" class="col-md-12 d-flex justify-content-center pt-4 mt-4 mb-4 pb-4">
<span class="empty-list">{{'PLAN-LISTING.FILTERS.NO-ITEMS-FOUND' | translate}}</span>
</div>
</div>
</div>

View File

@ -112,7 +112,10 @@ export abstract class BaseListingComponent<ItemModel, LookupModel extends Lookup
value.page = { offset: 0, size: this.ITEMS_PER_PAGE }
}
this.userSettingsPickerComponent?.resetToDraft();
this.router.navigate([], { queryParams: { 'lookup': this.queryParamsService.serializeLookup(value), 'lv': ++this.lv }, replaceUrl: true });
this.router.navigate([], {
queryParams: { 'lookup': this.queryParamsService.serializeLookup(value), 'lv': ++this.lv },
replaceUrl: true
});
}
changeSetting(lookup: LookupModel): void {