Update the registration options to include registering without insights.
Also, improve the text info in the step.
The org id is also removed from the registration step since we no
longer display the id in this step.
At the final review step, only render the Registration tab
if the user has selected RHEL 8 as the release. Add a test to
ensure that if the user selects CentOS as the release, there
are only two tabs at the review step.
The image types 'vsphere', 'guest-image', and 'image-installer' are now
supported by the CreateImageWizard. They require no additional
customizations and support the current registration and packages
customizations.
Loading the organization ID is now done in the registration step. This
prevents the entire wizard from waiting on the org id and prevents the
wizard from remounting when the async getUser() completes.
When a user searches for available packages, already chosen packages are
filtered from the available packages list. This prevents the user from
adding duplicate packages.
When the user filters the chosen packages list they may find no packages
containing the entered string. In this case we display a message that no
packages are found. There are now tests for both the available and
chosen packages lists for when packages are not found.
Having the available packages list be either undefined, empty, or with
elements requires complicated logic. Instead, initialize
packagesAvailable to an empty array. In order to display an error state
when the packages search returned no packages, now use a boolean flag if
available packages were found. This check also sets us up in case we
want to provdie further feedback on failed package searches.
If a user choses packages and then changes to a different step, the
packagesChosen state is wiped. These packages are now stored in the form
state under 'selected-packages'. When the packages step is mounted, if
there are 'selected-packages', these are the initial state for
packagesChosen.
When adding all packages we no longer depend on the state update.
Instead, we initialize an object with the chosen packages and pass that
to both the step's state and the form's state. Using the step state to
set the form's state was causing the form's state to be set from the
prior step state and not the state with the new package list.
The addEventListener call needs to have the useCapture field set to
true. The data-driven-forms patternfly 4 wizard will continue to the
next step when the Enter key is pressed. If we add our keydownHandler as
an event listener with useCapture set to True, the keydownHandler will
trigger before the wizards handler. This will effectively override the
wizard's handling of the Enter key so that it can be used to search when
the user has either package search bar in focus.
The review step is improved. The create button now states 'Create
image'. The step description text is updated. The fields to be reviewed
are now split into tabs for 'Target environment', 'Registration',
'System Configuration'. The target environments show the logo of the
environment now. The quantity of packages selected also displays now.
Tests are also updated.
Sort the package results in the CreateImageWizard
first by exact matches and then by pacakge results
that start with the same letters as the search term,
otherwise sort alphabetically.
Fixes#256
PF4 now allows more control over the DualListSelector. This component is
rewritten to use custom callbacks which allow us to display a more
customized version of the DualListSelector. Currently, the component is
visually identical to the existing implemention except for the addition
of a search button to filter the chosen packages.
When clicking the packages add all button the list of available packages
did not get added to the list of chosen packages. Now the chosen
packages and available packages are concatenated together.
On authorization of image builder on azure, the user will be redirected
to portal.azure.com. The response mode is changed to query instead of
form_post because form_post makes a POST request while query makes a GET
request. portal.azure.com does not respond when we make a POST request
to it so users will not be redirected unless we use the response mode
of query.
The info text is updated and the authorize button is moved below tenant
ID. The tenant ID is now validated as a valid GUID and if is not valid
the authorize button is disabled. This tenant id is now used to validate
image builder on azure because the authorize url containing the tenant
id will authorize for any microsoft account type. Tests are also
updated.