-
Story
-
Resolution: Unresolved
-
Undefined
-
None
-
None
-
None
Overview:
After the PF6 migration, Victory v37 (used by @patternfly/react-charts v8) no longer fires onLegendClick callbacks passed through getInteractiveLegendEvents. This breaks severity toggling in the "Violations by Policy Category" dashboard widget. The test for this behavior has been skipped with it.skip in the meantime.
Implementation Details:
- getInteractiveLegendEvents constructs Victory event objects that should call onLegendClick when a legend item is clicked
- In Victory v37, the event handler is never invoked – clicks on legend items have no effect
- This may be an upstream Victory/PF Charts bug that needs to be reported, or the API usage may need to change for v37 compatibility
- Previously the charts package was pinned to @patternfly/react-charts: 7.2.2 to avoid this, but that pin was removed during PF6 migration
Acceptance Criteria:
- [ ] Severity toggling works in the Violations by Policy Category widget when clicking legend items
- [ ] The skipped component test in ViolationsByPolicyCategory.cy.jsx is unskipped and passes
- [ ] No regressions in other chart widgets using getInteractiveLegendEvents
Files to Update:
1. ui/apps/platform/src/Containers/Dashboard/Widgets/ViolationsByPolicyCategoryChart.tsx - Fix or replace legend click handling
2. ui/apps/platform/src/Containers/Dashboard/Widgets/ViolationsByPolicyCategory.cy.jsx - Unskip the toggling test
Related:
- PR #19275 where the test was skipped