Brijesh619 commented on code in PR #703: URL: https://github.com/apache/atlas/pull/703#discussion_r3860319684
##########
dashboard/src/views/Statistics/EntityStatsChart.tsx:
##########
@@ -87,21 +98,24 @@ const EntityStatsChart = ({
cursor={{ stroke: "rgba(0, 0, 0, 0.1)",
strokeWidth: 2 }}
/>
<Legend
- onClick={(e) => {
- if (e && e.id) {
-
onLegendClick(String(e.id));
- }
- }}
-
payload={Object.keys(activeKeys).map((key) => ({
- id: key,
- type: "square",
- value: key,
- color:
- activeKeys[key as keyof
ActiveKeys] === true
- ?
getColorForKey(key)
- : "#d3d3d3",
- inactive: !activeKeys[key as
keyof ActiveKeys],
- }))}
+ content={() => (
+ <Stack direction="row"
spacing={2} justifyContent="center" mt={1}>
+
{legendPayload.map((entry) => (
+ <ButtonBase
+
key={entry.id}
+
data-testid={`legend-${entry.id}`}
+
onClick={() => onLegendClick(String(entry.value))}
+
aria-label={String(entry.value)}
+
className="legend-button"
+ >
+ <Box
className="legend-color-box" style={{ backgroundColor: entry.color }} />
+
<Typography variant="body2" className={`legend-typography ${entry.inactive ?
'legend-inactive' : 'legend-active'}`}>
Review Comment:
Done. I've updated the template literal to use double quotes for consistency.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
