Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,25 @@
(click)="$event.preventDefault();editBitstreamData();">
<i class="fa fa-edit fa-2x text-normal"></i>
</button>
<button class="btn btn-link-focus"
attr.aria-label="{{'submission.sections.upload.delete.confirm.title' | translate}} {{fileName}}"
title="{{ 'submission.sections.upload.delete.confirm.title' | translate }} {{fileName}}"
[dsBtnDisabled]="(processingDelete$ | async)"
(click)="$event.preventDefault();confirmDelete(content);">
@if ((processingDelete$ | async)) {
<i class="fas fa-circle-notch fa-spin fa-2x link-danger"></i>
}
@if ((processingDelete$ | async) !== true) {
<i class="fa fa-trash fa-2x link-danger"></i>
}
</button>
<span
title="{{ totalFiles === 1
? ('submission.sections.upload.delete.not-allowed' | translate)
: ('submission.sections.upload.delete.confirm.title' | translate) + ' ' + fileName }}">

<button class="btn btn-link-focus"
attr.aria-label="{{'submission.sections.upload.delete.confirm.title' | translate}} {{fileName}}"
[dsBtnDisabled]="(processingDelete$ | async) || totalFiles === 1"
(click)="$event.preventDefault();confirmDelete(content);">

@if ((processingDelete$ | async)) {
<i class="fas fa-circle-notch fa-spin fa-2x link-danger"></i>
}
@if ((processingDelete$ | async) !== true) {
<i class="fa fa-trash fa-2x link-danger"></i>
}

</button>
</span>
</ng-container>
</div>
<div class="clearfix"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,13 @@ export class SubmissionSectionUploadFileComponent implements OnChanges, OnInit,
*/
protected formMetadata: string[] = [];

/**
* Total number of files currently attached to the item.
* Used to prevent deletion when only one bitstream remains.
* @type {number}
*/
@Input() totalFiles: number;

/**
* Initialize instance variables
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ export class ThemedSubmissionSectionUploadFileComponent
*/
@Input() submissionId: string;

/**
* Total number of files currently attached to the item.
* Used to prevent deletion when only one bitstream remains.
* @type {number}
*/
@Input() totalFiles: number;

protected inAndOutputNames: (keyof SubmissionSectionUploadFileComponent & keyof this)[] = [
'availableAccessConditionOptions',
'isPrimary',
Expand All @@ -88,6 +95,7 @@ export class ThemedSubmissionSectionUploadFileComponent
'fileName',
'sectionId',
'submissionId',
'totalFiles',
];

protected getComponentName(): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<ds-submission-upload-section-file
[isPrimary]="primaryBitstreamUUID ? primaryBitstreamUUID === fileEntry.uuid : null"
[availableAccessConditionOptions]="availableAccessConditionOptions"
[totalFiles]="fileList.length"
[collectionId]="collectionId"
[collectionPolicyType]="collectionPolicyType"
[configMetadataForm]="(configMetadataForm$ | async)"
Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/en.json5
Original file line number Diff line number Diff line change
Expand Up @@ -5909,6 +5909,8 @@

"submission.sections.upload.upload-successful": "Upload successful",

"submission.sections.upload.delete.not-allowed": "All Items require at least one File. To delete this File, please first add another File to the Item.",

"submission.sections.custom-url.label.previous-urls": "Previous Urls",

"submission.sections.custom-url.alert.info": "Define here a custom URL which will be used to reach the item instead of using an internal randomly generated UUID identifier. ",
Expand Down
Loading