Skip to content

SAT-37810 - Update Total risks card dropdown for PF5#1087

Merged
jeremylenz merged 1 commit intotheforeman:developfrom
lfu:37810_pf5_total_risks
Sep 12, 2025
Merged

SAT-37810 - Update Total risks card dropdown for PF5#1087
jeremylenz merged 1 commit intotheforeman:developfrom
lfu:37810_pf5_total_risks

Conversation

@lfu
Copy link
Collaborator

@lfu lfu commented Sep 8, 2025

What are the changes introduced in this pull request?

Depends on theforeman/foreman#10685

total-risk

Considerations taken when implementing this change?

What are the testing steps for this pull request?

Summary by Sourcery

Migrate the Total Risks card dropdown in the host insights details tab to use PatternFly 5 components and styles, update its menu options and behavior for risk filtering

Enhancements:

  • Migrate the dropdown in InsightsTotalRiskChart to PatternFly 5’s Dropdown component
  • Update dropdown menu items and event handlers for selecting risk filters
  • Adjust CSS classes and layout to match PF5 styling guidelines

Tests:

  • Add tests for dropdown filter selection in the Total Risks chart

@sourcery-ai
Copy link

sourcery-ai bot commented Sep 8, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Refactors the total risks dropdown in InsightsTotalRiskChart to use PatternFly 5 components, updating imports, markup, styling, and event handling to align with the new library API.

File-Level Changes

Change Details Files
Swap PF4 Dropdown for PF5 menu components
  • Import Menu, MenuToggle, MenuList, and MenuItem from PF5
  • Replace DropdownToggle and DropdownItem implementations
  • Update state hook for menu open/close handling
webpack/InsightsHostDetailsTab/InsightsTotalRiskChart.js
Adjust styling and class names to PF5 conventions
  • Remove legacy pf-c-dropdown modifiers
  • Add appropriate pf-c-menu and pf-c-list classes
  • Update CSS tokens and spacing variables
webpack/InsightsHostDetailsTab/InsightsTotalRiskChart.js
Update selection event handling
  • Switch from onSelect to onClick handlers on menu items
  • Ensure selected value state updates correctly
  • Trigger callback with new risk filter value
webpack/InsightsHostDetailsTab/InsightsTotalRiskChart.js

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Member

@chris1984 chris1984 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, tests need looked at:

Screenshot 2025-09-08 at 15-28-17 ip-10-0-167-243 rhos-01 prod psi rdu2 redhat com

Copy link
Member

@chris1984 chris1984 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lfu looks like it needs some spacing, here is content view environment and how it should look:
Screenshot 2025-09-08 at 16-18-21 ip-10-0-167-243 rhos-01 prod psi rdu2 redhat com

@lfu lfu force-pushed the 37810_pf5_total_risks branch 3 times, most recently from 50f68c0 to ac673d3 Compare September 9, 2025 20:25
@lfu lfu force-pushed the 37810_pf5_total_risks branch from ac673d3 to 35f8cf6 Compare September 9, 2025 20:55
@lfu
Copy link
Collaborator Author

lfu commented Sep 9, 2025

@MariaAga What do you think about this patch? Is there a way to fix it without manual CSS changes?

@MariaAga
Copy link
Member

MariaAga commented Sep 9, 2025

@lfu is this tested with the foreman fix for card template?

@lfu
Copy link
Collaborator Author

lfu commented Sep 9, 2025

@MariaAga Not sure what fix you referred to. But I'm running the latest Foreman code.

@MariaAga
Copy link
Member

MariaAga commented Sep 9, 2025

My bad I thought it was done but it was a similar fix in theforeman/foreman#10650
You need to update CardTemplate dropdown as well as the plugin one (so for this its rh_cloud and remote_execution)
/webpack/assets/javascripts/react_app/components/HostDetails/Templates/CardItem/CardTemplate/index.js
Its described here: https://issues.redhat.com/browse/SAT-37676 (I'll link the issues)

@lfu lfu force-pushed the 37810_pf5_total_risks branch 2 times, most recently from 0834f7c to b0d2f3c Compare September 11, 2025 14:45
@lfu lfu force-pushed the 37810_pf5_total_risks branch 2 times, most recently from 0fdbae3 to 3038148 Compare September 11, 2025 17:16
@lfu lfu force-pushed the 37810_pf5_total_risks branch from 3038148 to 387affe Compare September 12, 2025 14:34
@lfu lfu force-pushed the 37810_pf5_total_risks branch from 387affe to 74bae62 Compare September 12, 2025 14:47
Copy link
Collaborator

@jeremylenz jeremylenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks all! ACK 👍

@jeremylenz jeremylenz merged commit 0fd9fa1 into theforeman:develop Sep 12, 2025
24 checks passed
@lfu
Copy link
Collaborator Author

lfu commented Sep 12, 2025

Foreman PR is not merged yet.

chris1984 pushed a commit to chris1984/foreman_rh_cloud that referenced this pull request Sep 15, 2025
chris1984 pushed a commit that referenced this pull request Sep 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants