Skip to content

Commit d9d658b

Browse files
committed
[DSC-1977] Improve error handling of the item correction functionality
1 parent c32f60e commit d9d658b

3 files changed

Lines changed: 12 additions & 5 deletions

File tree

src/app/shared/context-menu/request-correction/request-correction-menu.component.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,19 @@ export class RequestCorrectionMenuComponent extends ContextMenuEntryComponent im
125125
case 403:
126126
this.notificationService.warning(
127127
null,
128-
this.translate.instant('item.page.context-menu.options.request-correction.error.403')
128+
this.translate.instant('context-menu.actions.request-correction.error.403')
129+
);
130+
break;
131+
case 422:
132+
this.notificationService.warning(
133+
null,
134+
this.translate.instant('context-menu.actions.request-correction.error.422')
129135
);
130136
break;
131137
default :
132138
this.notificationService.error(
133139
null,
134-
this.translate.instant('item.page.context-menu.options.request-correction.error.generic')
140+
this.translate.instant('context-menu.actions.request-correction.error.generic')
135141
);
136142
}
137143
}

src/app/submission/submission.service.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,7 @@ export class SubmissionService {
219219
options.params = params;
220220

221221
return this.restService.postToEndpoint(this.workspaceLinkPath, {}, null, options).pipe(
222-
map((workspaceitem: SubmissionObject[]) => workspaceitem[0] as SubmissionObject),
223-
catchError(() => observableOf({} as SubmissionObject)));
222+
map((workspaceitem: SubmissionObject[]) => workspaceitem[0] as SubmissionObject));
224223
}
225224

226225
/**

src/assets/i18n/en.json5

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1692,7 +1692,9 @@
16921692

16931693
"context-menu.actions.request-correction.confirm.submit": "Yes, I'm sure",
16941694

1695-
"context-menu.actions.request-correction.error.403": "A request for correction has already been sent, impossible to proceed with the operation.",
1695+
"context-menu.actions.request-correction.error.403": "You are not authorized, impossible to proceed with the operation.",
1696+
1697+
"context-menu.actions.request-correction.error.422": "A correction request for this item is already in progress. Please contact the support if you need to perform urgent changes to this item.",
16961698

16971699
"context-menu.actions.request-correction.error.generic": "There was an issue when requesting a correction for the item, please try again later.",
16981700

0 commit comments

Comments
 (0)