[835] Auto-save in new Item Submission form breaks the form

Section formId added to the section state.
Error filtering during the parsing of the submission response.
This commit is contained in:
Alessandro Martelli
2020-11-20 15:02:56 +01:00
parent 9f33855a0f
commit 875a43a14e
10 changed files with 130 additions and 28 deletions

View File

@@ -40,6 +40,7 @@ export const SubmissionObjectActionTypes = {
INIT_SECTION: type('dspace/submission/INIT_SECTION'),
ENABLE_SECTION: type('dspace/submission/ENABLE_SECTION'),
DISABLE_SECTION: type('dspace/submission/DISABLE_SECTION'),
SET_SECTION_FORM_ID: type('dspace/submission/SET_SECTION_FORM_ID'),
SECTION_STATUS_CHANGE: type('dspace/submission/SECTION_STATUS_CHANGE'),
SECTION_LOADING_STATUS_CHANGE: type('dspace/submission/SECTION_LOADING_STATUS_CHANGE'),
UPDATE_SECTION_DATA: type('dspace/submission/UPDATE_SECTION_DATA'),
@@ -256,6 +257,29 @@ export class RemoveSectionErrorsAction implements Action {
}
}
export class SetSectionFormId implements Action {
type = SubmissionObjectActionTypes.SET_SECTION_FORM_ID;
payload: {
submissionId: string;
sectionId: string;
formId: string;
};
/**
* Create a new SetSectionFormId
*
* @param submissionId
* the submission's ID
* @param sectionId
* the section's ID
* @param formId
* the section's formId
*/
constructor(submissionId: string, sectionId: string, formId: string) {
this.payload = { submissionId, sectionId, formId };
}
}
// Submission actions
export class CompleteInitSubmissionFormAction implements Action {
@@ -782,6 +806,7 @@ export class DeleteUploadedFileAction implements Action {
*/
export type SubmissionObjectAction = DisableSectionAction
| InitSectionAction
| SetSectionFormId
| EnableSectionAction
| InitSubmissionFormAction
| ResetSubmissionFormAction