Commits

Davide Negretti authored 692ab040dc7
[CST-5535] hide empty panels
No tags

src/app/health-page/health-panel/health-panel.component.html

Modified
1 1 <p class="h4">{{'health-page.status' | translate}} : <ds-health-status [status]="healthResponse.status"></ds-health-status></p>
2 2 <ngb-accordion #acc="ngbAccordion" [activeIds]="activeId">
3 - <ngb-panel [id]="entry.key" *ngFor="let entry of healthResponse.components | dsObjNgFor">
4 - <ng-template ngbPanelHeader>
5 - <div class="w-100 d-flex justify-content-between collapse-toggle" ngbPanelToggle (click)="acc.toggle(entry.key)" data-test="component">
6 - <button type="button" class="btn btn-link p-0" (click)="$event.preventDefault()" [attr.aria-expanded]="!acc.isExpanded(entry.key)"
7 - aria-controls="collapseExample">
8 - {{ getPanelLabel(entry.key) | titlecase }}
9 - </button>
10 - <div class="text-right d-flex">
11 - <ds-health-status [status]="entry.value?.status"></ds-health-status>
12 - <div class="ml-3 d-inline-block">
13 - <span *ngIf="acc.isExpanded(entry.key)" class="fas fa-chevron-up fa-fw"></span>
14 - <span *ngIf="!acc.isExpanded(entry.key)" class="fas fa-chevron-down fa-fw"></span>
3 + <ng-container *ngFor="let entry of healthResponse.components | dsObjNgFor">
4 + <ngb-panel [id]="entry.key" *ngIf="showEntryData(entry.value)">
5 + <ng-template ngbPanelHeader>
6 + <div class="w-100 d-flex justify-content-between collapse-toggle" ngbPanelToggle (click)="acc.toggle(entry.key)" data-test="component">
7 + <button type="button" class="btn btn-link p-0" (click)="$event.preventDefault()" [attr.aria-expanded]="!acc.isExpanded(entry.key)"
8 + aria-controls="collapseExample">
9 + {{ getPanelLabel(entry.key) | titlecase }}
10 + </button>
11 + <div class="text-right d-flex">
12 + <ds-health-status [status]="entry.value?.status"></ds-health-status>
13 + <div class="ml-3 d-inline-block">
14 + <span *ngIf="acc.isExpanded(entry.key)" class="fas fa-chevron-up fa-fw"></span>
15 + <span *ngIf="!acc.isExpanded(entry.key)" class="fas fa-chevron-down fa-fw"></span>
16 + </div>
15 17 </div>
16 18 </div>
17 - </div>
18 - </ng-template>
19 - <ng-template ngbPanelContent>
20 - <ds-health-component [healthComponent]="entry.value" [healthComponentName]="entry.key"></ds-health-component>
21 - </ng-template>
22 - </ngb-panel>
19 + </ng-template>
20 + <ng-template ngbPanelContent>
21 + <ds-health-component [healthComponent]="entry.value" [healthComponentName]="entry.key"></ds-health-component>
22 + </ng-template>
23 + </ngb-panel>
24 + </ng-container>
23 25 </ngb-accordion>
24 26
25 27

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut