From 7928cf5b73ccb278bb5d47063ac2d16403f97f23 Mon Sep 17 00:00:00 2001 From: Hubert Date: Fri, 22 Aug 2025 11:02:36 +0200 Subject: [PATCH 1/5] adjusting color and button behaviour --- src/components/Graphs/CustomNode.tsx | 1 + src/components/Graphs/graphUtils.ts | 2 +- src/components/Shared/ResourceStatusCell.tsx | 36 +++++++++++++++----- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/src/components/Graphs/CustomNode.tsx b/src/components/Graphs/CustomNode.tsx index de2296b5..c695bfb5 100644 --- a/src/components/Graphs/CustomNode.tsx +++ b/src/components/Graphs/CustomNode.tsx @@ -28,6 +28,7 @@ const CustomNode: React.FC = ({ label, type, status, transition positiveText={t('common.healthy')} negativeText={t('errors.notHealthy')} message={statusMessage} + hideOnHoverEffect={true} />
diff --git a/src/components/Graphs/graphUtils.ts b/src/components/Graphs/graphUtils.ts index 3c19b005..f08afb00 100644 --- a/src/components/Graphs/graphUtils.ts +++ b/src/components/Graphs/graphUtils.ts @@ -26,7 +26,7 @@ export const resolveProviderType = (configName: string, providerConfigsList: Pro }; export const generateColorMap = (items: NodeData[], colorBy: string): Record => { - const colors = ['#E09D00', '#E6600D', '#AB218E', '#678BC7', '#1A9898', '#759421', '#925ACE', '#647987']; + const colors = ['#E09D00', '#e269c9', '#AB218E', '#678BC7', '#1A9898', '#759421', '#925ACE', '#647987']; const keys = (() => { if (colorBy === 'source') return Array.from(new Set(items.map((i) => i.providerType).filter(Boolean))); diff --git a/src/components/Shared/ResourceStatusCell.tsx b/src/components/Shared/ResourceStatusCell.tsx index f14e6cee..cea3dac7 100644 --- a/src/components/Shared/ResourceStatusCell.tsx +++ b/src/components/Shared/ResourceStatusCell.tsx @@ -1,4 +1,4 @@ -import { ButtonDomRef, FlexBox, Icon, ResponsivePopover, Text } from '@ui5/webcomponents-react'; +import { Button, ButtonDomRef, FlexBox, Icon, ResponsivePopover, Text } from '@ui5/webcomponents-react'; import { formatDateAsTimeAgo } from '../../utils/i18n/timeAgo'; import { useRef, useState } from 'react'; import { AnimatedHoverTextButton } from '../Helper/AnimatedHoverTextButton.tsx'; @@ -10,6 +10,7 @@ export interface ResourceStatusCellProps { message?: string; positiveText: string; negativeText: string; + hideOnHoverEffect?: boolean; } export const ResourceStatusCell = ({ isOk, @@ -17,6 +18,7 @@ export const ResourceStatusCell = ({ message, positiveText, negativeText, + hideOnHoverEffect }: ResourceStatusCellProps) => { const btnRef = useRef(null); const [popoverIsOpen, setPopoverIsOpen] = useState(false); @@ -29,19 +31,37 @@ export const ResourceStatusCell = ({ }; return ( - - } - text={isOk ? positiveText : negativeText} - onClick={handleOpen} - /> + + ) : ( + + } + text={isOk ? positiveText : negativeText} + onClick={handleOpen} + /> + )} + Date: Fri, 22 Aug 2025 13:39:47 +0200 Subject: [PATCH 2/5] creating prop for transitionTime --- src/components/Shared/ResourceStatusCell.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/Shared/ResourceStatusCell.tsx b/src/components/Shared/ResourceStatusCell.tsx index cea3dac7..b856fece 100644 --- a/src/components/Shared/ResourceStatusCell.tsx +++ b/src/components/Shared/ResourceStatusCell.tsx @@ -22,6 +22,7 @@ export const ResourceStatusCell = ({ }: ResourceStatusCellProps) => { const btnRef = useRef(null); const [popoverIsOpen, setPopoverIsOpen] = useState(false); + const timeAgo = transitionTime ? formatDateAsTimeAgo(transitionTime) : '-'; const handleClose = () => { setPopoverIsOpen(false); @@ -36,14 +37,14 @@ export const ResourceStatusCell = ({ ref={btnRef} design="Transparent" onClick={handleOpen} - title={transitionTime ? formatDateAsTimeAgo(transitionTime) : '-'} - aria-label={transitionTime ? formatDateAsTimeAgo(transitionTime) : '-'} + title={timeAgo} + aria-label={timeAgo} > ) : ( @@ -54,7 +55,7 @@ export const ResourceStatusCell = ({ design={isOk ? 'Positive' : 'Negative'} name={isOk ? 'sys-enter-2' : 'sys-cancel-2'} showTooltip={true} - accessibleName={transitionTime ? formatDateAsTimeAgo(transitionTime) : '-'} + accessibleName={timeAgo} /> } text={isOk ? positiveText : negativeText} @@ -84,7 +85,7 @@ export const ResourceStatusCell = ({ color: isOk ? 'var(--sapPositiveTextColor)' : 'var(--sapNegativeTextColor)', }} > - {formatDateAsTimeAgo(transitionTime)} + {timeAgo} From 8c6d3c9e89db8b34a82fd46904f255d62250bc02 Mon Sep 17 00:00:00 2001 From: Hubert Date: Fri, 22 Aug 2025 13:40:32 +0200 Subject: [PATCH 3/5] linting --- src/components/Shared/ResourceStatusCell.tsx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/components/Shared/ResourceStatusCell.tsx b/src/components/Shared/ResourceStatusCell.tsx index b856fece..fd78b91b 100644 --- a/src/components/Shared/ResourceStatusCell.tsx +++ b/src/components/Shared/ResourceStatusCell.tsx @@ -18,7 +18,7 @@ export const ResourceStatusCell = ({ message, positiveText, negativeText, - hideOnHoverEffect + hideOnHoverEffect, }: ResourceStatusCellProps) => { const btnRef = useRef(null); const [popoverIsOpen, setPopoverIsOpen] = useState(false); @@ -33,13 +33,7 @@ export const ResourceStatusCell = ({ return ( {hideOnHoverEffect ? ( -