-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 TypeaheadSelect #21183
base: main
Are you sure you want to change the base?
lib: Support headers with TypeaheadSelect #21183
Conversation
From 09b16829dcad32650412a66b7145ef8e7552c418.
Mostly indentation, and one TypeScript error.
49aa1be
to
866b34b
Compare
866b34b
to
5f5a440
Compare
onSelect={(_, value) => { | ||
this.setState({ value }); | ||
this.onPathChange(value); | ||
this.props.onChange(value || '', null); |
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 added line is not executed by any test.
}} | ||
onClearSelection={this.clearSelection} | ||
isCreatable={this.props.isOptionCreatable} | ||
createOptionMessage={val => cockpit.format(_("Create $0"), val)} |
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 added line is not executed by any test.
const defaultNoOptionsFoundMessage = (filter: string) => `No results found for "${filter}"`; | ||
const defaultCreateOptionMessage = (newValue: string) => `Create "${newValue}"`; |
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.
These 2 added lines are not executed by any test.
// Filter by search term | ||
const filtered = options.filter((o) => o.header || String(o.content).toLowerCase().includes(filterValue.toLowerCase())) | ||
// Remove headers that have nothing following them. | ||
return filtered.filter((o, i) => !(o.header && (i >= filtered.length - 1 || filtered[i + 1].header))); |
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 added line is not executed by any test.
!newSelectOptions.find((o) => String(o.content).toLowerCase() === filterValue.toLowerCase()) | ||
) { | ||
const createOption = { | ||
content: typeof createOptionMessage === 'string' ? createOptionMessage : createOptionMessage(filterValue), |
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 added line is not executed by any test.
isOpen={isOpen} | ||
selected={selected} | ||
onSelect={_onSelect} | ||
onOpenChange={(isOpen) => !isOpen && closeMenu()} |
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 added line is not executed by any test.
</Select> | ||
<TypeaheadSelect toggleProps={ { id: "systime-timezones" } } | ||
selected={time_zone} | ||
onSelect={(event, value) => { change("time_zone", value) }} |
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 added line is not executed by any test.
onSelect={(_, value) => { | ||
setValue(value); |
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.
These 2 added lines are not executed by any test.
createOptionMessage={val => cockpit.format(_("Use $0"), val)} | ||
selected={value} | ||
onSelect={(_, value) => change(value)} | ||
onClearSelection={() => change("")} |
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 added line is not executed by any test.
<TypeaheadSelect selectOptions={identifiersArray} | ||
selected={identifiersFilter} | ||
onSelect={(e, selection) => { onIdentifiersFilterChange(selection) }} | ||
onClearSelection={identifiersFilter != "all" && (() => { onIdentifiersFilterChange("all") })} |
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 added line is not executed by any test.
I have styled the headers arbitrarily like this: