1
0

Add an input to show/hide the badge on file component

This commit is contained in:
Nicolas Boulay
2025-03-19 13:20:05 -04:00
parent 2c6754a647
commit fe3ae0e8b4
5 changed files with 20 additions and 4 deletions

View File

@@ -29,7 +29,7 @@
[title]="'process.detail.output-files'">
<div class="d-flex flex-column">
@for (file of files; track file; let last = $last) {
<ds-file-download-link [bitstream]="file">
<ds-file-download-link [bitstream]="file" [showAccessStatusBadge]="false">
<span>{{getFileName(file)}}</span>
<span>({{(file?.sizeBytes) | dsFileSize }})</span>
</ds-file-download-link>

View File

@@ -1,4 +1,6 @@
@if (showAccessStatusBadge) {
<ds-access-status-badge [object]="bitstream"></ds-access-status-badge>
}
<a [routerLink]="(bitstreamPath$| async)?.routerLink" class="d-block dont-break-out mb-1"
[queryParams]="(bitstreamPath$| async)?.queryParams"
[target]="isBlank ? '_blank': '_self'"

View File

@@ -65,6 +65,11 @@ export class FileDownloadLinkComponent implements OnInit {
@Input() enableRequestACopy = true;
/**
* A boolean indicating whether the access status badge is displayed
*/
@Input() showAccessStatusBadge = true;
bitstreamPath$: Observable<{
routerLink: string,
queryParams: any,

View File

@@ -27,7 +27,16 @@ export class ThemedFileDownloadLinkComponent extends ThemedComponent<FileDownloa
@Input() enableRequestACopy: boolean;
protected inAndOutputNames: (keyof FileDownloadLinkComponent & keyof this)[] = ['bitstream', 'item', 'cssClasses', 'isBlank', 'enableRequestACopy'];
@Input() showAccessStatusBadge: boolean;
protected inAndOutputNames: (keyof FileDownloadLinkComponent & keyof this)[] = [
'bitstream',
'item',
'cssClasses',
'isBlank',
'enableRequestACopy',
'showAccessStatusBadge',
];
protected getComponentName(): string {
return 'FileDownloadLinkComponent';

View File

@@ -27,7 +27,7 @@
<div class="float-end w-15">
<ng-container>
<ds-file-download-link [cssClasses]="'btn btn-link-focus'" [isBlank]="true"
[bitstream]="getBitstream()" [enableRequestACopy]="false">
[bitstream]="getBitstream()" [enableRequestACopy]="false" [showAccessStatusBadge]="false">
<i class="fa fa-download fa-2x text-normal" aria-hidden="true"></i>
</ds-file-download-link>
<button class="btn btn-link-focus"