-
Notifications
You must be signed in to change notification settings - Fork 149
Add ask RH help panel link #3138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's GuideThis PR introduces a new feature-flagged “Ask Red Hat” link in the global header tools, enhances toolbar dropdown items to support icons, and adds the corresponding i18n message entry. Class diagram for ToolbarToggleDropdownItem enhancementclassDiagram
class ToolbarToggleDropdownItem {
+string title
+string? url
+string? appId
+string? target
+string? rel
+function? onClick
+boolean? isHidden
+boolean? isDisabled
+React.ReactNode? icon
}
Class diagram for Tools component update with Ask Red Hat linkclassDiagram
class Tools {
+useFlag(flag: string): boolean
+user
+token
+dropdownItems
}
Tools --> ToolbarToggleDropdownItem : uses
ToolbarToggleDropdownItem <|-- AskRedHatDropdownItem
class AskRedHatDropdownItem {
+title = messages.askRedHat
+icon = ask-redhat-icon.svg
+onClick = open Red Hat support page
+isHidden = askRedHatEnabled
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @apinkert - I've reviewed your changes - here's some feedback:
- The
isHidden
prop is currently usingaskRedHatEnabled
directly, which will hide the link when the flag is true—flip it to!askRedHatEnabled
so the link appears only when the feature flag is enabled. - Include an
alt
attribute on the<img>
icon for accessibility (e.g. alt="Ask Red Hat icon").
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `isHidden` prop is currently using `askRedHatEnabled` directly, which will hide the link when the flag is true—flip it to `!askRedHatEnabled` so the link appears only when the feature flag is enabled.
- Include an `alt` attribute on the `<img>` icon for accessibility (e.g. alt="Ask Red Hat icon").
## Individual Comments
### Comment 1
<location> `src/components/Header/Tools.tsx:195` </location>
<code_context>
+ title: intl.formatMessage(messages.askRedHat),
+ icon: <img className="pf-v6-c-button__icon" src="/apps/frontend-assets/ask-redhat/ask-redhat-icon.svg" />,
+ onClick: () => window.open('https://access.redhat.com/ask', '_blank'),
+ isHidden: askRedHatEnabled,
+ },
{
</code_context>
<issue_to_address>
The logic for isHidden may be inverted.
The item is hidden when askRedHatEnabled is true. If it should be visible when enabled, use '!askRedHatEnabled' instead. Please confirm the intended logic.
</issue_to_address>
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! Just one small adjustment and we are golden
src/components/Header/Tools.tsx
Outdated
@@ -187,6 +188,12 @@ const Tools = () => { | |||
}, | |||
] | |||
: [ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also be enabled if Help panel is enabled. We should move it and show/hide it similarly as to how enableGlobalLearningResourcesPage
is used.
@karelhala is this the correct dropdown logic for |
/retest |
For RHCLOUD-40983. Unleash flags have been created on stage and prod.
Summary by Sourcery
Add an Ask Red Hat help link to the global header tools behind a feature flag and enhance the toolbar toggle to support icons in dropdown items.
New Features:
platform.chrome.ask-redhat-help
Enhancements:
ToolbarToggleDropdownItem
to accept and render an optional icon in toolbar dropdown itemsDocumentation: