From 3170c56251dad467d73f7df8a5e715d2733b3494 Mon Sep 17 00:00:00 2001 From: Oleksandr Hladchenko <85172747+OleksandrHladchenko1@users.noreply.github.com> Date: Tue, 14 Nov 2023 16:45:21 +0200 Subject: [PATCH] UIIN-2689: Replace Promise.all with Promise.allSettled (#2348) --- CHANGELOG.md | 1 + src/utils.js | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 693bb9ec2..e871081a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ * Show Instance record after creating with Fast add option. Refs UIIN-2497. * Search box/Browse box- Reset all should shift focus back to search box. Refs UIIN-2514. * Updated translations for adding new Instance records. Refs UIIN-2630. +* Inactive Holdings/items on Central tenant when user have affiliation for separate Member with 0 permissions. Fixes UIIN-2689. ## [10.0.4](https://github.com/folio-org/ui-inventory/tree/v10.0.4) (2023-11-10) [Full Changelog](https://github.com/folio-org/ui-inventory/compare/v10.0.3...v10.0.4) diff --git a/src/utils.js b/src/utils.js index 30eba4b9b..4a6dcb200 100644 --- a/src/utils.js +++ b/src/utils.js @@ -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: { @@ -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 = []) => {