Uploaded image for project: 'Red Hat Advanced Cluster Security'
  1. Red Hat Advanced Cluster Security
  2. ROX-33443

[Bug] Victory v37 onLegendClick not firing via getInteractiveLegendEvents

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • None
    • 3
    • False
    • Hide

      None

      Show
      None
    • False
    • Not Selected
    • Rox Sprint 4.11C

      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

              schaudhr Saif Chaudhry
              schaudhr Saif Chaudhry
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: