mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-11 03:53:02 +00:00
[835] Auto-save in new Item Submission form breaks the form
Tests fixed.
This commit is contained in:
@@ -410,9 +410,8 @@ export class SubmissionObjectEffects {
|
||||
this.submissionService.notifyNewSection(submissionId, sectionId, currentState.sections[sectionId].sectionType);
|
||||
}
|
||||
|
||||
const sectionForm = forms[currentState.sections[sectionId].formId];
|
||||
const sectionForm = getForm(forms, currentState, sectionId);
|
||||
const filteredErrors = filterErrors(sectionForm, sectionErrors, currentState.sections[sectionId].sectionType, notify);
|
||||
|
||||
mappedActions.push(new UpdateSectionDataAction(submissionId, sectionId, sectionData, filteredErrors));
|
||||
}
|
||||
});
|
||||
@@ -421,6 +420,15 @@ export class SubmissionObjectEffects {
|
||||
}
|
||||
}
|
||||
|
||||
function getForm(forms, currentState, sectionId) {
|
||||
if (!forms) {
|
||||
return null;
|
||||
}
|
||||
const formId = currentState.sections[sectionId].formId;
|
||||
return forms[formId];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Filter sectionErrors accordingly to this rules:
|
||||
* 1. if notifications are enabled return all errors
|
||||
|
Reference in New Issue
Block a user