forked from hazza/dspace-angular
Add an input to show/hide the badge on file component
This commit is contained in:
@@ -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>
|
||||
|
@@ -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'"
|
||||
|
@@ -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,
|
||||
|
@@ -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';
|
||||
|
@@ -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"
|
||||
|
Reference in New Issue
Block a user