Skip to content

Commit fe3ae0e

Browse files
committed
Add an input to show/hide the badge on file component
1 parent 2c6754a commit fe3ae0e

5 files changed

Lines changed: 20 additions & 4 deletions

File tree

src/app/process-page/detail/process-detail.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ <h1 class="flex-grow-1">
2929
[title]="'process.detail.output-files'">
3030
<div class="d-flex flex-column">
3131
@for (file of files; track file; let last = $last) {
32-
<ds-file-download-link [bitstream]="file">
32+
<ds-file-download-link [bitstream]="file" [showAccessStatusBadge]="false">
3333
<span>{{getFileName(file)}}</span>
3434
<span>({{(file?.sizeBytes) | dsFileSize }})</span>
3535
</ds-file-download-link>

src/app/shared/file-download-link/file-download-link.component.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<ds-access-status-badge [object]="bitstream"></ds-access-status-badge>
1+
@if (showAccessStatusBadge) {
2+
<ds-access-status-badge [object]="bitstream"></ds-access-status-badge>
3+
}
24
<a [routerLink]="(bitstreamPath$| async)?.routerLink" class="d-block dont-break-out mb-1"
35
[queryParams]="(bitstreamPath$| async)?.queryParams"
46
[target]="isBlank ? '_blank': '_self'"

src/app/shared/file-download-link/file-download-link.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ export class FileDownloadLinkComponent implements OnInit {
6565

6666
@Input() enableRequestACopy = true;
6767

68+
/**
69+
* A boolean indicating whether the access status badge is displayed
70+
*/
71+
@Input() showAccessStatusBadge = true;
72+
6873
bitstreamPath$: Observable<{
6974
routerLink: string,
7075
queryParams: any,

src/app/shared/file-download-link/themed-file-download-link.component.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,16 @@ export class ThemedFileDownloadLinkComponent extends ThemedComponent<FileDownloa
2727

2828
@Input() enableRequestACopy: boolean;
2929

30-
protected inAndOutputNames: (keyof FileDownloadLinkComponent & keyof this)[] = ['bitstream', 'item', 'cssClasses', 'isBlank', 'enableRequestACopy'];
30+
@Input() showAccessStatusBadge: boolean;
31+
32+
protected inAndOutputNames: (keyof FileDownloadLinkComponent & keyof this)[] = [
33+
'bitstream',
34+
'item',
35+
'cssClasses',
36+
'isBlank',
37+
'enableRequestACopy',
38+
'showAccessStatusBadge',
39+
];
3140

3241
protected getComponentName(): string {
3342
return 'FileDownloadLinkComponent';

src/app/submission/sections/upload/file/section-upload-file.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<div class="float-end w-15">
2828
<ng-container>
2929
<ds-file-download-link [cssClasses]="'btn btn-link-focus'" [isBlank]="true"
30-
[bitstream]="getBitstream()" [enableRequestACopy]="false">
30+
[bitstream]="getBitstream()" [enableRequestACopy]="false" [showAccessStatusBadge]="false">
3131
<i class="fa fa-download fa-2x text-normal" aria-hidden="true"></i>
3232
</ds-file-download-link>
3333
<button class="btn btn-link-focus"

0 commit comments

Comments
 (0)