diff --git a/CHANGELOG.md b/CHANGELOG.md index 47d8adcf8..1b933a6f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ * Show facet options, if they exist, after clicking the +More button. Refs UIIN-2533. * If Shared & Held by facets were selected in the Browse search, then retain them in the Search lookup after clicking the record. Refs UIIN-2608. * Instance. Series heading has vanished in detailed view. Fixes UIIN-2601. +* Remove error message after switch from Instance Edit screen to another app. Fixes UIIN-2600. ## [10.0.0](https://github.com/folio-org/ui-inventory/tree/v10.0.0) (2023-10-13) [Full Changelog](https://github.com/folio-org/ui-inventory/compare/v9.4.12...v10.0.0) diff --git a/src/Instance/InstanceDetails/ConsortialHoldings/ConsortialHoldings.js b/src/Instance/InstanceDetails/ConsortialHoldings/ConsortialHoldings.js index aae864206..e2a220c2d 100644 --- a/src/Instance/InstanceDetails/ConsortialHoldings/ConsortialHoldings.js +++ b/src/Instance/InstanceDetails/ConsortialHoldings/ConsortialHoldings.js @@ -23,20 +23,13 @@ import { } from '../../../hooks'; const ConsortialHoldings = ({ instance }) => { + const pathToAccordion = ['consortialHoldings', '_state']; const instanceId = instance?.id; - const prevInstanceId = useRef(instanceId); const stripes = useStripes(); + const prevInstanceId = useRef(instanceId); const { consortiaTenantsById } = useContext(DataContext); - const { tenants } = useSearchForShadowInstanceTenants({ instanceId }); - - const memberTenants = tenants - .map(tenant => consortiaTenantsById[tenant.id]) - .filter(tenant => !tenant?.isCentral && (tenant?.id !== stripes.okapi.tenant)) - .sort((a, b) => a.name.localeCompare(b.name)); - - const pathToAccordion = ['consortialHoldings', '_state']; const [isConsortialAccOpen, setConsortialAccOpen] = useHoldingsAccordionState({ instanceId, pathToAccordion }); useEffect(() => { @@ -46,6 +39,13 @@ const ConsortialHoldings = ({ instance }) => { } }, [instanceId]); + if (!consortiaTenantsById) return null; + + const memberTenants = tenants + .map(tenant => consortiaTenantsById[tenant.id]) + .filter(tenant => !tenant?.isCentral && (tenant?.id !== stripes.okapi.tenant)) + .sort((a, b) => a.name.localeCompare(b.name)); + return ( ({ label: refLookup(referenceTables.statisticalCodeTypes, code.statisticalCodeTypeId).name + ': ' + code.code + ' - ' + code.name, @@ -349,7 +349,7 @@ class InstanceForm extends React.Component { selected: code.id === initialValues.statisticalCodeId, }) ) - .sort((a, b) => a.label.localeCompare(b.label)); + .sort((a, b) => a.label.localeCompare(b.label)) : []; // Since preceding/succeeding title relationships are split out from other parent/child instances, // we don't want the type selection box for parent/child to include the preceding-succeeding type