Skip to content

Commit

Permalink
Merged in DSC-1314 (pull request DSpace#945)
Browse files Browse the repository at this point in the history
[DSC-1314] Porting of improvements on file-download-button component

Approved-by: Andrea Barbasso
  • Loading branch information
Davide Negretti authored and Andrea Barbasso committed Oct 23, 2023
2 parents 6442528 + 29abe9f commit f2c90c3
Showing 1 changed file with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<ng-container *ngIf="!hasNoDownload">
<ng-container *ngIf="(canDownload$ | async)">
<ng-container *ngVar="bitstreamPath$ | async as downloadLink">
<a [routerLink]="downloadLink?.routerLink" [queryParams]="downloadLink?.queryParams" class="btn btn-outline-primary"
data-test="download">
<i class="fas fa-download"></i>
{{ 'cris-layout.advanced-attachment.download' | translate }}</a>
</ng-container>
</ng-container>
<ng-container *ngIf="!(canDownload$ | async)">
<ng-container *ngVar="bitstreamPath$ | async as requestACopyLink">
<button [routerLink]="requestACopyLink?.routerLink"
[queryParams]="requestACopyLink?.queryParams"
[disabled]="!(canRequestItemCopy$ | async)"
class="btn btn-outline-primary"
data-test="requestACopy">
{{ 'cris-layout.advanced-attachment.requestACopy' | translate }}</button>
</ng-container>
<ng-container *ngIf="bitstreamPath$ | async as bitstreamLink">
<ng-container *ngIf="canDownload$ | async; then downloadButtonTpl; else requestACopyTpl"></ng-container>
<ng-template #downloadButtonTpl>
<button [routerLink]="bitstreamLink?.routerLink" [queryParams]="bitstreamLink?.queryParams" class="btn btn-outline-primary"
data-test="download">
<i class="fas fa-download"></i> {{ 'cris-layout.advanced-attachment.download' | translate }}
</button>
</ng-template>
<ng-template #requestACopyTpl>
<button [routerLink]="bitstreamLink?.routerLink"
[queryParams]="bitstreamLink?.queryParams"
[disabled]="!(canRequestItemCopy$ | async)"
class="btn btn-outline-primary"
data-test="requestACopy">
{{ 'cris-layout.advanced-attachment.requestACopy' | translate }}
</button>
</ng-template>
</ng-container>
</ng-container>

0 comments on commit f2c90c3

Please sign in to comment.