diff --git a/CHANGELOG.md b/CHANGELOG.md index ac0e6f60f..86cbd2609 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change history for ui-data-import +## [8.0.3](https://github.com/folio-org/ui-data-import/tree/v8.0.3) (2024-12-04) + +### Bugs fixed: +* Allow central tenant to create action profile for Orders and Invoices. (UIDATIMP-1679) +* Replace `_/proxy/tenants/${tenant}/modules` with `stripes.discovery.modules` object. (UIDATIMP-1686) + ## [8.0.2](https://github.com/folio-org/ui-data-import/tree/v8.0.2) (2024-11-21) ### Bugs fixed: @@ -37,6 +43,16 @@ * Add missing `source-storage.sourceRecords.get` permission. (UIDATIMP-1652) * Display correctly "Percentage" and "Currency" fields for orders and invoices. (UIDATIMP-1666) +## [7.1.10](https://github.com/folio-org/ui-data-import/tree/v7.1.10) (2024-11-12) + +### Bugs fixed: +* Change endpoint to get actual SRS MARC data (UIDATIMP-1597) + +## [7.1.9](https://github.com/folio-org/ui-data-import/tree/v7.1.9) (2024-09-16) + +### Bugs fixed: +* Implement new Donor information section for Order field mapping profiles (UIDATIMP-1656) + ## [7.1.8](https://github.com/folio-org/ui-data-import/tree/v7.1.8) (2024-05-09) ### Bugs fixed: diff --git a/package.json b/package.json index e970efcd7..d71107901 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@folio/data-import", - "version": "8.0.2", + "version": "8.0.3", "description": "Data Import manager", "main": "src/index.js", "repository": "folio-org/ui-data-import", diff --git a/src/settings/ActionProfiles/ActionProfilesForm.js b/src/settings/ActionProfiles/ActionProfilesForm.js index c17a84b86..e942d8d61 100644 --- a/src/settings/ActionProfiles/ActionProfilesForm.js +++ b/src/settings/ActionProfiles/ActionProfilesForm.js @@ -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, ]) diff --git a/src/settings/ActionProfiles/ActionProfilesForm.test.js b/src/settings/ActionProfiles/ActionProfilesForm.test.js index 6c3782d60..93243dfcb 100644 --- a/src/settings/ActionProfiles/ActionProfilesForm.test.js +++ b/src/settings/ActionProfiles/ActionProfilesForm.test.js @@ -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(); }); }); diff --git a/src/settings/MatchProfiles/MatchProfiles.js b/src/settings/MatchProfiles/MatchProfiles.js index 91e7d0f5d..fc4ba3b1d 100644 --- a/src/settings/MatchProfiles/MatchProfiles.js +++ b/src/settings/MatchProfiles/MatchProfiles.js @@ -237,16 +237,6 @@ export class MatchProfiles extends Component { staticFallback: { params: {} }, }, }, - modules: { - type: 'okapi', - path: (queryParams, pathComponents, resourceData, logger, props) => { - const { stripes: { okapi: { tenant } } } = props; - - return `_/proxy/tenants/${tenant}/modules`; - }, - throwErrors: false, - GET: { params: { full: true } }, - }, }); static propTypes = { @@ -308,17 +298,17 @@ export class MatchProfiles extends Component { }; async componentDidUpdate(prevProps) { - if (!isEqual(prevProps.resources.modules, this.props.resources.modules) - && !isEmpty(this.props.resources.modules.records)) { + if (!isEqual(prevProps.stripes.discovery.modules, this.props.stripes.discovery.modules) + && !isEmpty(this.props.stripes.discovery.modules)) { const { stripes, stripes: { okapi }, - resources: { modules: { records } }, + stripes: { discovery: { modules } }, } = this.props; - const inventoryModuleVersion = getModuleVersion(records, 'Inventory Storage Module'); - const ordersModuleVersion = getModuleVersion(records, 'Orders Business Logic Module'); - const invoiceModuleVersion = getModuleVersion(records, 'Invoice business logic module'); + const inventoryModuleVersion = getModuleVersion(modules, 'Inventory Storage Module'); + const ordersModuleVersion = getModuleVersion(modules, 'Orders Business Logic Module'); + const invoiceModuleVersion = getModuleVersion(modules, 'Invoice business logic module'); const requestsToInstance = INSTANCE_RESOURCE_PATHS.map(path => fetchJsonSchema(path, inventoryModuleVersion, okapi)); const requestsToHoldings = HOLDINGS_RESOURCE_PATHS.map(path => fetchJsonSchema(path, inventoryModuleVersion, okapi)); diff --git a/src/utils/fetchJsonShemas.js b/src/utils/fetchJsonShemas.js index dadde6408..4a6ad17c8 100644 --- a/src/utils/fetchJsonShemas.js +++ b/src/utils/fetchJsonShemas.js @@ -1,7 +1,7 @@ export const getModuleVersion = (modules, moduleName) => { - const version = modules.find(module => module.name === moduleName); + const version = Object.keys(modules).find(key => modules[key] === moduleName); - return version ? version.id : undefined; + return version || undefined; }; export const fetchJsonSchema = async (path, module, okapi) => { diff --git a/src/utils/tests/fetchJsonSchemas.test.js b/src/utils/tests/fetchJsonSchemas.test.js index 59d021a6f..0b8637684 100644 --- a/src/utils/tests/fetchJsonSchemas.test.js +++ b/src/utils/tests/fetchJsonSchemas.test.js @@ -9,15 +9,12 @@ import { STATUS_CODES } from '../constants'; describe('getModuleVersion function', () => { it('returns module version of a module with given name', () => { - const testModules = [{ - name: 'module1', - id: 'testId1', - }, { - name: 'module2', - id: 'testId2', - }]; + const testModules = { + testId1: 'module1', + testId2: 'module2', + }; - expect(getModuleVersion(testModules, 'module2')).toBe(testModules[1].id); + expect(getModuleVersion(testModules, 'module2')).toBe('testId2'); expect(getModuleVersion(testModules, 'module3')).toBeUndefined(); }); });