diff --git a/src/app/submission/sections/upload/file/section-upload-file.component.html b/src/app/submission/sections/upload/file/section-upload-file.component.html index c1cdf266aaf..e09e79ff7fd 100644 --- a/src/app/submission/sections/upload/file/section-upload-file.component.html +++ b/src/app/submission/sections/upload/file/section-upload-file.component.html @@ -36,18 +36,25 @@ (click)="$event.preventDefault();editBitstreamData();"> - + + + +
diff --git a/src/app/submission/sections/upload/file/section-upload-file.component.ts b/src/app/submission/sections/upload/file/section-upload-file.component.ts index c6949bd3828..6822330e5f8 100644 --- a/src/app/submission/sections/upload/file/section-upload-file.component.ts +++ b/src/app/submission/sections/upload/file/section-upload-file.component.ts @@ -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 * diff --git a/src/app/submission/sections/upload/file/themed-section-upload-file.component.ts b/src/app/submission/sections/upload/file/themed-section-upload-file.component.ts index 792ed087e74..c49d104799f 100644 --- a/src/app/submission/sections/upload/file/themed-section-upload-file.component.ts +++ b/src/app/submission/sections/upload/file/themed-section-upload-file.component.ts @@ -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', @@ -88,6 +95,7 @@ export class ThemedSubmissionSectionUploadFileComponent 'fileName', 'sectionId', 'submissionId', + 'totalFiles', ]; protected getComponentName(): string { diff --git a/src/app/submission/sections/upload/section-upload.component.html b/src/app/submission/sections/upload/section-upload.component.html index 7bcfa1d242d..5ffa1d6838c 100644 --- a/src/app/submission/sections/upload/section-upload.component.html +++ b/src/app/submission/sections/upload/section-upload.component.html @@ -33,6 +33,7 @@