Skip to content

Commit

Permalink
Hide empty 'Input Datasets' on details page (#1364)
Browse files Browse the repository at this point in the history
When a dataset doesn't have input datasets, the API returns an empty
array. The dataset details would show the label 'Input datasets' without
any items/link.
This patch hides the label if the array is empty.
  • Loading branch information
fpotier authored Jan 19, 2024
1 parent 97d2f58 commit 677e82d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/datasets/dataset-detail/dataset-detail.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -306,16 +306,16 @@
</div>
</td>
</tr>
<tr *ngIf="dataset['inputDatasets'] as value">
<tr *ngIf="dataset['inputDatasets'] && dataset['inputDatasets'].length > 0">
<th>Input Datasets</th>
<td>
<div *ngFor="let datasetPid of value">
<div *ngFor="let datasetPid of dataset['inputDatasets']">
<span>
<a [routerLink]="['/datasets/', datasetPid]">
{{ datasetPid }}
</a>
</span>
<span *ngIf="value.indexOf(datasetPid) < value.length - 1"
<span *ngIf="dataset['inputDatasets'].indexOf(datasetPid) < dataset['inputDatasets'].length - 1"
>,
</span>
</div>
Expand Down

0 comments on commit 677e82d

Please sign in to comment.