From ffe6dfb050473be2a8e834ac198da4a909edc726 Mon Sep 17 00:00:00 2001 From: Oleksandr Hladchenko1 Date: Tue, 3 Dec 2024 13:17:52 +0100 Subject: [PATCH] UIDATIMP-1685: Allow central tenant to create filed mapping profile for Orders and Invoices --- CHANGELOG.md | 1 + src/settings/MappingProfiles/MappingProfilesForm.js | 3 ++- .../MappingProfiles/tests/MappingProfilesForm.test.js | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b06f699be..a9c54c1ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ ### Bugs fixed: * Allow central tenant to create action profile for Orders and Invoices. (UIDATIMP-1679) +* Allow central tenant to create filed mapping profile for Orders and Invoices. (UIDATIMP-1685) ## [8.0.2](https://github.com/folio-org/ui-data-import/tree/v8.0.2) (2024-11-21) diff --git a/src/settings/MappingProfiles/MappingProfilesForm.js b/src/settings/MappingProfiles/MappingProfilesForm.js index 7d976459a..95b8ecc7a 100644 --- a/src/settings/MappingProfiles/MappingProfilesForm.js +++ b/src/settings/MappingProfiles/MappingProfilesForm.js @@ -143,10 +143,11 @@ export const MappingProfilesFormComponent = ({ dispatch(change(formName, 'profile.mappingDetails', newMappingDetails)); }; - const MAPPING_PROFILES_FORM_FOLIO_RECORD_TYPES = isUserInCentralTenant ? pick(INITIAL_FOLIO_RECORD_TYPES, [ FOLIO_RECORD_TYPES.INSTANCE.type, + FOLIO_RECORD_TYPES.ORDER.type, + FOLIO_RECORD_TYPES.INVOICE.type, FOLIO_RECORD_TYPES.MARC_BIBLIOGRAPHIC.type, FOLIO_RECORD_TYPES.MARC_AUTHORITY.type, ]) : INITIAL_FOLIO_RECORD_TYPES; diff --git a/src/settings/MappingProfiles/tests/MappingProfilesForm.test.js b/src/settings/MappingProfiles/tests/MappingProfilesForm.test.js index 6d2c4c13c..b5de6a654 100644 --- a/src/settings/MappingProfiles/tests/MappingProfilesForm.test.js +++ b/src/settings/MappingProfiles/tests/MappingProfilesForm.test.js @@ -156,7 +156,7 @@ describe('MappingProfilesForm component', () => { }); describe('when user is in central tenant', () => { - it('should render "Instance", "MARC Bibliographic" and "MARC Authority" folio record types', () => { + it('should render "Instance", "Order", "Invoice", "MARC Bibliographic" and "MARC Authority" folio record types', () => { spyOnCheckIfUserInCentralTenant.mockReturnValue(true); const { container } = renderMappingProfilesForm(mappingProfilesFormProps); @@ -165,11 +165,11 @@ describe('MappingProfilesForm component', () => { expect(within(folioRecordTypesContainer).queryByText('Holdings')).not.toBeInTheDocument(); expect(within(folioRecordTypesContainer).queryByText('Item')).not.toBeInTheDocument(); - expect(within(folioRecordTypesContainer).queryByText('Order')).not.toBeInTheDocument(); - expect(within(folioRecordTypesContainer).queryByText('Invoice')).not.toBeInTheDocument(); expect(within(folioRecordTypesContainer).queryByText('MARC Holdings')).not.toBeInTheDocument(); expect(within(folioRecordTypesContainer).getByText('Instance')).toBeInTheDocument(); + expect(within(folioRecordTypesContainer).queryByText('Order')).toBeInTheDocument(); + expect(within(folioRecordTypesContainer).queryByText('Invoice')).toBeInTheDocument(); expect(within(folioRecordTypesContainer).getByText('MARC Bibliographic')).toBeInTheDocument(); expect(within(folioRecordTypesContainer).getByText('MARC Authority')).toBeInTheDocument(); });