Commit graph

74 commits

Author SHA1 Message Date
Gianluca Zuccarelli
49ac292ca0 CreateImageWizard: sort packages by relevance
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
2021-11-08 11:38:59 +01:00
Jacob Kozol
58f866088e CreateImageWizard: update packages to use custom callbacks
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.
2021-10-29 13:39:08 +01:00
Jacob Kozol
38abec12bf test: use userEvent click to fix react 17 test failures
screen.click() was being used but in React 17 the registration fields
will not be loaded into the dom until the user selects the radio option.
So, userEvent.click() must be used instead.
2021-10-21 19:20:17 +01:00
Jacob Kozol
7ac9b27870 test: package selector is now option not button 2021-10-21 15:33:50 +02:00
Jacob Kozol
913cd9a785 CreateImageWizard: update azure text and field order
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.
2021-10-18 18:27:40 +02:00
Jacob Kozol
c56ae8328b package.json: update eslint-plugin-jest-dom
Also, add @testing-library/dom because this is needed by the newer
user-event. Fix tests for new style standards.
2021-10-14 15:18:11 +02:00
Gianluca Zuccarelli
28f415e292 CreateImageWizard: add gcp email validation
Add email address input validation to GCP
step in CreateImageWizard.
Closes #260
2021-10-14 12:27:41 +02:00
Martin Maroši
7c16c6c3d0 Fix unhandled promise rejections in tests. 2021-10-12 15:03:04 +02:00
Sanne Raymaekers
6449111c5d CreateImageWizard: Use rhel minor versions everywhere
Fallout from switching to minor versions everywhere.
2021-09-03 17:11:57 +02:00
Karel Hala
ace808943f Remove old implementation of create image wizard
We don't need the old implementation anymore, this PR fully covers what the previous steps did
2021-06-30 14:15:01 +02:00
Karel Hala
a67e014dbe Fix failing tests
DDF requires a bit altered tests to click trough the wizard so the tests won't fail
2021-06-30 14:15:01 +02:00
Karel Hala
9bf30059f6 Fix rendering of wizard by wrapping it in act
Tests were failing because we are now calling getUser when wizard is shown. This call is asynchronous and requires wrapping the wizard in act to wait for it to be fulfilled
2021-06-30 14:15:01 +02:00
Sanne Raymaekers
e86b210a22 src: Use rhel-84 instead of rhel-8 2021-06-16 11:35:05 +02:00
Jacob Kozol
0e5ec4fb7e CreateImageWizard: use your image instead of the image 2021-06-03 17:04:54 +02:00
Sanne Raymaekers
b648ffaca4 store: Insert new composes on top of the table
Fixes #161
2021-06-02 17:56:47 +02:00
Jacob Kozol
93d0fdb6fc CreateImageWizard: alphabetize upload destinations
The upload destinations now display in alphabetical order.
2021-06-02 15:45:08 +02:00
Jacob Kozol
ebdfbbf57d ImagesTable: add gcp info
When a gcp image is successfully uploaded the user needs to know the
project id, image name, and account the image is shared with. These are
now displayed in a popover accessible from the status section of the
images table.
2021-06-02 15:44:38 +02:00
Jacob Kozol
3571a7b3c6 ImagesTable: add azure image link
When an azure image is successfully uploaded the user is provided a link
to view the image in the azure web portal.
2021-06-01 17:55:53 +02:00
Jacob Kozol
6cd58557c5 CreateImageWizard: improve packages step
Update the text description and replace "options" with "packages". Also,
add styling to increase the size of the available and chosen packages
list.
2021-05-26 17:02:31 +02:00
Jacob Kozol
7cd775cfb3 ImagesTable: add link to launch uploaded aws image
The images list now contains a link to the ec2 launch wizard for a
successfully uploaded aws image.
2021-05-17 19:37:15 +02:00
Jacob Kozol
e85e51e574 ImagesTable: display date created
The date an image was created at should be displayed in the format:
Month Day, Year. i.e. Apr 28, 2021.
2021-05-03 13:58:25 +02:00
Jacob Kozol
f8abe70004 ImagesTable: refactor list of images
Remove unnecessary styling on the rows in the images list. Reorder the
columns to put the target and status next to each other. Use upload_type
instead of upload_status. Stop storing columns in state since they are a
constant.
2021-05-03 13:58:25 +02:00
Yuxin Sun
a10e1746e5 Correct the text to match the button text label
Signed-off-by: Yuxin Sun <yuxisun@redhat.com>
2021-04-30 20:08:48 +02:00
Jacob Kozol
14a7c7e39d ImagesTable: add compose pagination
The list of composes is now paginated. The default is 10 composes per
page. This quantity can be changed. When the page or the quantity per
page is changed then the next set of composes will be fetched.
2021-04-30 17:58:14 +02:00
Jacob Kozol
82c0615aab store: add compose count
When we get composes we also get the count of total composes stored in
image-builder. We now store this quantity in our store.
2021-04-30 17:58:14 +02:00
Sanne Raymaekers
106f867e97 CreateImageWizard: Show previously selected packages
This should fix the bug where chosen packages would disappear from the
ui when switching steps and returning to the packages step.
2021-04-28 12:46:55 +02:00
Jacob Kozol
29b684599b store: add request field to compose object
The compose object should have the initial compose request stored in a
field called request. The id and image_status are independent of the
request so should not be set within it.
2021-04-23 15:53:43 +02:00
Sanne Raymaekers
1b9cf6df7b src: Remove SmartComponents/PresentationalComponents split
Just have a directory per component.
2021-04-22 10:23:51 +02:00
Jacob Kozol
8b9b03fb33 LandingPage: add documentation to header
The header now includes the proper title of Image Builder and a popover
including a description and link to documentation.
2021-04-20 16:24:50 +02:00
Jacob Kozol
f3eed9c28f store: implement compose start action/reducer
When a compose is started the api call is no longer handled by the
CreateImageWizard onSave function. Instead, the CreateImageWizard
calls the composeStart thunk. This function calls the api and handles
the response. If successful, the compose is added to the store.
Otherwise, an error is added to the store.

