Skip to content

Commit

Permalink
Merged in task/dspace-cris-2023_02_x/DSC-1977 (pull request DSpace#2385)
Browse files Browse the repository at this point in the history
[DSC-1977] Improve error handling of the item correction functionality

Approved-by: Andrea Barbasso
  • Loading branch information
atarix83 authored and Andrea Barbasso committed Oct 17, 2024
2 parents 170f813 + ba4f318 commit 8ad1dc3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,19 @@ export class RequestCorrectionMenuComponent extends ContextMenuEntryComponent im
case 403:
this.notificationService.warning(
null,
this.translate.instant('item.page.context-menu.options.request-correction.error.403')
this.translate.instant('context-menu.actions.request-correction.error.403')
);
break;
case 422:
this.notificationService.warning(
null,
this.translate.instant('context-menu.actions.request-correction.error.422')
);
break;
default :
this.notificationService.error(
null,
this.translate.instant('item.page.context-menu.options.request-correction.error.generic')
this.translate.instant('context-menu.actions.request-correction.error.generic')
);
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/app/submission/submission.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,7 @@ export class SubmissionService {
options.params = params;

return this.restService.postToEndpoint(this.workspaceLinkPath, {}, null, options).pipe(
map((workspaceitem: SubmissionObject[]) => workspaceitem[0] as SubmissionObject),
catchError(() => observableOf({} as SubmissionObject)));
map((workspaceitem: SubmissionObject[]) => workspaceitem[0] as SubmissionObject));
}

/**
Expand Down
4 changes: 3 additions & 1 deletion src/assets/i18n/en.json5
Original file line number Diff line number Diff line change
Expand Up @@ -1652,7 +1652,9 @@

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

"context-menu.actions.request-correction.error.403": "A request for correction has already been sent, impossible to proceed with the operation.",
"context-menu.actions.request-correction.error.403": "You are not authorized, impossible to proceed with the operation.",

"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.",

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

Expand Down

0 comments on commit 8ad1dc3

Please sign in to comment.