Skip to content

Commit aa1779f

Browse files
131410: add support for upload success but with required metadata not filled
1 parent f58ba03 commit aa1779f

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

src/app/submission/form/submission-upload-files/submission-upload-files.component.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,25 @@ export class SubmissionUploadFilesComponent implements OnChanges, OnDestroy {
157157
.subscribe((isUpload) => {
158158
if (isUpload) {
159159
// Look for errors on upload
160-
if ((isEmpty(sectionErrors))) {
161-
this.notificationsService.success(null, this.translate.get('submission.sections.upload.upload-successful'));
160+
const hasOnlyPendingMetadataErrors = sectionErrors?.every(
161+
(error) => error.message === 'error.validation.metadata.pending'
162+
);
163+
164+
if (isEmpty(sectionErrors)) {
165+
this.notificationsService.success(
166+
null,
167+
this.translate.get('submission.sections.upload.upload-successful')
168+
);
169+
} else if (hasOnlyPendingMetadataErrors) {
170+
this.notificationsService.warning(
171+
null,
172+
this.translate.get('submission.sections.upload.metadata-pending')
173+
);
162174
} else {
163-
this.notificationsService.error(null, this.translate.get('submission.sections.upload.upload-failed'));
175+
this.notificationsService.error(
176+
null,
177+
this.translate.get('submission.sections.upload.upload-failed')
178+
);
164179
}
165180
}
166181
});

src/assets/i18n/en.json5

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5649,6 +5649,8 @@
56495649
"submission.sections.upload.save-metadata": "Save metadata",
56505650

56515651
"submission.sections.upload.undo": "Cancel",
5652+
5653+
"submission.sections.upload.metadata-pending": "Upload successful. There are required fields for the file. Scroll to the \"Upload files\" section to view and edit uploaded files.",
56525654

56535655
"submission.sections.upload.upload-failed": "Upload failed",
56545656

0 commit comments

Comments
 (0)