Brijesh619 commented on code in PR #703:
URL: https://github.com/apache/atlas/pull/703#discussion_r3844860666


##########
dashboard/src/views/DashboardOverview/ClassificationDistributionCard.tsx:
##########
@@ -44,6 +44,9 @@ import {
 } from "./dashboardChartPalette";
 

Review Comment:
   1. Re: Bar onClick payload extraction
   
   Resolved. I replaced the unsafe casting with a strongly typed 
RechartsEventPayload interface. The handleBarClick function now safely extracts 
barProps?.payload?.name and explicitly guards against an empty/undefined name 
before triggering navigation.
   
   2. Re: Unit tests for pie click and tooltip
   
   Done. I created a new dedicated test file 
__tests__/EntityStatusDonut.test.tsx. It provides comprehensive coverage for 
the pie slice click navigation across all statuses (Active, Deleted, Shell), as 
well as formatting and edge-case rendering for the tooltip.
   
   3. Re: Legend items keyboard accessibility
   
   Resolved. I addressed the accessibility requirement, but took it a step 
further for better reliability. Instead of manually hacking role="button", 
tabIndex={0}, and custom onKeyDown handlers onto a Stack (which can be flaky 
for screen readers), I refactored the legend to use MUI's semantic 
<ButtonBase>. This inherently provides native Enter/Space keyboard support and 
correct ARIA roles out of the box.
   
   4. Re: Extracting inline style constants
   
   Addressed. Initially, I moved these constants to dashboardChartPalette.ts. 
However, to comply with the project's strict SCSS rules (which forbid inline 
sx={{}} and style={{}} objects), I ultimately removed them entirely. They have 
been fully converted into SCSS classes (e.g., .chart-cursor-pointer, 
.chart-label-list) in stats.scss.
   
   
   5. Re: Obsolete legend tests
   
   Updated. The obsolete "null event" tests in EntityStats.test.tsx have been 
completely removed. They were replaced with functional integration tests that 
directly click on legend-Deleted and legend-Shell and assert that the 
corresponding chart <Area> components are properly toggled in and out of the 
document.
   
   



-- 
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]

Reply via email to