MOBILE-4077 ReportBuilder: Show empty box when there isn't report detail to display

main
Alfonso Salces 2023-02-17 10:20:33 +01:00
parent f84a0c659a
commit dac5834654
2 changed files with 16 additions and 8 deletions

View File

@ -2,11 +2,11 @@
<core-loading [hideUntil]="state.loaded"> <core-loading [hideUntil]="state.loaded">
<ng-container *ngIf="state.report?.data?.rows && state.report?.data?.headers && state.report?.details; else empty"> <ion-refresher slot="fixed" [disabled]="!state.loaded" (ionRefresh)="refreshReport($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
<ion-refresher slot="fixed" [disabled]="!state.loaded" (ionRefresh)="refreshReport($event.target)"> <ng-container *ngIf="state.report?.data?.rows?.length && state.report?.data?.headers && state.report?.details; else empty">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
<ng-container *ngIf="isCardLayout"> <ng-container *ngIf="isCardLayout">
<ion-card *ngFor="let row of state.report.data.rows; let rowIndex = index"> <ion-card *ngFor="let row of state.report.data.rows; let rowIndex = index">
@ -46,15 +46,15 @@
</ng-container> </ng-container>
<ng-template #empty> <ng-template #empty>
<core-empty-box *ngIf="!state.report?.data?.rows || !state.report?.data?.headers || !state.report?.details" icon="fa-list-alt" <core-empty-box icon="fa-list-alt">
[message]="'core.course.nocontentavailable' | translate"></core-empty-box> <p> {{ 'core.course.nocontentavailable' | translate }} </p>
</core-empty-box>
</ng-template> </ng-template>
<core-infinite-loading *ngIf="!isBlock && state.report?.data?.rows && state.report?.data?.headers && state.report?.details" <core-infinite-loading *ngIf="!isBlock && state.report?.data?.rows?.length && state.report?.data?.headers && state.report?.details"
[enabled]="state.canLoadMoreRows" (action)="fetchMoreInfo($event)" [error]="state.errorLoadingRows"> [enabled]="state.canLoadMoreRows" (action)="fetchMoreInfo($event)" [error]="state.errorLoadingRows">
</core-infinite-loading> </core-infinite-loading>
</core-loading> </core-loading>
</ng-container> </ng-container>

View File

@ -41,4 +41,12 @@
} }
} }
core-empty-box {
color: var(--gray-500);
p {
color: var(--gray-900);
}
}
} }