CreateImageWizard: Fix deselecting selected packages
Deselecting a selected set of package didn't change the state correctly.
This commit is contained in:
parent
0d5ab8b86b
commit
a16212ddc3
3 changed files with 43 additions and 6 deletions
|
|
@ -139,14 +139,15 @@ const Packages = ({ defaultArch, ...props }) => {
|
|||
|
||||
if (fromAvailable) {
|
||||
sortPackages(updatedSourcePackages);
|
||||
setPackagesChosen([ ...destinationPackages ]);
|
||||
setPackagesChosen(destinationPackages);
|
||||
// set the steps field to the current chosen packages list
|
||||
change(input.name, removePackagesDisplayFields(destinationPackages));
|
||||
} else {
|
||||
setPackagesChosen(updatedSourcePackages);
|
||||
sortPackages([ ...destinationPackages ]);
|
||||
sortPackages(packagesAvailable);
|
||||
// set the steps field to the current chosen packages list
|
||||
change(input.name, removePackagesDisplayFields(updatedSourcePackages));
|
||||
}
|
||||
|
||||
// set the steps field to the current chosen packages list
|
||||
change(input.name, removePackagesDisplayFields(packagesChosen));
|
||||
};
|
||||
|
||||
// move all packages
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ const ReviewStep = () => {
|
|||
<TextListItem component={ TextListItemVariants.dt }>
|
||||
Chosen
|
||||
</TextListItem>
|
||||
<TextListItem component={ TextListItemVariants.dd }>
|
||||
<TextListItem component={ TextListItemVariants.dd } data-testid='chosen-packages-count'>
|
||||
{getState()?.values?.['selected-packages']?.length || 0}
|
||||
</TextListItem>
|
||||
</TextList>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue