Commit graph

209 commits

Author SHA1 Message Date
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
Jacob Kozol
2602ff346f CreateImageWizard: improve review step
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.
2021-11-19 16:25:23 +00:00
Jacob Kozol
fef6884650 test: update tests for React Router v6
The test Router now takes location and navigator instead of history.
This also means that the history function no longer needs to be mocked
by jest. Instead, the location and pathname can simply be expected.
2021-11-18 19:06:56 +01:00
Jacob Kozol
b71aa75df3 src: replace React Router history with navigate
React Router v6 now has useNavigate() instead of useHistory.
useNavigate() is equivalent to useHistory().push();
2021-11-18 19:06:56 +01:00
Jacob Kozol
50a515db1e Router: change Redirect to a Navigate
React router is moving away from redirects in favor of server side
redirecting since redirects are confusing because the initial "invalid"
route will still return a 200 status and redirecting unnecessarily
wastes resources. Instead of server routing we can also place our
Redirect inside of a Route as an element. Also, instead of using a
Redirect we use a Navigate. This is due to changes in how React Router
handles the history.
2021-11-18 19:06:56 +01:00
Jacob Kozol
81acb2bb57 Router: update Route components
In React Router v6 the Route paramater 'exact' is replaced by using a
trailing * to indicate the path matches deeply. Also, elements are now
preferred over components. React, itself, has also been making this
switch. Using elements is simpler than components and integrates
better with hooks.
2021-11-18 19:06:56 +01:00
Jacob Kozol
c6f2ed227f Router: change the Switch component to a Routes component
In React Router v6 the Switch element is replaced by Routes. All links
inside a <Routes> are relative and routes can be placed in any order
now.
2021-11-18 19:06:56 +01:00
Jacob Kozol
f1d00b3b2d App: update app and routes
The App and Routes components are updated for compatibility with React
Router v5 and to follow updates made to RedHatInsights'
frontend-starter-app. Mainly, we no longer map our Routes to another
component and our main components are lazy loaded instead of mapped to
an asyncComponent. Also, the App component is rewritten to use react
hooks and remove unneccessary bloat.
2021-11-18 19:06:56 +01:00
Jacob Kozol
cd8175fe73 CreateImageWizard: insert new compose on top of images list
The composeAdded action includes a field 'insert'. When set to true
`insert` will place the added compose at the beginning of the images
list. The test is modified so the new composes are added to the
beginning of the list.
2021-11-16 10:14:48 +00:00
Jacob Kozol
56fdc730e5 CreateImageWizard: decrease aws account id field length 2021-11-12 19:19:14 +01:00
Jacob Kozol
0357ed57f9 CreateImageWizard: add default state to package selection 2021-11-12 19:12:17 +01:00
Jacob Kozol
8871bd8373 App.js: enable patternfly utilities
Importing the patternfly-addons.css file enables patternfly utility
classes.
2021-11-12 19:12:17 +01:00
Jacob Kozol
1593402192 CreateImageWizard: fix indentation in the review step 2021-11-11 22:44:21 +00:00
Sanne Raymaekers
b986067079 constants: Introduce RHEL_8 constant
Bump rhel-84 to rhel-85.
2021-11-11 19:13:48 +01:00
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
fe891eb56f CreateImageWizard: update azure help text to present tense 2021-11-07 17:57:22 +00:00
Jacob Kozol
4b62b91733 CreateImageWizard: add placeholder text to packages search bars 2021-11-02 00:26:51 +00:00
Jacob Kozol
9feccc66d6 CreateImageWizard: packages can be searched with enter key
When focused on either the available packages or chosen packages search
bar, pressing the enter key will search/filter the packages.
2021-11-02 00:26:01 +00:00
Ondřej Budai
40b0cdaa45 CreateImageWizard: fix the description for google group
and and
2021-11-01 10:53:21 +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
7e8911a40c CreateImageWizard: fix packages addAll button
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.
2021-10-25 16:52:15 +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
7ea8168443 CreateImageWizard: add creation failure alert
When image creation failed to start the wizard would get stuck in the
saving state with no notice to the user. Now the user will get an error
alert contain the status code and message. The wizard no longer gets
stuck in the saving state.
2021-10-21 19:19:36 +01:00
Jacob Kozol
7ac9b27870 test: package selector is now option not button 2021-10-21 15:33:50 +02:00
Jacob Kozol
a51328e426 CreateImageWizard: update azure redirect
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.
2021-10-19 14:44:30 +02:00
Jacob Kozol
d9a2fd1886 CreateImageWizard: use GUID instead of ID in azure step 2021-10-18 18:27:40 +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
d3a5a3adc1 Fix incorrect CSS prefix on DDF wizard. 2021-10-12 15:03:04 +02:00
Martin Maroši
7c16c6c3d0 Fix unhandled promise rejections in tests. 2021-10-12 15:03:04 +02:00
Martin Maroši
d3999cbf87 Fix local development and use correct CSS prefixes. 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
Simon Steinbeiss
9ff2139930 CreateImageWizard: Switch away from TextListItem 2021-08-10 11:32:25 +02:00
Simon Steinbeiss
6d08382fce CreateImageWizard: Align all values on the review step
Closes #194
2021-08-10 11:32:25 +02:00
Sanne Raymaekers
fa7746b694 store: Pass middleware correctly
Get rid of duplicate entry points.

Depending on the NODE_ENV, add the logger middleware in AppEntry.

Filter out undefined items to avoid 'middleware is not a function' error.
2021-08-08 15:20:37 +03:00
Simon Steinbeiss
bec1183c5a CreateImageWizard: Show Azure information on review page
Closes #202
2021-08-02 19:26:28 +02:00
Simon Steinbeiss
c8fe2252ce CreateImageWizard: Only show subscription info for RHEL* 2021-07-21 10:47:39 +02:00
Simon Steinbeiss
98c7758781 CreateImageWizard: Only show Registration section in Review if applicable
Closes #252
2021-07-15 12:12:02 +02:00
Martin Marosi
9599f197e9 Fix store already initialized error. 2021-07-15 12:11:32 +02:00
Simon Steinbeiss
7afb07328f CreateImageWizard: Fix inconsistent casing Google products
Closes #259
2021-07-13 10:11:28 +02:00