From 9c3450f83b29a809f5603df85e492d4972ca17a4 Mon Sep 17 00:00:00 2001 From: vashjs <86330150+vashjs@users.noreply.github.com> Date: Thu, 28 Sep 2023 07:56:12 +0100 Subject: [PATCH] UIBULKED-341 Separate Item notes in different columns based on the note type (#386) --- CHANGELOG.md | 1 + src/components/BulkEditActionMenu/BulkEditActionMenu.js | 2 +- src/utils/mappers/mappers.js | 5 +++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e1f21bd..9ddc6642 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ * [UIBULKED-312](https://issues.folio.org/browse/UIBULKED-312) CSV: On cancel button click uploaded file should be deleted. * [UIBULKED-346](https://issues.folio.org/browse/UIBULKED-346) *BREAKING* bump `react-intl` to `v6.4.4`. * [UIBULKED-343](https://issues.folio.org/browse/UIBULKED-343) Refactor logic for downloading file from actions menu. +* [UIBULKED-341](https://issues.folio.org/browse/UIBULKED-341) Separate Item notes in different columns based on the note type ## [3.0.5](https://github.com/folio-org/ui-bulk-edit/tree/v3.0.5) (2023-03-22) diff --git a/src/components/BulkEditActionMenu/BulkEditActionMenu.js b/src/components/BulkEditActionMenu/BulkEditActionMenu.js index d97c3712..e715dd1e 100644 --- a/src/components/BulkEditActionMenu/BulkEditActionMenu.js +++ b/src/components/BulkEditActionMenu/BulkEditActionMenu.js @@ -85,7 +85,7 @@ const BulkEditActionMenu = ({ const columnsOptions = columns.map(item => ({ ...item, - label: intl.formatMessage({ id: `ui-bulk-edit.columns.${capability}.${item.label}` }), + label: item.ignoreTranslation ? item.label : intl.formatMessage({ id: `ui-bulk-edit.columns.${capability}.${item.label}` }), disabled: isLastUnselectedColumn(item.value) || !countOfRecords, })); diff --git a/src/utils/mappers/mappers.js b/src/utils/mappers/mappers.js index 76c4cb9d..d7f48ad4 100644 --- a/src/utils/mappers/mappers.js +++ b/src/utils/mappers/mappers.js @@ -51,10 +51,11 @@ export const getMappedTableData = ({ data, capabilities, intl }) => { value: cell.value, disabled: false, selected: !cell.visible, + ignoreTranslation: cell.ignoreTranslation, })); - const columnMapping = columns.reduce((acc, { value, label }) => { - acc[value] = intl.formatMessage({ id: `ui-bulk-edit.columns.${capabilities}.${label}` }); + const columnMapping = columns.reduce((acc, { value, label, ignoreTranslation }) => { + acc[value] = ignoreTranslation ? value : intl.formatMessage({ id: `ui-bulk-edit.columns.${capabilities}.${label}` }); return acc; }, {});