From f9f4ab80ebe6acc82483003857e0c9e1e3afa5ec Mon Sep 17 00:00:00 2001 From: chriskari Date: Tue, 9 Jul 2024 10:27:46 +0200 Subject: [PATCH 1/2] fix: remove empty space for empyt health section --- src/components/Extensibility/ExtensibilityDetails.js | 2 +- src/shared/components/ResourceDetails/ResourceDetails.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/Extensibility/ExtensibilityDetails.js b/src/components/Extensibility/ExtensibilityDetails.js index c3912908c8..073906297b 100644 --- a/src/components/Extensibility/ExtensibilityDetails.js +++ b/src/components/Extensibility/ExtensibilityDetails.js @@ -161,7 +161,7 @@ export const ExtensibilityDetailsCore = ({ : [] } customHealthCards={ - Array.isArray(health) + Array.isArray(health) && health?.length > 0 ? [ (resource, i) => ( ); - const customOverviewCard = (customHealthCards || []).map(healthCard => - healthCard(resource), - ); + const customOverviewCard = ( + customHealthCards || [] + ).map((healthCard, index) => healthCard(resource, index)); return ( From 2203add42e9dd9ec67f04a0a2f9405476428a38b Mon Sep 17 00:00:00 2001 From: chriskari Date: Tue, 9 Jul 2024 11:03:18 +0200 Subject: [PATCH 2/2] fix: remove console errors --- src/components/Extensibility/ExtensibilityInjections.js | 8 ++++++-- src/shared/ResourceForm/fields/MultiInput.js | 2 +- .../components/UnsavedMessageBox/UnsavedMessageBox.tsx | 8 ++++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/components/Extensibility/ExtensibilityInjections.js b/src/components/Extensibility/ExtensibilityInjections.js index db2a7d8125..962b678733 100644 --- a/src/components/Extensibility/ExtensibilityInjections.js +++ b/src/components/Extensibility/ExtensibilityInjections.js @@ -71,9 +71,13 @@ export const ExtensibilityInjectionCore = ({ resMetaData, root }) => { const ExtensibilityInjections = ({ destination, slot, root }) => { const injections = useGetInjections(destination, slot); let itemList = []; - (injections || []).forEach(injection => { + (injections || []).forEach((injection, index) => { itemList.push( - , + , ); }); return itemList; diff --git a/src/shared/ResourceForm/fields/MultiInput.js b/src/shared/ResourceForm/fields/MultiInput.js index a3ddf8d00b..f57291e20a 100644 --- a/src/shared/ResourceForm/fields/MultiInput.js +++ b/src/shared/ResourceForm/fields/MultiInput.js @@ -157,7 +157,7 @@ export function MultiInput({ tooltipContent={sectionTooltipContent || tooltipContent} {...props} > -
+
    {internalValue.map((entry, index) => { const fieldWidth = diff --git a/src/shared/components/UnsavedMessageBox/UnsavedMessageBox.tsx b/src/shared/components/UnsavedMessageBox/UnsavedMessageBox.tsx index 7cb2900482..c40d2985fc 100644 --- a/src/shared/components/UnsavedMessageBox/UnsavedMessageBox.tsx +++ b/src/shared/components/UnsavedMessageBox/UnsavedMessageBox.tsx @@ -58,8 +58,12 @@ export function UnsavedMessageBox({ isOpen }: UnsavedMessageBoxProps) { onClose={handleClose} titleText={t('common.headers.discard-changes')} actions={[ - , - , + , + , ]} > {t('common.messages.discard-changes-warning')}