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 (#2311)

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

* UIIN-2600: Use ternary

* Update CHANGELOG.md

(cherry picked from commit 3411d72)
  • Loading branch information
OleksandrHladchenko1 authored and mariia-aloshyna committed Nov 3, 2023
1 parent 2919471 commit 8582c5b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* Edit instance success toast no longer shows the instance HRID. Fixes UIIN-2588.
* 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.
* 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 @@ -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(() => {
Expand All @@ -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 (
<IfInterface name="consortia">
<Accordion
Expand Down
4 changes: 2 additions & 2 deletions src/edit/InstanceForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,15 +341,15 @@ class InstanceForm extends React.Component {
}),
) : [];

const statisticalCodeOptions = referenceTables.statisticalCodes
const statisticalCodeOptions = referenceTables.statisticalCodes ? referenceTables.statisticalCodes
.map(
code => ({
label: refLookup(referenceTables.statisticalCodeTypes, code.statisticalCodeTypeId).name + ': ' + code.code + ' - ' + code.name,
value: code.id,
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
Expand Down

0 comments on commit 8582c5b

Please sign in to comment.