The store's compose object now has a list of the compose ids and an
object containing key/value pairs mapping a compose id to the compose
for all composes. This "normalized" state will allow more efficiency
when selecting individual composes or iterating through all composes.

The compose objects in the store now match the composeRequest object
instead of having a shape unique to the UI. This can be changed in the
future if image-builder's api returns compose objects of a different
format.

Tests are updated for new compose format and action/reducer types.
2021-04-19 15:04:26 +02:00
Jacob Kozol
fbada9d990 store: rename updatecompose to compose updated
Our compose actions will follow the naming convention of *name*_*event*.
Therefore, when we receive an updated compose from the api, the action
should be called COMPOSE_UPDATED.
2021-04-19 15:04:26 +02:00
Sanne Raymaekers
28cc248335 CreateImageWizard: Move steps into separate components 2021-04-14 17:34:30 +02:00
Sanne Raymaekers
c270991b85 test: Use the real redux store in testing also 2021-04-14 17:34:30 +02:00
Jacob Kozol
01c5a5f202 store: refactor redux hierarchy
The redux reducers and actions are moved to subdirectories within the
store directory. The goal of this is to improve the understandability of
the directory structure and to prepare for future scaling of the actions
and reducers.
2021-04-13 20:55:34 +02:00
Tomas Hozza
4777cdac76 Handle all valid image_status.status values
osbuild-composer and as a result also Image Builder are returning an
invalid `image_status.status` value "running" for composes which are in
progress.

Extend the front-end to handle all valid `image_status.status` values,
specifically also "building", "uploading" and "registering". Also keep
support for the invalid value "running" for some time to ensure backward
compatibility with older osbuild-composer versions.

Modify test cases in `ImagesTable.test.js` to verify all possible
`image_status.status` values. Also modify the `image_status` values used
for testing to what is actually returned by osbuild-composer Cloud API
and as a result also by Image Builder's API.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-03-25 16:45:23 +01:00
Jacob Kozol
f00cf08506 CreateImageWizard: add registration validation
If register now is selected, an activation key is required. If no
activation key is entered the Next and Create buttons are disabled.
Also, if the activation key is empty an error message will appear to
prompt the user to enter an activation key.

The subscription errors variable is removed in favor of declaring the
error message directly in the registration step component. The
validateSubscription function is removed in favor of validating the
activation key field on change.
2021-03-23 18:34:27 +01:00
Jacob Kozol
f268441d41 CreateImageWizard: validate upload destination
The user should not be able to continue without selecting an upload
destination. The uploadDestination fields are now checked to see if one
is selected before enabling the Next button in the footer. Also, the
onSaveInProgress variable is changed to isSaveInProgress to conform with
the other validation variables.
2021-03-15 14:37:27 +01:00
Sanne Raymaekers
c325a310a2 ImagesTable: Instead of the image type show the upload target
Fixes #105
2021-03-08 13:33:46 +00:00
Sanne Raymaekers
398eeb8cb2 CreateImageWizard: Add Azure upload step 2021-03-08 10:03:04 +00:00
Jacob Kozol
22385fd5ea CreateImageWizard: add google upload step
The user can now specify their authentication settings for Google Cloud
Platform. These can be either a Google account, Service account, Google
group, or a domain.
2021-03-05 16:21:08 +01:00
Sanne Raymaekers
6adab8bd3b CreateImageWizard: Fix review step
The wizard crashed in the review step when registering the system later
was selected.
2021-03-03 12:36:53 +01:00
Jacob Kozol
43e87a184d CreateImageWizard: update review page
The review page now uses more patternfly components and has been split
up a little so it is easier to add review fields for additional target
environments.
2021-03-01 17:01:58 +01:00
Jacob Kozol
6b575c5478 CreateImageWizard: add package step
The additional package selection step is added to the create image
wizard. Users can now query for packages and select them from a list.
These packages are not yet passed into the blueprint customizations and
are just for display. Tests have been updated and added.
2021-02-24 18:50:02 +00:00
Jacob Kozol
5e81d5daf9 CreateImageWizard: support multiple upload providers
The user can now select between multiple upload providers. AWS, Azure,
and Google. The selection uses tiles and the user can select one or more
destinations. Currently, only aws supports setting the upload
parameters.

The icons point to files hosted on cloud.redhat.com.
2021-02-19 12:10:57 +01:00
Sanne Raymaekers
9a590a946e ImagesTable: Adapt to new compose status response 2021-02-17 19:16:14 +00:00
Sanne Raymaekers
3414607a48 App: Show under construction page if getversion fails 2021-02-09 15:48:57 +01:00
Jacob Kozol
b17d9b5325 CreateImageWizard: display in modal
The wizard now displays inside a modal.
2021-02-04 17:19:02 +01:00
Sanne Raymaekers
1883a065f7 Same folder name between presentational and smart components 2021-02-03 12:58:49 +01:00
Sanne Raymaekers
5adb8b581e CreateImageWizard: Only ask for aws account id in upload step 2020-12-18 11:46:01 +01:00
Jenn Giardino
9c1125cf37
LandingPage: Adds empty state when no images 2020-12-17 17:43:43 +01:00