Skip to content

Commit

Permalink
UIIN-2600: Remove error message after switch from Instance Edit scree…
Browse files Browse the repository at this point in the history
…n to another app
  • Loading branch information
OleksandrHladchenko1 committed Oct 17, 2023
1 parent b308124 commit 045c878
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
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(
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(
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

0 comments on commit 045c878

Please sign in to comment.