Dispaly an error notification when an error occured on submission save

This commit is contained in:
Giuseppe Digilio
2019-02-28 18:39:12 +01:00
parent ce06b1af2a
commit 167c50e9a3
5 changed files with 47 additions and 5 deletions

View File

@@ -137,6 +137,11 @@ export class SubmissionObjectEffects {
catchError(() => observableOf(new SaveSubmissionSectionFormErrorAction(action.payload.submissionId))));
}));
@Effect({dispatch: false}) saveError$ = this.actions$.pipe(
ofType(SubmissionObjectActionTypes.SAVE_SUBMISSION_FORM_ERROR, SubmissionObjectActionTypes.SAVE_SUBMISSION_SECTION_FORM_ERROR),
withLatestFrom(this.store$),
tap(() => this.notificationsService.error(null, this.translate.get('submission.sections.general.save_error_notice'))));
@Effect() saveAndDeposit$ = this.actions$.pipe(
ofType(SubmissionObjectActionTypes.SAVE_AND_DEPOSIT_SUBMISSION),
withLatestFrom(this.store$),