-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add global state to VM create with IT #1284
Add global state to VM create with IT #1284
Conversation
src/utils/components/SSHSecretSection/utils/components/SecretDropdown/SecretDropdown.tsx
Show resolved
Hide resolved
27c46da
to
96cfb2b
Compare
src/utils/components/SSHSecretSection/components/SecretDropdown/SecretDropdown.tsx
Outdated
Show resolved
Hide resolved
src/utils/components/SSHSecretSection/components/SecretDropdown/SecretDropdown.tsx
Show resolved
Hide resolved
src/utils/components/SSHSecretSection/components/SSHKeyUpload/SSHKeyUpload.tsx
Outdated
Show resolved
Hide resolved
src/views/catalog/CreateFromInstanceTypes/CreateFromInstanceType.tsx
Outdated
Show resolved
Hide resolved
src/views/catalog/CreateFromInstanceTypes/CreateFromInstanceType.tsx
Outdated
Show resolved
Hide resolved
ed2bc48
to
89e4a66
Compare
104aa7b
to
351ffb1
Compare
src/views/catalog/CreateFromInstanceTypes/CreateFromInstanceType.tsx
Outdated
Show resolved
Hide resolved
src/views/catalog/CreateFromInstanceTypes/CreateFromInstanceType.tsx
Outdated
Show resolved
Hide resolved
...talog/CreateFromInstanceTypes/components/AddBootableVolumeButton/AddBootableVolumeButton.tsx
Outdated
Show resolved
Hide resolved
...components/BootableVolumeList/components/BootableVolumeListModal/BootableVolumeListModal.tsx
Outdated
Show resolved
Hide resolved
.../BootableVolumeList/components/ShowAllBootableVolumesButton/ShowAllBootableVolumesButton.tsx
Outdated
Show resolved
Hide resolved
src/views/catalog/CreateFromInstanceTypes/components/CreateVMFooter/CreateVMFooter.tsx
Outdated
Show resolved
Hide resolved
...nceTypes/components/VMDetailsSection/components/VMDetailsBody/components/DetailsLeftGrid.tsx
Outdated
Show resolved
Hide resolved
src/views/catalog/CreateFromInstanceTypes/state/hooks/useInstanceTypeVMInitialStore.ts
Outdated
Show resolved
Hide resolved
src/views/catalog/CreateFromInstanceTypes/state/hooks/useInstanceTypeVMInitialStore.ts
Outdated
Show resolved
Hide resolved
3b71807
to
d0c84cc
Compare
d0c84cc
to
43c064a
Compare
@avivtur Was adding another dependency necessary? What are the benefits of |
Hi @hstastna Thank you for looking :)
as written in the description, I wanted to centralize the state in one place, and avoid prop drilling (components sending props on to child just in the name of passing them as props as well). |
43c064a
to
5eb9350
Compare
Another big advantage is that it acts similarly to context, with the option to use multi-store and not central one-big-store, which is similar behavior as context. |
Thanks, guys, for the wider explanation, that's what I was looking for! 👍🏽 |
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 is a great improvement! It makes things so much cleaner. I only have very minor comments.
src/utils/components/SSHSecretSection/components/SecretDropdown/SecretDropdown.tsx
Outdated
Show resolved
Hide resolved
src/views/catalog/CreateFromInstanceTypes/components/BootableVolumeList/BootableVolumeList.tsx
Show resolved
Hide resolved
src/views/catalog/CreateFromInstanceTypes/components/BootableVolumeList/BootableVolumeList.tsx
Show resolved
Hide resolved
src/views/catalog/CreateFromInstanceTypes/components/BootableVolumeList/BootableVolumeList.tsx
Outdated
Show resolved
Hide resolved
src/views/catalog/CreateFromInstanceTypes/components/CreateVMFooter/CreateVMFooter.tsx
Outdated
Show resolved
Hide resolved
src/views/catalog/CreateFromInstanceTypes/state/useInstanceTypeVMStore.ts
Show resolved
Hide resolved
Signed-off-by: Aviv Turgeman <aturgema@redhat.com>
5eb9350
to
a8021b3
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: avivtur, pcbailey The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
📝 Description
Change Create VM from instance type flow to have a global state to avoid prop drilling and get a more maintainable code.
changes included in this PR:
zustand
- 3rd party lib for state management.🎥 Demo