Skip to content

Commit

Permalink
UIDATIMP-1679: Allow central tenant to create action profile for Orde…
Browse files Browse the repository at this point in the history
…rs and Invoices (#1657)

* UIDATIMP-1679: Allow central tenant to create action profile for Orders and Invoices

* UIDATIMP-1679: Fix tests
  • Loading branch information
OleksandrHladchenko1 authored Nov 26, 2024
1 parent 69d0f8f commit eb823c7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
### Features added:
* `React v19`: refactor away from default props for functional components. (UIDATIMP-1634)

## [8.0.3] (IN PROGRESS)

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

## [8.0.2](https://github.com/folio-org/ui-data-import/tree/v8.0.2) (2024-11-21)

### Bugs fixed:
Expand Down
2 changes: 2 additions & 0 deletions src/settings/ActionProfiles/ActionProfilesForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ export const ActionProfilesFormComponent = ({
const RECORD_TYPES = isUserInCentralTenant
? pick(ACTION_PROFILES_FORM_FOLIO_RECORD_TYPES, [
ACTION_PROFILES_FORM_FOLIO_RECORD_TYPES.INSTANCE.type,
ACTION_PROFILES_FORM_FOLIO_RECORD_TYPES.INVOICE.type,
ACTION_PROFILES_FORM_FOLIO_RECORD_TYPES.ORDER.type,
ACTION_PROFILES_FORM_FOLIO_RECORD_TYPES.MARC_BIBLIOGRAPHIC.type,
ACTION_PROFILES_FORM_FOLIO_RECORD_TYPES.MARC_AUTHORITY.type,
])
Expand Down
6 changes: 3 additions & 3 deletions src/settings/ActionProfiles/ActionProfilesForm.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,19 +161,19 @@ describe('ActionProfilesForm component', () => {
});

describe('when user is in central tenant', () => {
it('should render "Instance", "MARC Bibliographic" and "MARC Authority" record types', () => {
it('should render "Instance", "Order", "Invoice", "MARC Bibliographic" and "MARC Authority" record types', () => {
spyOnCheckIfUserInCentralTenant.mockReturnValue(true);

const { container } = renderActionProfilesForm(actionProfilesFormProps());

expect(container.querySelector('[value="INSTANCE"]')).toBeDefined();
expect(container.querySelector('[value="ORDER"]')).toBeDefined();
expect(container.querySelector('[value="INVOICE"]')).toBeDefined();
expect(container.querySelector('[value="MARC_BIBLIOGRAPHIC"]')).toBeDefined();
expect(container.querySelector('[value="MARC_HOLDINGS"]')).toBeDefined();

expect(container.querySelector('[value="HOLDINGS"]')).not.toBeInTheDocument();
expect(container.querySelector('[value="ITEM"]')).not.toBeInTheDocument();
expect(container.querySelector('[value="ORDER"]')).not.toBeInTheDocument();
expect(container.querySelector('[value="INVOICE"]')).not.toBeInTheDocument();
});
});

Expand Down

0 comments on commit eb823c7

Please sign in to comment.