Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIIN-2600: Remove error message after switch from Instance Edit screen to another app #2311

Merged
merged 7 commits into from
Oct 19, 2023
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
12 changes: 6 additions & 6 deletions src/edit/InstanceForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,31 +309,31 @@ class InstanceForm extends React.Component {
return ref || {};
};

const instanceTypeOptions = referenceTables.instanceTypes ? referenceTables.instanceTypes.map(
const instanceTypeOptions = referenceTables.instanceTypes ? referenceTables.instanceTypes?.map(
OleksandrHladchenko1 marked this conversation as resolved.
Show resolved Hide resolved
it => ({
label: it.name,
value: it.id,
selected: it.id === initialValues.instanceTypeId,
}),
) : [];

const instanceNoteTypeOptions = referenceTables.instanceNoteTypes ? referenceTables.instanceNoteTypes.map(
const instanceNoteTypeOptions = referenceTables.instanceNoteTypes ? referenceTables.instanceNoteTypes?.map(
it => ({
label: it.name,
value: it.id,
selected: it.id === initialValues.instanceTypeId,
}),
) : [];

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,
selected: it.id === initialValues.instanceFormatId,
}),
) : [];

const modeOfIssuanceOptions = referenceTables.modesOfIssuance ? referenceTables.modesOfIssuance.map(
const modeOfIssuanceOptions = referenceTables.modesOfIssuance ? referenceTables.modesOfIssuance?.map(
it => ({
label: it.name,
value: it.id,
Expand All @@ -342,7 +342,7 @@ class InstanceForm extends React.Component {
) : [];

const statisticalCodeOptions = referenceTables.statisticalCodes
.map(
?.map(
OleksandrHladchenko1 marked this conversation as resolved.
Show resolved Hide resolved
code => ({
label: refLookup(referenceTables.statisticalCodeTypes, code.statisticalCodeTypeId).name + ': ' + code.code + ' - ' + code.name,
value: code.id,
Expand All @@ -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,
}));
Expand Down
Loading