minor ui fix

This commit is contained in:
Sofia Papacharalampous 2024-06-27 16:16:46 +03:00
parent 64fd1449b9
commit bb80a3ddff
2 changed files with 8 additions and 4 deletions

View File

@ -1,7 +1,7 @@
<div class="main-content listing-main-container h-100">
<div class="container-fluid">
<div class="row">
<div *ngIf="!hasListingItems && !hasFilters" class="col-12 card mt-0">
<div *ngIf="hasLoadedListingItems && !hasListingItems && !hasFilters" class="col-12 card mt-0">
<div class="card-content info-text mb-0">
<p>{{'DMP-LISTING.TEXT-INFO' | translate}}</p>
<p class="mt-4 pt-2">{{'DMP-LISTING.TEXT-INFO-QUESTION' | translate}} <a class="zenodo-link" href="https://zenodo.org/communities/liber-dmp-cat/?page=1&size=20" target="_blank">{{'DMP-LISTING.LINK-ZENODO' | translate}}</a> {{'DMP-LISTING.GET-IDEA' | translate}}</p>
@ -11,17 +11,17 @@
</div>
</div>
</div>
<div *ngIf="hasListingItems || hasFilters" class="col-12">
<div *ngIf="hasLoadedListingItems" class="col-12">
<app-navigation-breadcrumb />
</div>
<div *ngIf="hasListingItems || hasFilters" class="filter-btn" [style.right]="dialog.getDialogById('filters') ? '446px' : '0px'" [style.width]="listingItems.length > 2 ? '57px' : '37px'" (click)="openFiltersDialog()">
<div *ngIf="hasLoadedListingItems && (hasListingItems || hasFilters)" class="filter-btn" [style.right]="dialog.getDialogById('filters') ? '446px' : '0px'" [style.width]="listingItems.length > 2 ? '57px' : '37px'" (click)="openFiltersDialog()">
<button mat-raised-button class="p-0" [matBadge]="filtersCount" [matBadgeHidden]="!hasFilters" matBadgePosition="before">
<mat-icon class="mr-4 filter-icon">filter_alt</mat-icon>
</button>
</div>
</div>
<div>
<div class="listing row pb-2">
<div *ngIf="hasLoadedListingItems" class="listing row pb-2">
<div *ngIf="hasListingItems || hasFilters" class="col-md-12">
<div class="row pt-4">
<!-- Sort by -->

View File

@ -53,6 +53,7 @@ export class DmpListingComponent extends BaseListingComponent<BaseDmp, DmpLookup
totalCount: number;
listingItems: any[] = [];
isPublic: boolean = false;
hasLoadedListingItems: boolean = false;
protected ITEMS_PER_PAGE = 5;
pageSize: number = 5;
filtersCount: number;
@ -186,14 +187,17 @@ export class DmpListingComponent extends BaseListingComponent<BaseDmp, DmpLookup
this.totalCount = result.count;
if (this.lookup?.page?.offset === 0) this.listingItems = [];
this.listingItems.push(...result.items);
this.hasLoadedListingItems = true;
}));
} else {
return this.dmpService.query(this.lookup).pipe(takeUntil(this._destroyed))
.pipe(tap(result => {
this.hasLoadedListingItems = true;
if (!result) { return []; }
this.totalCount = result.count;
if (this.lookup?.page?.offset === 0) this.listingItems = [];
this.listingItems.push(...result.items);
this.hasLoadedListingItems = true;
}));
}
}