Skip to content

Commit

Permalink
Release v10.0.6 (#2357)
Browse files Browse the repository at this point in the history
* UIIN-2689: Replace Promise.all with Promise.allSettled (#2348)

(cherry picked from commit 3170c56)

* UIIN-2695: "Something went wrong" error appears when user selects Shared Instance as "Child/Parent Instance" for Local Instance without permissions at Central tenant (#2356)

(cherry picked from commit 7979946)

* Release v10.0.6

---------

Co-authored-by: Oleksandr Hladchenko <[email protected]>
  • Loading branch information
mariia-aloshyna and OleksandrHladchenko1 authored Nov 24, 2023
1 parent 22da626 commit 007c899
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change history for ui-inventory

## [10.0.6](https://github.com/folio-org/ui-inventory/tree/v10.0.6) (2023-11-24)
[Full Changelog](https://github.com/folio-org/ui-inventory/compare/v10.0.5...v10.0.6)

* "Something went wrong" error appears when user selects Shared Instance as "Child/Parent Instance" for Local Instance without permissions at Central tenant. Fixes UIIN-2695.
* Inactive Holdings/items on Central tenant when user have affiliation for separate Member with 0 permissions. Fixes UIIN-2689.

## [10.0.5](https://github.com/folio-org/ui-inventory/tree/v10.0.5) (2023-11-22)
[Full Changelog](https://github.com/folio-org/ui-inventory/compare/v10.0.4...v10.0.5)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@folio/inventory",
"version": "10.0.5",
"version": "10.0.6",
"description": "Inventory manager",
"repository": "folio-org/ui-inventory",
"publishConfig": {
Expand Down
11 changes: 7 additions & 4 deletions src/Instance/InstanceEdit/InstanceField/InstanceField.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import PropTypes from 'prop-types';

import { FormattedMessage, useIntl } from 'react-intl';
import { Field } from 'react-final-form';
import { isEmpty } from 'lodash';

import {
KeyValue,
Expand Down Expand Up @@ -46,10 +47,12 @@ const InstanceField = ({
const publicationDate = publication?.[0]?.dateOfPublication;

const handleSelect = (inst) => {
update(index, {
...inst,
[titleIdKey]: inst.id,
});
if (!isEmpty(inst)) {
update(index, {
...inst,
[titleIdKey]: inst.id,
});
}
};

return (
Expand Down
6 changes: 4 additions & 2 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ export const isUserInConsortiumMode = stripes => stripes.hasInterface('consortia

export const isInstanceShadowCopy = (source) => [`${CONSORTIUM_PREFIX}FOLIO`, `${CONSORTIUM_PREFIX}MARC`].includes(source);

export const getUserTenantsPermissions = (stripes, tenants = []) => {
export const getUserTenantsPermissions = async (stripes, tenants = []) => {
const {
user: { user: { id } },
okapi: {
Expand All @@ -817,7 +817,9 @@ export const getUserTenantsPermissions = (stripes, tenants = []) => {
return { tenantId, ...json };
});

return Promise.all(promises);
const userTenantsPermissions = await Promise.allSettled(promises);

return userTenantsPermissions.map(userTenantsPermission => userTenantsPermission.value);
};

export const hasMemberTenantPermission = (permissionName, tenantId, permissions = []) => {
Expand Down

0 comments on commit 007c899

Please sign in to comment.