diff --git a/CHANGELOG.md b/CHANGELOG.md index 047214f03..906408003 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change history for ui-inventory +## 10.0.1 IN PROGRESS + +* 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 d3623b753..9c75e76c6 100644 --- a/src/Instance/InstanceDetails/ConsortialHoldings/ConsortialHoldings.js +++ b/src/Instance/InstanceDetails/ConsortialHoldings/ConsortialHoldings.js @@ -21,6 +21,8 @@ const ConsortialHoldings = ({ instance }) => { const { tenants } = useSearchForShadowInstanceTenants({ instanceId: instance?.id }); + if (!consortiaTenantsById) return null; + const memberTenants = tenants .map(tenant => consortiaTenantsById[tenant.id]) .filter(tenant => !tenant?.isCentral && (tenant?.id !== stripes.okapi.tenant)) diff --git a/src/edit/InstanceForm.js b/src/edit/InstanceForm.js index 7556f02c3..ac1407e15 100644 --- a/src/edit/InstanceForm.js +++ b/src/edit/InstanceForm.js @@ -309,7 +309,7 @@ class InstanceForm extends React.Component { return ref || {}; }; - const instanceTypeOptions = referenceTables.instanceTypes ? referenceTables.instanceTypes.map( + const instanceTypeOptions = referenceTables.instanceTypes ? referenceTables.instanceTypes?.map( it => ({ label: it.name, value: it.id, @@ -317,7 +317,7 @@ class InstanceForm extends React.Component { }), ) : []; - const instanceNoteTypeOptions = referenceTables.instanceNoteTypes ? referenceTables.instanceNoteTypes.map( + const instanceNoteTypeOptions = referenceTables.instanceNoteTypes ? referenceTables.instanceNoteTypes?.map( it => ({ label: it.name, value: it.id, @@ -325,7 +325,7 @@ class InstanceForm extends React.Component { }), ) : []; - const instanceStatusOptions = referenceTables.instanceStatuses ? referenceTables.instanceStatuses.map( + const instanceStatusOptions = referenceTables.instanceStatuses ? referenceTables.instanceStatuses?.map( it => ({ label: `${it.name} (${it.source}: ${it.code})`, value: it.id, @@ -333,7 +333,7 @@ class InstanceForm extends React.Component { }), ) : []; - const modeOfIssuanceOptions = referenceTables.modesOfIssuance ? referenceTables.modesOfIssuance.map( + const modeOfIssuanceOptions = referenceTables.modesOfIssuance ? referenceTables.modesOfIssuance?.map( it => ({ label: it.name, value: it.id, @@ -342,7 +342,7 @@ class InstanceForm extends React.Component { ) : []; const statisticalCodeOptions = referenceTables.statisticalCodes - .map( + ?.map( code => ({ label: refLookup(referenceTables.statisticalCodeTypes, code.statisticalCodeTypeId).name + ': ' + code.code + ' - ' + code.name, value: code.id, @@ -355,7 +355,7 @@ class InstanceForm extends React.Component { // we don't want the type selection box for parent/child to include the preceding-succeeding type const rTypes = referenceTables.instanceRelationshipTypes; const mostParentChildRelationships = filter(rTypes, rt => rt.id !== psTitleRelationshipId(rTypes)); - const relationshipTypes = mostParentChildRelationships.map(it => ({ + const relationshipTypes = mostParentChildRelationships?.map(it => ({ label: it.name, value: it.id, }));