Skip to content

Commit 7928cf5

Browse files
adjusting color and button behaviour
1 parent f6d14d0 commit 7928cf5

File tree

3 files changed

+30
-9
lines changed

3 files changed

+30
-9
lines changed

src/components/Graphs/CustomNode.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const CustomNode: React.FC<CustomNodeProps> = ({ label, type, status, transition
2828
positiveText={t('common.healthy')}
2929
negativeText={t('errors.notHealthy')}
3030
message={statusMessage}
31+
hideOnHoverEffect={true}
3132
/>
3233
</div>
3334
<div className={styles.nodeTextContainer}>

src/components/Graphs/graphUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const resolveProviderType = (configName: string, providerConfigsList: Pro
2626
};
2727

2828
export const generateColorMap = (items: NodeData[], colorBy: string): Record<string, string> => {
29-
const colors = ['#E09D00', '#E6600D', '#AB218E', '#678BC7', '#1A9898', '#759421', '#925ACE', '#647987'];
29+
const colors = ['#E09D00', '#e269c9', '#AB218E', '#678BC7', '#1A9898', '#759421', '#925ACE', '#647987'];
3030

3131
const keys = (() => {
3232
if (colorBy === 'source') return Array.from(new Set(items.map((i) => i.providerType).filter(Boolean)));

src/components/Shared/ResourceStatusCell.tsx

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ButtonDomRef, FlexBox, Icon, ResponsivePopover, Text } from '@ui5/webcomponents-react';
1+
import { Button, ButtonDomRef, FlexBox, Icon, ResponsivePopover, Text } from '@ui5/webcomponents-react';
22
import { formatDateAsTimeAgo } from '../../utils/i18n/timeAgo';
33
import { useRef, useState } from 'react';
44
import { AnimatedHoverTextButton } from '../Helper/AnimatedHoverTextButton.tsx';
@@ -10,13 +10,15 @@ export interface ResourceStatusCellProps {
1010
message?: string;
1111
positiveText: string;
1212
negativeText: string;
13+
hideOnHoverEffect?: boolean;
1314
}
1415
export const ResourceStatusCell = ({
1516
isOk,
1617
transitionTime,
1718
message,
1819
positiveText,
1920
negativeText,
21+
hideOnHoverEffect
2022
}: ResourceStatusCellProps) => {
2123
const btnRef = useRef<ButtonDomRef>(null);
2224
const [popoverIsOpen, setPopoverIsOpen] = useState(false);
@@ -29,19 +31,37 @@ export const ResourceStatusCell = ({
2931
};
3032
return (
3133
<span>
32-
<AnimatedHoverTextButton
33-
ref={btnRef}
34-
icon={
34+
{hideOnHoverEffect ? (
35+
<Button
36+
ref={btnRef}
37+
design="Transparent"
38+
onClick={handleOpen}
39+
title={transitionTime ? formatDateAsTimeAgo(transitionTime) : '-'}
40+
aria-label={transitionTime ? formatDateAsTimeAgo(transitionTime) : '-'}
41+
>
3542
<Icon
3643
design={isOk ? 'Positive' : 'Negative'}
3744
name={isOk ? 'sys-enter-2' : 'sys-cancel-2'}
3845
showTooltip={true}
3946
accessibleName={transitionTime ? formatDateAsTimeAgo(transitionTime) : '-'}
4047
/>
41-
}
42-
text={isOk ? positiveText : negativeText}
43-
onClick={handleOpen}
44-
/>
48+
</Button>
49+
) : (
50+
<AnimatedHoverTextButton
51+
ref={btnRef}
52+
icon={
53+
<Icon
54+
design={isOk ? 'Positive' : 'Negative'}
55+
name={isOk ? 'sys-enter-2' : 'sys-cancel-2'}
56+
showTooltip={true}
57+
accessibleName={transitionTime ? formatDateAsTimeAgo(transitionTime) : '-'}
58+
/>
59+
}
60+
text={isOk ? positiveText : negativeText}
61+
onClick={handleOpen}
62+
/>
63+
)}
64+
4565
<ResponsivePopover
4666
opener={btnRef.current ?? undefined}
4767
open={popoverIsOpen}

0 commit comments

Comments
 (0)