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
  • Loading branch information
OleksandrHladchenko1 committed Dec 3, 2024
1 parent 8b7517a commit ffe6dfb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

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 ffe6dfb

Please sign in to comment.