Skip to content
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

lib: Support headers with SimpleSelect #21480

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mvollmer
Copy link
Member

@mvollmer mvollmer commented Jan 2, 2025

Needed to replace the deprecated select in cockpit-machines.

Comment on lines +139 to +143
<SelectOption key={option.key}
isDisabled
className="ct-select-header">
{option.content}
</SelectOption>
Copy link
Contributor

Choose a reason for hiding this comment

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

These 5 added lines are not executed by any test.

@mvollmer
Copy link
Member Author

mvollmer commented Jan 3, 2025

I start to think we should just use SelectOption et al with SimpleSelect instead of the extra indirection via the { value: "foo", content: _("Bar") } objects. Those objects make sense for typeahead, since they make generic filtering trivial. But SimpleSelect has no need to look into the options.

In my defense, I just went with the template offered by PatternFly without questioning it...

@mvollmer mvollmer requested a review from tomasmatus January 3, 2025 12:23
Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

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

Putting SelectOptions into selects and such sounds good, as long as it's consistent (wrt. TypeaheadSelect as well). I'll let you decide if you want to go ahead with this PR (it looks nice, and doesn't really make the situation worse) to unblock the c-machines porting, or clean this up with SelectOption.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants