Changes the Wizard's description (defined in the schema) to `Image
builder allows you to create a custom image and push it to target
environments` as indicated in the UI design prototype. The previous
description (`Create a RHEL image and push it to cloud providers`)
is no longer accurate since CentOS images are also currently supported.
Resolves#596. Adds the text `Image builder allows you to create a
custom image and push it to target environments.` and a link to the
documentation to the image output step.
A documentation button, which contains an external link to the
official documentation, appears several times throughout the frontend.
Currently, the code for the documentation button is copy/pasted where
needed. Adding a form component for the documentation button allows code reuse
and improves readability in the code that calls it.
Because this component is used by the LandingPage, ImagesTable, and
ImageWizard it has been placed in a new directory,
`src/Components/sharedComponents` which is at the same level as these
directories.
Optional chaining can return undefined. So, we should not use `of` on
getState()?.values?.['file-system-configuration']. But, since we already
check for the existance of this variable we do not need to optionally
chain.
If a user has specified an image name the name will appear. Otherwise
the image's UUID will appear.
The test needed to be modified to search for the compose in the store
with either the image name or the id
Add a details step where the user can enter a descriptive image name.
This name is displayed in the review step above the Release. Both these
fields are now horizontal to save vertical space.
Azure form fields only need to take in 36 characters for the ID so they
don't need to take up the full width of the wizard. These fields are
now 50% width. The resource group doesn't have the same character limit
but is set to the same 50% for visual consistency.
When searching for a package, all matching packages are now returned. First an
attempt is made using the api's default limit and if there are more
matching packages than the default limit a second request is made with
an increased limit. To facilitate this, api.getPackages() now accepts an
optional limit parameter. Retrieving all matching packages is necessary
because of the sorting logic.
The registration step now provides users with a type ahead input so they
can select from all activation keys associated with their accounts.
The testing for this requires that we wait for the mocked api response.
When we load the organization id but do not use or display it we can
have an act warning because we unmount the component without handling
the response.
The click through all steps with invalid and missing values are
unneccessary tests. They do not actually check the validation
and instead they just click through all steps.
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.
In the review step we want to test if the Registration tab is hidden.
This requires selecting CentOS as the distro type since CentOS does not
support RHEL subscription activation.
The "guest-image", "image-installer", and "vsphere" image types now
display proper labels in the ImagesTable target column. Also, the upload
component is renamed to Target for consistency.
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.
In order to avoid unnexpected sideeffects and to be more specific in our
tests the components should be rendered in each test and not in the
beforeAll. This will improve the testing libraries ability to run
cleanup. Moving the render into a setUp function is okay because it is
still called from within each test and won't cause sideefects for the
cleanup.
This call occurs before each test because scrollTo is not imlemented in
jsdom. Instead of calling it in each beforeEach we declare it once in
the beforeAll. This simplifies the beforeEach calls.
We should avoid using native html methods for dom traversal. Our goal
should be to visually test what users would see as much as possible and
accessing 'children' doesn't specifically check for visual elements as
much as checking for text or roles
We should avoid wrapping Testing Library util calls in 'act'. Most of
the Testing Library's functions are alread wrapped in an act so it is
unneccesary to double wrap them. Also remove unneccesarily setting
the activation key when clicking through steps since this will trigger
an async state update which causes react to complain about not being
wrapped in an act.
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.
This also mitigates the issue where clicking the image-builder nav link
would redirect you to `image-builder/image-builder` if image-builder was
already opened. And `/` didn't catch that path.
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.