[MTV-1967] Create plan wizard state is not set correctly when re-selecting a source provider #1447
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📝 Links
📝 Description
When using the create migration plan wizard, selecting a provider, then de-selecting and selecting another (could be the same), source storage and network mappings were being set to empty arrays and therefore disallowing users from selecting mappings on step 2 of the wizard.
This change addresses this, limits the initialization of state to the initial call of the
useFetchEffects
hook (which prevents the resetting of plan name validation), and also addresses other unnecessary re-rending within theuseFetchEffects
hook, which could use some refactoring still, as the amount of useEffects there leads to that hook being unreadable and one can easily get lost as to which effect they're looking at or even what this generically called hook's purpose is.🎥 Demo
Screen.Recording.2025-01-30.at.11.08.43.AM.mov