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

Convert UserEdit to functional #571

Merged

Conversation

mshriver
Copy link
Contributor

@mshriver mshriver commented Feb 17, 2025

Tested well locally, field aren't validated in master right now and that would be a good follow up.

Also this could just be a modal instead of a separate page and route, with the ID as a prop.

@mshriver mshriver added enhancement New feature or request frontend labels Feb 17, 2025
@mshriver mshriver force-pushed the useredit-convert-3334 branch from a03b0e0 to 179823e Compare February 17, 2025 14:28
@mshriver mshriver marked this pull request as draft February 17, 2025 14:28
@mshriver mshriver force-pushed the useredit-convert-3334 branch 4 times, most recently from f9a7fa6 to 8d53f2e Compare February 17, 2025 22:13
@mshriver mshriver marked this pull request as ready for review February 17, 2025 22:13
Change to FormSelect for Project selection
@mshriver mshriver force-pushed the useredit-convert-3334 branch from 8d53f2e to eb3c3aa Compare February 17, 2025 22:15
Copy link
Collaborator

@LightOfHeaven1994 LightOfHeaven1994 left a comment

Choose a reason for hiding this comment

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

Generally looks good, I left couple suggestions

this.setState({
filteredProjects: newSelectOptions,
});
if (!isProjectsOpen){
Copy link
Collaborator

Choose a reason for hiding this comment

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

We don't need to have it in useEffect as MenuToggle handles it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's what I thought too, and I removed it, but the behavior wasn't right.

This pattern actually comes from the PF5 react example for multiselect typeahead with chips:
https://v5-archive.patternfly.org/components/menus/select#multiple-typeahead-with-chips


render () {
const { projects, inputValue, filteredProjects, user, userProjects } = this.state;
}, [inputValue, projects, isProjectsOpen]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

isProjectsOpen can be removed from dependencies

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only if I remove forcing it open when there is an input value present. ;)

Copy link
Collaborator

Choose a reason for hiding this comment

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

@mshriver oh I see, some specifics because of typeahead, then ignore my comments

@mshriver mshriver merged commit 4335ae5 into ibutsu:feature-react-functional Feb 18, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants