From 0fa4ea31e296a6e5cb72e617921331d89ab0a520 Mon Sep 17 00:00:00 2001 From: Ryan Berger Date: Thu, 18 Jul 2024 12:10:19 -0400 Subject: [PATCH] Sonar fixes --- src/discoverServices.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/discoverServices.js b/src/discoverServices.js index cf17653bc..0da05c8a9 100644 --- a/src/discoverServices.js +++ b/src/discoverServices.js @@ -45,15 +45,15 @@ function parseApplicationDescriptor(store, descriptor) { ); if (descriptor.moduleDescriptors) { - list.push(...descriptor.moduleDescriptors?.map((i) => dispatchDescriptor(i))); + list.push(...descriptor.moduleDescriptors.map((i) => dispatchDescriptor(i))); } if (descriptor.uiModuleDescriptors) { - list.push(...descriptor.uiModuleDescriptors?.map((i) => dispatchDescriptor(i))); + list.push(...descriptor.uiModuleDescriptors.map((i) => dispatchDescriptor(i))); } if (descriptor.uiModules) { - list.push(...descriptor.uiModules?.map((i) => dispatchDescriptor(i))); + list.push(...descriptor.uiModules.map((i) => dispatchDescriptor(i))); } list.push(dispatchApplication(descriptor)); @@ -297,10 +297,7 @@ export function discoveryReducer(state = {}, action) { for (const entry of action.data.permissionSets || []) { permissions[entry.permissionName] = entry.displayName; } - return Object.assign({}, state, { - permissionDisplayNames: state.permissionDisplayNames ? - Object.assign({}, state.permissionDisplayNames, permissions) : permissions, - }); + return { permissionDisplayNames: { ...state.permissionDisplayNames, ...permissions } }; } case 'DISCOVERY_PROVIDERS': { if (action.data.provides?.length > 0) {