mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
@@ -1,27 +1,25 @@
|
||||
<p class="h4">{{'health-page.status' | translate}} : <ds-health-status [status]="healthResponse.status"></ds-health-status></p>
|
||||
<ngb-accordion #acc="ngbAccordion" [activeIds]="activeId">
|
||||
<ng-container *ngFor="let entry of healthResponse.components | dsObjNgFor">
|
||||
<ngb-panel [id]="entry.key" *ngIf="showEntryData(entry.value)">
|
||||
<ng-template ngbPanelHeader>
|
||||
<div class="w-100 d-flex justify-content-between collapse-toggle" ngbPanelToggle (click)="acc.toggle(entry.key)" data-test="component">
|
||||
<button type="button" class="btn btn-link p-0" (click)="$event.preventDefault()" [attr.aria-expanded]="!acc.isExpanded(entry.key)"
|
||||
aria-controls="collapseExample">
|
||||
{{ getPanelLabel(entry.key) | titlecase }}
|
||||
</button>
|
||||
<div class="text-right d-flex">
|
||||
<ds-health-status [status]="entry.value?.status"></ds-health-status>
|
||||
<div class="ml-3 d-inline-block">
|
||||
<span *ngIf="acc.isExpanded(entry.key)" class="fas fa-chevron-up fa-fw"></span>
|
||||
<span *ngIf="!acc.isExpanded(entry.key)" class="fas fa-chevron-down fa-fw"></span>
|
||||
</div>
|
||||
<ngb-panel [id]="entry.key" *ngFor="let entry of healthResponse.components | dsObjNgFor">
|
||||
<ng-template ngbPanelHeader>
|
||||
<div class="w-100 d-flex justify-content-between collapse-toggle" ngbPanelToggle (click)="acc.toggle(entry.key)" data-test="component">
|
||||
<button type="button" class="btn btn-link p-0" (click)="$event.preventDefault()" [attr.aria-expanded]="!acc.isExpanded(entry.key)"
|
||||
aria-controls="collapseExample">
|
||||
{{ getPanelLabel(entry.key) | titlecase }}
|
||||
</button>
|
||||
<div class="text-right d-flex">
|
||||
<ds-health-status [status]="entry.value?.status"></ds-health-status>
|
||||
<div class="ml-3 d-inline-block">
|
||||
<span *ngIf="acc.isExpanded(entry.key)" class="fas fa-chevron-up fa-fw"></span>
|
||||
<span *ngIf="!acc.isExpanded(entry.key)" class="fas fa-chevron-down fa-fw"></span>
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
<ng-template ngbPanelContent>
|
||||
<ds-health-component [healthComponent]="entry.value" [healthComponentName]="entry.key"></ds-health-component>
|
||||
</ng-template>
|
||||
</ngb-panel>
|
||||
</ng-container>
|
||||
</div>
|
||||
</ng-template>
|
||||
<ng-template ngbPanelContent>
|
||||
<ds-health-component [healthComponent]="entry.value" [healthComponentName]="entry.key"></ds-health-component>
|
||||
</ng-template>
|
||||
</ngb-panel>
|
||||
</ngb-accordion>
|
||||
|
||||
|
||||
|
@@ -1,7 +1,6 @@
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { HealthResponse } from '../models/health-component.model';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import {isNotEmpty} from '../../shared/empty.util';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-health-panel',
|
||||
@@ -30,7 +29,7 @@ export class HealthPanelComponent implements OnInit {
|
||||
/**
|
||||
* Return translated label if exist for the given property
|
||||
*
|
||||
* @param panelKey
|
||||
* @param property
|
||||
*/
|
||||
public getPanelLabel(panelKey: string): string {
|
||||
const translationKey = `health-page.section.${panelKey}.title`;
|
||||
@@ -38,12 +37,4 @@ export class HealthPanelComponent implements OnInit {
|
||||
|
||||
return (translation === translationKey) ? panelKey : translation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the current entry has data to be shown
|
||||
* @param entryValue
|
||||
*/
|
||||
showEntryData(entryValue) {
|
||||
return isNotEmpty(entryValue?.components) || isNotEmpty(entryValue?.details);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user