mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
@@ -1,7 +1,6 @@
|
|||||||
<p class="h4">{{'health-page.status' | translate}} : <ds-health-status [status]="healthResponse.status"></ds-health-status></p>
|
<p class="h4">{{'health-page.status' | translate}} : <ds-health-status [status]="healthResponse.status"></ds-health-status></p>
|
||||||
<ngb-accordion #acc="ngbAccordion" [activeIds]="activeId">
|
<ngb-accordion #acc="ngbAccordion" [activeIds]="activeId">
|
||||||
<ng-container *ngFor="let entry of healthResponse.components | dsObjNgFor">
|
<ngb-panel [id]="entry.key" *ngFor="let entry of healthResponse.components | dsObjNgFor">
|
||||||
<ngb-panel [id]="entry.key" *ngIf="showEntryData(entry.value)">
|
|
||||||
<ng-template ngbPanelHeader>
|
<ng-template ngbPanelHeader>
|
||||||
<div class="w-100 d-flex justify-content-between collapse-toggle" ngbPanelToggle (click)="acc.toggle(entry.key)" data-test="component">
|
<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)"
|
<button type="button" class="btn btn-link p-0" (click)="$event.preventDefault()" [attr.aria-expanded]="!acc.isExpanded(entry.key)"
|
||||||
@@ -21,7 +20,6 @@
|
|||||||
<ds-health-component [healthComponent]="entry.value" [healthComponentName]="entry.key"></ds-health-component>
|
<ds-health-component [healthComponent]="entry.value" [healthComponentName]="entry.key"></ds-health-component>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</ngb-panel>
|
</ngb-panel>
|
||||||
</ng-container>
|
|
||||||
</ngb-accordion>
|
</ngb-accordion>
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
import { Component, Input, OnInit } from '@angular/core';
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
import { HealthResponse } from '../models/health-component.model';
|
import { HealthResponse } from '../models/health-component.model';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import {isNotEmpty} from '../../shared/empty.util';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-health-panel',
|
selector: 'ds-health-panel',
|
||||||
@@ -30,7 +29,7 @@ export class HealthPanelComponent implements OnInit {
|
|||||||
/**
|
/**
|
||||||
* Return translated label if exist for the given property
|
* Return translated label if exist for the given property
|
||||||
*
|
*
|
||||||
* @param panelKey
|
* @param property
|
||||||
*/
|
*/
|
||||||
public getPanelLabel(panelKey: string): string {
|
public getPanelLabel(panelKey: string): string {
|
||||||
const translationKey = `health-page.section.${panelKey}.title`;
|
const translationKey = `health-page.section.${panelKey}.title`;
|
||||||
@@ -38,12 +37,4 @@ export class HealthPanelComponent implements OnInit {
|
|||||||
|
|
||||||
return (translation === translationKey) ? panelKey : translation;
|
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