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

Unification: Wizard packages step bug #1468

Closed
lucasgarfield opened this issue Aug 3, 2022 · 1 comment
Closed

Unification: Wizard packages step bug #1468

lucasgarfield opened this issue Aug 3, 2022 · 1 comment

Comments

@lucasgarfield
Copy link
Collaborator

When adding packages, going to review page, then back to the packages step a user will see no packages added.

#1461 (comment)

lucasgarfield added a commit to lucasgarfield/cockpit-composer that referenced this issue Aug 10, 2022
Fixes osbuild#1468. The Packages step uses a useState() hook to manage the
state of the selected packages. The state is updated by a useEffect()
hook. The bug occured because the useEffect() hook loaded the package
list from the blueprint. However, the package list in the form state
will be different than the package list in the blueprint if the user
adds or removes packages. Therefore, the useEffect() hook now first
checks whether the form state has a "selected-packages" field. If it
does, then the form state's package list is used to set the selected
packages. If it does not (which is the case the first time the Packages
step is opened) the package list is loaded from the blueprint.
lucasgarfield added a commit to lucasgarfield/cockpit-composer that referenced this issue Aug 10, 2022
Fixes osbuild#1468. The Packages step uses a useState() hook to manage the
state of the selected packages. The state is updated by a useEffect()
hook. The bug occured because the useEffect() hook loaded the package
list from the blueprint. However, the package list in the form state
will be different than the package list in the blueprint if the user
adds or removes packages. Therefore, the useEffect() hook now first
checks whether the form state has a "selected-packages" field. If it
does, then the form state's package list is used to set the selected
packages. If it does not (which is the case the first time the Packages
step is opened) the package list is loaded from the blueprint.
lucasgarfield added a commit that referenced this issue Aug 10, 2022
Fixes #1468. The Packages step uses a useState() hook to manage the
state of the selected packages. The state is updated by a useEffect()
hook. The bug occured because the useEffect() hook loaded the package
list from the blueprint. However, the package list in the form state
will be different than the package list in the blueprint if the user
adds or removes packages. Therefore, the useEffect() hook now first
checks whether the form state has a "selected-packages" field. If it
does, then the form state's package list is used to set the selected
packages. If it does not (which is the case the first time the Packages
step is opened) the package list is loaded from the blueprint.
@lucasgarfield
Copy link
Collaborator Author

Resolved by #1489.

jkozol pushed a commit that referenced this issue Aug 11, 2022
Fixes #1468. The Packages step uses a useState() hook to manage the
state of the selected packages. The state is updated by a useEffect()
hook. The bug occured because the useEffect() hook loaded the package
list from the blueprint. However, the package list in the form state
will be different than the package list in the blueprint if the user
adds or removes packages. Therefore, the useEffect() hook now first
checks whether the form state has a "selected-packages" field. If it
does, then the form state's package list is used to set the selected
packages. If it does not (which is the case the first time the Packages
step is opened) the package list is loaded from the blueprint.
jkozol pushed a commit that referenced this issue Aug 15, 2022
Fixes #1468. The Packages step uses a useState() hook to manage the
state of the selected packages. The state is updated by a useEffect()
hook. The bug occured because the useEffect() hook loaded the package
list from the blueprint. However, the package list in the form state
will be different than the package list in the blueprint if the user
adds or removes packages. Therefore, the useEffect() hook now first
checks whether the form state has a "selected-packages" field. If it
does, then the form state's package list is used to set the selected
packages. If it does not (which is the case the first time the Packages
step is opened) the package list is loaded from the blueprint.
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

No branches or pull requests

1 participant