Skip to content

Commit

Permalink
UIDATIMP-1685: Allow central tenant to create filed mapping profile f…
Browse files Browse the repository at this point in the history
…or Orders and Invoices (#1660)

(cherry picked from commit aab1593)
  • Loading branch information
OleksandrHladchenko1 authored and mariia-aloshyna committed Dec 6, 2024
1 parent 9c6b6df commit 1b97c9b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change history for ui-data-import

## [8.0.4] (IN PROGRESS)

### Bugs fixed:
* Allow central tenant to create filed mapping profile for Orders and Invoices. (UIDATIMP-1685)

## [8.0.3](https://github.com/folio-org/ui-data-import/tree/v8.0.3) (2024-12-04)

### Bugs fixed:
Expand Down
3 changes: 2 additions & 1 deletion src/settings/MappingProfiles/MappingProfilesForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
});
Expand Down

0 comments on commit 1b97c9b

Please sign in to comment.