migtools / crane-ui-plugin

OpenShift Dynamic Plugin for Crane UI
1 stars 11 forks source link

Select all PVCs by default, warn if proceeding with no PVCs selected (when PVCs are present) #65

Closed mturley closed 2 years ago

mturley commented 2 years ago

Had this in my notes as a nice-to-have.

When reaching the Select PVCs step, once the query resolves with PVCs for the first time they are all preselected in form state (because the main use case is assumed to be to migrating all PVCs in the namespace, and to be consistent with MTC). A ref is used to ensure this only happens once and does not override user selections, as the effect is triggered any time the query refetches.

Also, if there are PVCs in the list and none of them are selected, when clicking Next this warning appears:

Screen Shot 2022-03-31 at 3 25 13 PM

This replicates the similar message that appears in the empty state if no PVCs are in the source namespace (no warning modal is shown if proceeding in this case since the warning is already on the screen):

Screen Shot 2022-03-31 at 3 32 41 PM