From 9e25ff4564291103120e04eac27cc77f7aa698ae Mon Sep 17 00:00:00 2001 From: mmelko Date: Wed, 24 Apr 2024 08:01:56 +0200 Subject: [PATCH] refactor(quartz,springboot): remove unnecessary React.Fragments --- .../src/plugins/quartz/triggers/Triggers.tsx | 1 - .../src/plugins/shared/JmxContentMBeans.tsx | 6 +- .../hawtio/src/plugins/springboot/Health.tsx | 100 +++++++++--------- .../hawtio/src/plugins/springboot/Info.tsx | 42 ++++---- 4 files changed, 73 insertions(+), 76 deletions(-) diff --git a/packages/hawtio/src/plugins/quartz/triggers/Triggers.tsx b/packages/hawtio/src/plugins/quartz/triggers/Triggers.tsx index 45493bf4..25639adc 100644 --- a/packages/hawtio/src/plugins/quartz/triggers/Triggers.tsx +++ b/packages/hawtio/src/plugins/quartz/triggers/Triggers.tsx @@ -175,7 +175,6 @@ export const Triggers: React.FunctionComponent = () => { return ( - {' '} {tableToolbar} diff --git a/packages/hawtio/src/plugins/shared/JmxContentMBeans.tsx b/packages/hawtio/src/plugins/shared/JmxContentMBeans.tsx index e3dda4b6..a034cd68 100644 --- a/packages/hawtio/src/plugins/shared/JmxContentMBeans.tsx +++ b/packages/hawtio/src/plugins/shared/JmxContentMBeans.tsx @@ -1,5 +1,5 @@ import { useContext } from 'react' -import { Card, CardBody, Text } from '@patternfly/react-core' +import { Card, CardBody, Panel, Text } from '@patternfly/react-core' import { InfoCircleIcon } from '@patternfly/react-icons' import { OnRowClick, Table, TableBody, TableHeader, TableProps } from '@patternfly/react-table' import { PluginNodeSelectionContext } from '@hawtiosrc/plugins/context' @@ -36,11 +36,11 @@ export const JmxContentMBeans: React.FunctionComponent = () => { } return ( - +
-
+
) } diff --git a/packages/hawtio/src/plugins/springboot/Health.tsx b/packages/hawtio/src/plugins/springboot/Health.tsx index 6abe53d4..74b1e8f8 100644 --- a/packages/hawtio/src/plugins/springboot/Health.tsx +++ b/packages/hawtio/src/plugins/springboot/Health.tsx @@ -87,56 +87,56 @@ export const Health: React.FunctionComponent = () => { }) }, []) + if (!healthData) { + return null + } + return ( - - {healthData && ( - - - - - - - - <span>Overall status: {healthData?.status}</span> - - - - - - {healthData?.components - .sort((a, b) => { - if (SPAN_6_COMPONENTS.includes(a.name)) return -1 - else if (SPAN_6_COMPONENTS.includes(b.name)) return 1 - else return a.name.localeCompare(b.name) - }) - .map(component => { - const span = SPAN_6_COMPONENTS.includes(component.name) ? 6 : 4 - return ( - - - - {humanizeLabels(component.name!)} - - - - - - - Status: {component.status} - {component.details && - (component.name === 'diskSpace' ? ( - - ) : ( - - ))} - - - - - ) - })} - - )} - + + + + + + + + <span>Overall status: {healthData?.status}</span> + + + + + + {healthData?.components + .sort((a, b) => { + if (SPAN_6_COMPONENTS.includes(a.name)) return -1 + else if (SPAN_6_COMPONENTS.includes(b.name)) return 1 + else return a.name.localeCompare(b.name) + }) + .map(component => { + const span = SPAN_6_COMPONENTS.includes(component.name) ? 6 : 4 + return ( + + + + {humanizeLabels(component.name!)} + + + + + + + Status: {component.status} + {component.details && + (component.name === 'diskSpace' ? ( + + ) : ( + + ))} + + + + + ) + })} + ) } diff --git a/packages/hawtio/src/plugins/springboot/Info.tsx b/packages/hawtio/src/plugins/springboot/Info.tsx index 3282fc1c..e2322a3c 100644 --- a/packages/hawtio/src/plugins/springboot/Info.tsx +++ b/packages/hawtio/src/plugins/springboot/Info.tsx @@ -13,27 +13,25 @@ export const Info: React.FunctionComponent = () => { }, []) return ( - - - - - - Property Name - Property Value - - - - {systemProperties.map((prop, index) => { - return ( - - {prop.key} - {prop.value} - - ) - })} - - - - + + + + + Property Name + Property Value + + + + {systemProperties.map((prop, index) => { + return ( + + {prop.key} + {prop.value} + + ) + })} + + + ) }