Commit graph

249 commits

Author SHA1 Message Date
Chloe Kaubisch
9519fabf11 createimagewizard: update aws step text
fixes #600
2022-02-25 14:58:06 +01:00
lucasgarfield
86e624f321 CreateImageWizard: Change GUID to ID in Azure step 2022-02-25 14:30:57 +01:00
lucasgarfield
dfe8d3e19e CreateImageWizard: Change Image Destination to Destination Azure step 2022-02-25 14:30:57 +01:00
Jacob Kozol
f278f049a9 CreateImageWizard: Add expandable section for azure description
The azure step's descriptive text under the `Authorizing an Azure
account` title text is now expandable. Clicking the title shows or
hides it.
2022-02-25 14:30:57 +01:00
Jacob Kozol
1a6938ef1f CreateImageWizard: set azure field length to 50% width
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.
2022-02-25 14:30:57 +01:00
lucasgarfield
5e0ce52742 CreateImageWizard: Show empty available state on failed search
Resolves issue #588. 'No packages found' is now correctly displayed
after a failed search that follows a successful search.
2022-02-24 17:01:50 +01:00
lucasgarfield
1630f30448 CreateImageWizard: Sort packages alphabetically
Search results are now converted to lower case before sorting. This
ensures that results appear in alphabetical order in a case insensitive
fashion.
2022-02-24 17:01:50 +01:00
lucasgarfield
e8e7329bf6 CreateImageWizard: Get all matching packages from package search
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.
2022-02-24 17:01:50 +01:00
Jacob Kozol
92f963c49a CreateImageWizard: add activation keys to registration
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.
2022-02-14 16:31:19 +01:00
Jacob Kozol
02fbdf5e88 CreateImageWizard: remove act warning on Review step
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.
2022-02-14 16:31:19 +01:00
Jacob Kozol
fc9735371f tests: remove useless tests
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.
2022-02-14 16:31:19 +01:00
Sanne Raymaekers
8e4b4ff6d5 CreateImageWizard: Disable vmware and installer images
These images need either user customization or a default user.
2022-02-03 15:42:34 +00:00
Jacob Kozol
f51e9fd9b2 CreateImageWizard: update review step for new subscription strings
The review page and its test now contains the organization id and
additional strings for whether the image is subscribed to insights or
not.
2022-01-21 11:57:04 +01:00
Jacob Kozol
e48e2ca659 CreateImageWizard: redesign registration step
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.
2022-01-21 11:57:04 +01:00
Chloe Kaubisch
3571c969ce CreateImageWizard: conditionally render Registration tab
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.
2022-01-20 15:30:13 +01:00
Jacob Kozol
6d66ab3228 test: add centos setup
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.
2022-01-20 15:30:13 +01:00
Jacob Kozol
81629feaad ImagesTable: add target labels for new image types
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.
2022-01-14 22:23:50 +01:00
Jacob Kozol
59e951653d ImagesTable: add image download link
The new blobby image types are uploaded to aws.s3 for download. Instead
of linking to a cloud instance, these image types display a download
link.
2022-01-14 22:23:50 +01:00
Jacob Kozol
f1f3c0cd66 CreateImageWizard: add new image types
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.
2022-01-14 22:23:50 +01:00
Jacob Kozol
0b45e7bc4f CreateImageWizard: validate azure resource group
Resource group names only allow alphanumeric characters, periods,
underscores, hyphens, and parenthesis and cannot end in a period. A
regex validation is now added to ensure this.

Documented by azure here:
https://docs.microsoft.com/en-us/rest/api/resources/resource-groups/create-or-update
2022-01-11 10:54:04 +01:00
Jacob Kozol
989d5fabac ImagesTable: align gcp image details with other instance text
The link for the gcp Instance description was not set to isInline.
Fixing this aligns the text with the rest of the instance links.
2022-01-09 17:13:03 +01:00
Jacob Kozol
e1f6ae1cca test: fix testing-library/no-render-in-setup error
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.
2022-01-05 11:51:55 -05:00
Jacob Kozol
e43c41a143 test: move scrollTo to beforeAll
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.
2022-01-05 11:51:55 -05:00
Jacob Kozol
d1cd05aca7 test: fix testing-library/render-result-naming-convention 2022-01-05 11:51:55 -05:00
Jacob Kozol
6713d279ef test: fix testing-library/no-wait-for-multiple-assertions error
Simplify the waitFor calls to only wait for the asynchronously updating
components.
2022-01-05 11:51:55 -05:00
Jacob Kozol
20d3928744 test: fix testing-library/no-node-access error
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
2022-01-05 11:51:55 -05:00
Jacob Kozol
c7bbe1d9b7 test: fix testing-library/prefer-screen-queries error
Using queries built into the screen object is preferable since
destructuring them makes maintainabilty more complex.
2022-01-05 11:51:55 -05:00
Jacob Kozol
5f5476c83e test: fix testing-library/no-unnecessary-act error
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.
2022-01-05 11:51:55 -05:00
Jacob Kozol
919919173d CreateImageWizard: move org id to custom component
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.
2022-01-05 11:51:55 -05:00
Sanne Raymaekers
104707fb87 CreateImageWizard: Detail what subscription means
Fixes #126
2021-12-01 18:08:24 +01:00
Sanne Raymaekers
6567323ef6 Router: Replace landing with catch-all route
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.
2021-11-30 16:12:43 +01:00
Jacob Kozol
4d987eb05e CreateImageWizard: filter already added packages
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.
2021-11-30 15:58:20 +01:00
Jacob Kozol
db6aa5158d CreateImageWizard: display message for invalid chosen packages filter
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.
2021-11-30 13:22:01 +01:00
Jacob Kozol
8c3a60a7ed CreateImageWizard: only display upload review for selected destinations 2021-11-30 12:45:14 +01:00
Jacob Kozol
c230d41d88 ImagesTable: add title to Instance column
Also, test the table has expected headers.
2021-11-30 12:08:52 +01:00
Sanne Raymaekers
af5f734328 App: Drop permission check 2021-11-29 20:59:15 +01:00
Jacob Kozol
28a76a6dcb CreateImageWizard: redo package search default message
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.
2021-11-29 20:35:23 +01:00
Sanne Raymaekers
a16212ddc3 CreateImageWizard: Fix deselecting selected packages
Deselecting a selected set of package didn't change the state correctly.
2021-11-29 18:15:51 +01:00
Sanne Raymaekers
0d5ab8b86b CreateImageWizard: Correct name for packages step 2021-11-29 18:15:51 +01:00
Sanne Raymaekers
36d54a94e0 store: Drop unused pendingCompose section
With the introduction of the DDF wizard this part of the store isn't
used anymore.
2021-11-29 18:07:55 +01:00
Sanne Raymaekers
8ac1f8ae1d CreateImageWizard: Prevent dom validation error
Prevents `...<div> cannot appear as a descendant of <p>.` when running
`npm run travis:verify`.
2021-11-29 17:58:53 +01:00
Katerina Koukiou
292d14e36f CreateImageWizard: Show "no package results are found" when no packages are found
Fixes #463
2021-11-28 18:16:51 +01:00
Chloe Kaubisch
c6f74efcb3 CreateImageWizard: don't obscure activation key
Activation key was previously obscured by stars, instead just show it
(both in the input and in the review step) as it isn't secret.
2021-11-26 16:27:58 +01:00
Jacob Kozol
86158bd94e CreateImageWizard: add loading icon when creating image 2021-11-23 10:54:11 +01:00
Jacob Kozol
24a0f39857 CreateImageWizard: validate the subscription GUID is a valid GUID 2021-11-23 10:47:11 +01:00
Jacob Kozol
3e38a71c4a CreateImageWizard: show previously chosen packages
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.
2021-11-23 10:41:58 +01:00
Jacob Kozol
dd895e014e CreateImageWizard: fix add all packages
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.
2021-11-23 10:35:21 +01:00
Jacob Kozol
940e40409c CreateImageWizard: fix Enter key for packages search
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.
2021-11-22 16:58:25 +01:00
Jacob Kozol
6468d33d25 ImagesTable: update pending text
"Image build is pending" is more in line with the rest of our status
texts.
2021-11-22 00:32:12 +00:00
Jacob Kozol
5612d25f0d CreateImageWizard: update style
The form's gutters were unnecessarily large. They are now slightly
smaller to fit all data without scrolling.
2021-11-19 16:25:23 +00:00