Load instances improvements #1031
Draft
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.
📌 References
📝 Implementation
Dropdown: addedloading?property, whentrueit disables the control and shows a loading spinner.currentUsertoAppContext: this allows to avoid re-fetching via API the user in each instance of theInstanceSelectionDropdownandInstanceSelectionStep. This re-fetch not only caused the additional/merequest but also triggered other useEffects when the current user finished loading.loadingstate toInstanceSelectionStepand show a "Instances loading..." message instead of the MultiSelectorloadingstate toInstanceSelectionDropdownand pass it to theDropdownInstancesSelectorcomponent (from black border to material card-like)ManualSyncPage: prevent unnecessary re-renders caused byupdateSourceInstancecallback updating becausesyncRuledependency object instance changedTODO:
ManualSyncPage(check wdyr logs)GeneralInfoStep-> change name -> retriggers instances loadinginstances.list()can be an expensive operation (maybe creating anInstancesContextand reusing it throughout all components is enough)InstanceSelectionDropdown📹 Screenshots/Screen capture
InstancesSelector.webm
NewMetadataSyncRuleInstancesLoading.webm
🔥 Is there anything the reviewer should know to test it?