Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIDATIMP-1685: Allow central tenant to create field mapping profile for Orders and Invoices #1660

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading