diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e40de54c..7772de443 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change history for ui-inventory +## [10.0.6](https://github.com/folio-org/ui-inventory/tree/v10.0.6) (2023-11-24) +[Full Changelog](https://github.com/folio-org/ui-inventory/compare/v10.0.5...v10.0.6) + +* "Something went wrong" error appears when user selects Shared Instance as "Child/Parent Instance" for Local Instance without permissions at Central tenant. Fixes UIIN-2695. +* Inactive Holdings/items on Central tenant when user have affiliation for separate Member with 0 permissions. Fixes UIIN-2689. + ## [10.0.5](https://github.com/folio-org/ui-inventory/tree/v10.0.5) (2023-11-22) [Full Changelog](https://github.com/folio-org/ui-inventory/compare/v10.0.4...v10.0.5) diff --git a/package.json b/package.json index 7e1e0d1d1..adda341be 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@folio/inventory", - "version": "10.0.5", + "version": "10.0.6", "description": "Inventory manager", "repository": "folio-org/ui-inventory", "publishConfig": { diff --git a/src/Instance/InstanceEdit/InstanceField/InstanceField.js b/src/Instance/InstanceEdit/InstanceField/InstanceField.js index dc8cdbfb9..38fdc6e4d 100644 --- a/src/Instance/InstanceEdit/InstanceField/InstanceField.js +++ b/src/Instance/InstanceEdit/InstanceField/InstanceField.js @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import { FormattedMessage, useIntl } from 'react-intl'; import { Field } from 'react-final-form'; +import { isEmpty } from 'lodash'; import { KeyValue, @@ -46,10 +47,12 @@ const InstanceField = ({ const publicationDate = publication?.[0]?.dateOfPublication; const handleSelect = (inst) => { - update(index, { - ...inst, - [titleIdKey]: inst.id, - }); + if (!isEmpty(inst)) { + update(index, { + ...inst, + [titleIdKey]: inst.id, + }); + } }; return ( diff --git a/src/utils.js b/src/utils.js index 30eba4b9b..4a6dcb200 100644 --- a/src/utils.js +++ b/src/utils.js @@ -792,7 +792,7 @@ export const isUserInConsortiumMode = stripes => stripes.hasInterface('consortia export const isInstanceShadowCopy = (source) => [`${CONSORTIUM_PREFIX}FOLIO`, `${CONSORTIUM_PREFIX}MARC`].includes(source); -export const getUserTenantsPermissions = (stripes, tenants = []) => { +export const getUserTenantsPermissions = async (stripes, tenants = []) => { const { user: { user: { id } }, okapi: { @@ -817,7 +817,9 @@ export const getUserTenantsPermissions = (stripes, tenants = []) => { return { tenantId, ...json }; }); - return Promise.all(promises); + const userTenantsPermissions = await Promise.allSettled(promises); + + return userTenantsPermissions.map(userTenantsPermission => userTenantsPermission.value); }; export const hasMemberTenantPermission = (permissionName, tenantId, permissions = []) => {