From 2264778ea69b6b4762148e5ceeb816f1383ce15a Mon Sep 17 00:00:00 2001 From: Uladzislau_Kutarkin Date: Fri, 18 Oct 2024 12:45:35 +0400 Subject: [PATCH] UIBULKED-556: ECS - remove link to affected record in Optimistic error for holdings and items. --- .../ErrorsAccordion/ErrorsAccordion.js | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/src/components/BulkEditPane/BulkEditListResult/Preview/ErrorsAccordion/ErrorsAccordion.js b/src/components/BulkEditPane/BulkEditListResult/Preview/ErrorsAccordion/ErrorsAccordion.js index 5f310dd1..9940b2c0 100644 --- a/src/components/BulkEditPane/BulkEditListResult/Preview/ErrorsAccordion/ErrorsAccordion.js +++ b/src/components/BulkEditPane/BulkEditListResult/Preview/ErrorsAccordion/ErrorsAccordion.js @@ -23,6 +23,26 @@ const columnMapping = { message: , }; +const renderErrorMessage = (error, isLinkAvailable) => { + const link = getParam(error, ERROR_PARAMETERS_KEYS.LINK); + + return ( +
+ {error.message} + {' '} + {!!link && isLinkAvailable && ( + + + + + + + + )} +
+ ); +}; + const ErrorsAccordion = ({ errors = [], entries, @@ -39,25 +59,7 @@ const ErrorsAccordion = ({ const resultsFormatter = { key: error => getParam(error, ERROR_PARAMETERS_KEYS.IDENTIFIER), - message: error => { - const link = getParam(error, ERROR_PARAMETERS_KEYS.LINK); - - return ( -
- {error.message} - {' '} - {!!link && isLinkAvailable && ( - - - - - - - - )} -
- ); - }, + message: error => renderErrorMessage(error, isLinkAvailable), }; const location = useLocation();