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'">
|
[title]="'process.detail.output-files'">
|
||||||
<div class="d-flex flex-column">
|
<div class="d-flex flex-column">
|
||||||
@for (file of files; track file; let last = $last) {
|
@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>{{getFileName(file)}}</span>
|
||||||
<span>({{(file?.sizeBytes) | dsFileSize }})</span>
|
<span>({{(file?.sizeBytes) | dsFileSize }})</span>
|
||||||
</ds-file-download-link>
|
</ds-file-download-link>
|
||||||
|
@@ -1,4 +1,6 @@
|
|||||||
|
@if (showAccessStatusBadge) {
|
||||||
<ds-access-status-badge [object]="bitstream"></ds-access-status-badge>
|
<ds-access-status-badge [object]="bitstream"></ds-access-status-badge>
|
||||||
|
}
|
||||||
<a [routerLink]="(bitstreamPath$| async)?.routerLink" class="d-block dont-break-out mb-1"
|
<a [routerLink]="(bitstreamPath$| async)?.routerLink" class="d-block dont-break-out mb-1"
|
||||||
[queryParams]="(bitstreamPath$| async)?.queryParams"
|
[queryParams]="(bitstreamPath$| async)?.queryParams"
|
||||||
[target]="isBlank ? '_blank': '_self'"
|
[target]="isBlank ? '_blank': '_self'"
|
||||||
|
@@ -65,6 +65,11 @@ export class FileDownloadLinkComponent implements OnInit {
|
|||||||
|
|
||||||
@Input() enableRequestACopy = true;
|
@Input() enableRequestACopy = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A boolean indicating whether the access status badge is displayed
|
||||||
|
*/
|
||||||
|
@Input() showAccessStatusBadge = true;
|
||||||
|
|
||||||
bitstreamPath$: Observable<{
|
bitstreamPath$: Observable<{
|
||||||
routerLink: string,
|
routerLink: string,
|
||||||
queryParams: any,
|
queryParams: any,
|
||||||
|
@@ -27,7 +27,16 @@ export class ThemedFileDownloadLinkComponent extends ThemedComponent<FileDownloa
|
|||||||
|
|
||||||
@Input() enableRequestACopy: boolean;
|
@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 {
|
protected getComponentName(): string {
|
||||||
return 'FileDownloadLinkComponent';
|
return 'FileDownloadLinkComponent';
|
||||||
|
@@ -27,7 +27,7 @@
|
|||||||
<div class="float-end w-15">
|
<div class="float-end w-15">
|
||||||
<ng-container>
|
<ng-container>
|
||||||
<ds-file-download-link [cssClasses]="'btn btn-link-focus'" [isBlank]="true"
|
<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>
|
<i class="fa fa-download fa-2x text-normal" aria-hidden="true"></i>
|
||||||
</ds-file-download-link>
|
</ds-file-download-link>
|
||||||
<button class="btn btn-link-focus"
|
<button class="btn btn-link-focus"
|
||||||
|
Reference in New Issue
Block a user