diff --git a/CHANGELOG.md b/CHANGELOG.md index d6812c4c..0c0c7f73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,6 +76,7 @@ * Create Jest/RTL test for RequestsFilters.js. Refs UIREQ-937. * Add "itemId" parameter to "allowed-service-points" endpoint. Refs UIREQ-1030. * Use current optional dependencies. Refs UIREQ-1031. +* Update Requests error messages. Refs UIREQ-1036. ## [8.0.2](https://github.com/folio-org/ui-requests/tree/v8.0.2) (2023-03-29) [Full Changelog](https://github.com/folio-org/ui-requests/compare/v8.0.1...v8.0.2) diff --git a/src/routes/RequestsRoute.js b/src/routes/RequestsRoute.js index 80445306..3c7b7087 100644 --- a/src/routes/RequestsRoute.js +++ b/src/routes/RequestsRoute.js @@ -211,12 +211,30 @@ export const REQUEST_ERROR_MESSAGE_CODE = { REQUEST_NOT_ALLOWED_FOR_PATRON_TITLE_COMBINATION: 'REQUEST_NOT_ALLOWED_FOR_PATRON_TITLE_COMBINATION', SERVICE_POINT_IS_NOT_PICKUP_LOCATION: 'SERVICE_POINT_IS_NOT_PICKUP_LOCATION', REQUEST_PICKUP_SERVICE_POINT_IS_NOT_ALLOWED: 'REQUEST_PICKUP_SERVICE_POINT_IS_NOT_ALLOWED', + REQUEST_LEVEL_IS_NOT_ALLOWED: 'REQUEST_LEVEL_IS_NOT_ALLOWED', + FULFILLMENT_PREFERENCE_IS_NOT_ALLOWED: 'FULFILLMENT_PREFERENCE_IS_NOT_ALLOWED', + REQUESTER_ALREADY_HAS_LOAN_FOR_ONE_OF_INSTANCES_ITEMS: 'REQUESTER_ALREADY_HAS_LOAN_FOR_ONE_OF_INSTANCES_ITEMS', + REQUESTER_ALREADY_HAS_THIS_ITEM_ON_LOAN: 'REQUESTER_ALREADY_HAS_THIS_ITEM_ON_LOAN', + CANNOT_CREATE_PAGE_TLR_WITHOUT_ITEM_ID: 'CANNOT_CREATE_PAGE_TLR_WITHOUT_ITEM_ID', + HOLD_AND_RECALL_TLR_NOT_ALLOWED_PAGEABLE_AVAILABLE_ITEM_FOUND: 'HOLD_AND_RECALL_TLR_NOT_ALLOWED_PAGEABLE_AVAILABLE_ITEM_FOUND', + USER_CANNOT_BE_PROXY_FOR_THEMSELVES: 'USER_CANNOT_BE_PROXY_FOR_THEMSELVES', + ITEM_ALREADY_REQUESTED: 'ITEM_ALREADY_REQUESTED', + HOLD_SHELF_REQUESTS_REQUIRE_PICKUP_SERVICE_POINT: 'HOLD_SHELF_REQUESTS_REQUIRE_PICKUP_SERVICE_POINT', }; export const REQUEST_ERROR_MESSAGE_TRANSLATION_KEYS = { [REQUEST_ERROR_MESSAGE_CODE.REQUEST_NOT_ALLOWED_FOR_PATRON_TITLE_COMBINATION]: 'ui-requests.errors.requestNotAllowedForPatronTitleCombination', [REQUEST_ERROR_MESSAGE_CODE.SERVICE_POINT_IS_NOT_PICKUP_LOCATION]: 'ui-requests.errors.servicePointIsNotPickupLocation', [REQUEST_ERROR_MESSAGE_CODE.REQUEST_PICKUP_SERVICE_POINT_IS_NOT_ALLOWED]: 'ui-requests.errors.requestPickupServicePointIsNotAllowed', + [REQUEST_ERROR_MESSAGE_CODE.REQUEST_LEVEL_IS_NOT_ALLOWED]: 'ui-requests.errors.requestLevelIsNotAllowed', + [REQUEST_ERROR_MESSAGE_CODE.FULFILLMENT_PREFERENCE_IS_NOT_ALLOWED]: 'ui-requests.errors.fulfillmentPreferenceIsNotAllowed', + [REQUEST_ERROR_MESSAGE_CODE.REQUESTER_ALREADY_HAS_LOAN_FOR_ONE_OF_INSTANCES_ITEMS]: 'ui-requests.errors.requesterAlreadyHasLoanForOneOfInstancesItems', + [REQUEST_ERROR_MESSAGE_CODE.REQUESTER_ALREADY_HAS_THIS_ITEM_ON_LOAN]: 'ui-requests.errors.requesterAlreadyHasThisItemOnLoan', + [REQUEST_ERROR_MESSAGE_CODE.CANNOT_CREATE_PAGE_TLR_WITHOUT_ITEM_ID]: 'ui-requests.errors.cannotCreatePageTlrWithoutItemId', + [REQUEST_ERROR_MESSAGE_CODE.HOLD_AND_RECALL_TLR_NOT_ALLOWED_PAGEABLE_AVAILABLE_ITEM_FOUND]: 'ui-requests.errors.holdAndRecallTlrNotAllowedPageableAvailableItemFound', + [REQUEST_ERROR_MESSAGE_CODE.USER_CANNOT_BE_PROXY_FOR_THEMSELVES]: 'ui-requests.errors.userCannotBeProxyForThemselves', + [REQUEST_ERROR_MESSAGE_CODE.ITEM_ALREADY_REQUESTED]: 'ui-requests.errors.itemAlreadyRequested', + [REQUEST_ERROR_MESSAGE_CODE.HOLD_SHELF_REQUESTS_REQUIRE_PICKUP_SERVICE_POINT]: 'ui-requests.errors.holdShelfRequestsRequirePickupServicePoint', }; export const getRequestErrorMessage = (error, intl) => { diff --git a/translations/ui-requests/en.json b/translations/ui-requests/en.json index 799ec98e..af57a67c 100644 --- a/translations/ui-requests/en.json +++ b/translations/ui-requests/en.json @@ -88,6 +88,15 @@ "errors.requestNotAllowedForPatronTitleCombination": "Hold requests are not allowed for this patron and title combination", "errors.servicePointIsNotPickupLocation": "Service point is not a Pickup location", "errors.requestPickupServicePointIsNotAllowed": "One or more Pickup locations are no longer available", + "errors.requestLevelIsNotAllowed": "Request level must be one of the following: \"Item\", \"Title\"", + "errors.fulfillmentPreferenceIsNotAllowed": "Fulfillment preference must be one of the following: Hold Shelf, Delivery", + "errors.requesterAlreadyHasLoanForOneOfInstancesItems": "This requester already has a loan for one of the instance's items", + "errors.requesterAlreadyHasThisItemOnLoan": "This requester already has this item on loan", + "errors.cannotCreatePageTlrWithoutItemId": "Cannot create a title level page request for this instance ID with no item ID", + "errors.holdAndRecallTlrNotAllowedPageableAvailableItemFound": "Hold/Recall title level request not allowed: pageable available item found for instance", + "errors.userCannotBeProxyForThemselves": "User cannot be proxy for themselves", + "errors.itemAlreadyRequested": "Not allowed to move title level page request to the same item", + "errors.holdShelfRequestsRequirePickupServicePoint": "Hold shelf fulfillment requests require a Pickup service point", "actions.label": "Actions", "actions.edit": "Edit",