Commit graph

347 commits

Author SHA1 Message Date
lucasgarfield
4ef578ba7f API: Add clone endpoints to API 2022-11-08 11:29:31 +01:00
regexowl
6d789da727 Wizard: Update Review step
Fixes #774. This matches the Review step with the updated mocks as per SPUR.

The changes are following:
1. Target environment tab:
	- value of AWS `Account ID` aligned with GCP and Azure values
2. Registration tab:
	- `Subscription` changed to `Registration type`
	- `Organization ID` removed, will be added in a different place so it's clearer it's associated with an activation key
3. System configuration:
	- updated column name `Type` to `File system type` in partitions popover
	- updated the width of the column to accommodate the change
	- unified line spacing of `Image size` with the other rows
	- changes `Packages` to `Additional packages`
2022-11-07 16:36:50 +01:00
regexowl
9c4c24746f ImagesTable: Fix Recreate image button
This removes an extra `/` from the path for the `navigate` function to be able to resolve relative path correctly.
2022-11-07 12:40:12 +01:00
Sanne Raymaekers
06d47e5428 CreateImageWizard: fix typo in aws step 2022-11-07 12:26:08 +01:00
regexowl
f32f65c9fb ImagesTable: Remove the icon from the download link
Fixes #803. This removes the download icon and adds brackets around the file extension.
2022-11-03 13:53:56 +01:00
jkozol
414dff3ed7 api: use content-sources api for package search on stage beta
The Content Sources service can now be used for handling package info and
search. The api call to this service requires a list of repo urls. The
`repos.json` file tracks the supported repositories for each distro.
This is then mapped into a url array for whichever distro we are
searching for packages. The response body is similar to what existed in
image-builder but the key `package_name` needs to be mapped to just
`name`. Also, there is no pagination in Content Sources for `/rpms/names`
so we can currently only fetch a limit of 20 packages.
2022-11-02 17:32:51 +01:00
Gianluca Zuccarelli
53df8eb549 CreateImageWizard: fix tile hover issue
Fix #777: there was an issue with hovering
over tiles in the create image wizard due
to a deprecated css variable. This commit
resolves the issue
2022-10-25 18:12:31 +02:00
Thomas Lavocat
affd7ccbca wizard: adding a popover for the activation key
This commit addresses the first part of the issue #774.
2022-10-25 18:07:03 +02:00
Simon de Vlieger
35afba1bf2 imagestable: request.json link now non-styled
By adding custom CSS For the `ib-subdued-link` class the link now looks
like normal text. This approach was chosen as other approaches such as
clicking a non-rendered link cause serious ruckus in the test suite.

This resolves: #805.
2022-10-25 18:00:40 +02:00
Simon de Vlieger
87b853fc13 imagestable: removed label from release 2022-10-25 17:55:53 +02:00
Ondrej Ezr
f3d44adf01 Hide launch button until image is built
Move the conditional render on the main ImageLink component.
Also use destruct for props to streamline the usage of props.
2022-10-24 13:37:45 +02:00
regexowl
9c92da8bb3 Wizard: Update image output step links from RHEL 8 to RHEL 9
Fixes #776. This updates Documentation links on Image output step from RHEL 8 docs URLs to RHEL 9 docs URLs.
2022-10-21 14:04:41 +02:00
regexowl
5168b80eeb ImagesTable: Indicate expiration of aws.s3 targets
This adds indication of expiring presigned urls for aws.s3 targets. Previously the targets remained marked as `Ready` until the builds disappeared after 14 days.

When an image is ready, the countdown in hours is shown in `Status` column. After that the image is marked as `Expired` and the download link changes to `Recreate image`.
2022-10-20 11:08:47 +02:00
Ondrej Ezr
357401ecfa Add the provisioning Button 2022-10-18 10:37:29 +02:00
Sanne Raymaekers
03421acc74 src/Router: use release as a basename in BrowserRouter
The insights platform is moving to react router v6, meaning router
contexts can no longer be nested. As a result all applications will end
up sharing the same `BrowserRouter`.

Switch to using the release (`/` or `/beta/`) as a basename for the
BrowserRouter, and offload the full path (`/insights/$appname`) to the
individual routes. This makes it easier to drop the BrowserRouter in
image builder for the platform one in future.
2022-10-17 15:53:21 +02:00
Sanne Raymaekers
4c1a6c223d App: explicitly pass the store to the NotificationsPortal
Because of mismatched redux versions between NotificationPortal and our
app, the former couldn't automatically discover the store.

Also drop reregister of notificationsReducer, we already register it in
store.
2022-10-06 11:56:25 +02:00
Chloe Kaubisch
ae69466af4 createimagewizard: clear subscription data
Clear subscription data when centos release is selected.
Fixes #787
2022-10-04 16:31:37 +02:00
lucasgarfield
a17a759d5e Redux: Modernize Redux store
This commit modernizes the Redux store to bring it in line with the
current recommended best practices/patterns. It is possible because of a
recent previous commit that added Redux Toolkit as a dependency.

For detailed information on what modern Redux entails, see the Redux docs:
https://redux.js.org/introduction/getting-started#learn-modern-redux-livestream

Practically speaking, this means a huge reduction in boilerplate code.
Maintaining and extending the code will be much easier. All Redux logic
is now encapsulated by 'slices'. Reducers are defined in the slices, and
action creators and action types are generated automatically.

Redux Toolkit includes Immer, which greatly simplifies writing reducer logic
much simpler - state updates in Redux must be immutable, but working
with Javascript objects in an immutable fashion is clumsy, requiring
gratuitious use of the spread ... operator. With Immer, the state can be
updated as if mutable updates were allowed. Reducer logic has been
changed to take advantage of this in this commit.

This commit also removes a large amount of unused code. Fingers crossed
that nothing breaks. The tests do pass, afterall...

One other minor change... composesGet was renamed to fetchComposes and
composeGetStatus was renamed to fetchComposeStatus. This is in line with
the Redux documentation examples.
2022-09-30 13:17:09 +02:00
Sanne Raymaekers
1276b4ae9c test/ImagesTable: use redux store and mocked api
Instead of supplying the composes directly in the store, let the
component call the api.
2022-09-26 14:04:01 +02:00
regexowl
03ff9fd3d9 ImagesTable: Increase bottom margin of the pagination toolbar
Fixes #797. This increases the size of the margin at the bottom of the table of images. That way the pagination controls are not obscured by the notifications icon.
2022-09-23 18:16:20 +02:00
lucasgarfield
2cac343b2f Wizard: Add test for file system configuration buttons
This commit adds a test that checks the new behavior of the file system
configuration buttons by adding duplicate mount points and verifying
that errors do not appear until the next button is clicked.
2022-09-23 18:11:35 +02:00
regexowl
69c29e4336 Wizard: Update tests
Related to #778. This replaces `verifyButtons()` function with `getBackButton()`, `getNextButton()` and `getCancelButton()`.

The functions run `getByRole` query before a button is clicked allowing detection and use of custom buttons.

Test `Click through all steps › with valid values` was updated to reflect changes in functionality of the `File system configuration` step.
2022-09-23 18:11:35 +02:00
lucasgarfield
de4e9bea07 Wizard: Improve file system configuration error messaging
This commit improves the file system configuration step's error handling
by performing validation only when the next button is clicked. This
allows an invalid state to temporarily exist while the user is modifying
the mountpoints without bothersome error messages needlessly appearing.

Broadly speaking there were two options for the implementation: (1)
delay the validation, performing validation only upon clicking the next
button -or- (2) perform validation immediately as normal but hide error
messages until the next button is clicked. Option (1) proved to be
untenable - Data Driven Forms does provide `pauseValidation()` and
`resumeValidation()` functions from React Final Form which theoretically
would make this option possible... However, we need to call
`resumeValidation()` in the next button's click handler and then
immediately make a decision based on the validation results either to
remain on the step and display the errors or move to the next step.
When we tried implmenting this we found that `resumeValidation()` does
not immediately peform validation - validation only resumes after
exiting the handler. Therefore, this approach was not considered and
option (2) was used.

In order to gain control over the behavior of the next button, custom
buttons are implemented for this step. Sharing state between the custom
buttons and the form was a challenge. With pure React it would have been
as simple as moving the relevant state to the parent component, but that
was not possible due to Data Driven Forms. Instead, state is shared
using the form state. A new property,
`'file-system-config-show-errors'`, in the form state is used to
determine whether or not error messages should be displayed.

In order to cause a re-render upon a change in
`'file-system-config-show-errors'`, the file system configuration
component is wrapped in a `<FormSpy>` component.
2022-09-23 18:11:35 +02:00
Sanne Raymaekers
e868ffcaa6 ImagesTable: Reset polling each time the composes are updated
Previously the polling was started once on mount, but the reference to
the list of composes the polling function had didn't get updated. Reset
the polling on each render, ensuring the polling function has the latest
the list of composes from the store.

Fixes #767
2022-09-21 23:09:56 +02:00
regexowl
45d0db3f04 ImagesTable: Increase font size of text in Status column
Fixes #808. This removes the `<small>` tag around status message to unify the font size within the table.
2022-09-20 14:50:10 +02:00
regexowl
a3afc562c8 Wizard: Update tests
Related to #773. This updates tests to reflect changes in the description of the Packages step.
2022-09-19 16:19:30 +02:00
regexowl
af062a5945 Wizard: Update description on the Packages step
Fixes #773. This changes description of the Packages step according to recent SPUR.
2022-09-19 16:19:30 +02:00
Sanne Raymaekers
b86a9b712d CreateImageWizard: Drop isBeta() check for centos
The accompanying text allows us to enable this for non-beta.
2022-09-14 14:19:35 +02:00
regexowl
0bced556a9 ESLint: Use --fix with new rules to order import declarations
Related to #795. This applies the new sorting rules in ESLint to the files by running `npm run lint:js:fix`
2022-09-14 13:24:38 +02:00
regexowl
05e678f8c1 ImagesTable: Add pagination to the bottom of the table
Fixes #594. This adds pagination to the bottom of the images list so the user doesn't have to scroll up to use it.

Tests were also updated to reflect the change.
2022-09-14 10:32:38 +02:00
lucasgarfield
a977f4b72b Redux: Add Redux Toolkit
This commit adds Redux Toolkit as a dependency. Adding Redux Toolkit is
beneficial because it will allow us to use the current best-practice Redux
development patterns and tools as well as reduce the number of
dependencies. Redux Toolkit is backwards compatible with existing Redux code,
and therefore works with all of the current actions and reducers.

The store is now created using Redux Toolkit's configureStore(). Previously, a
custom store creator developed by Red Hat Insights was used. However,
this is actually not required for Insights apps, and creating the store using
configureStore() is necessary to take advantage of Redux Toolkit. For
instance, the store can now be inspected using the Redux devtools in the
browser.

This commit removes the redux-logger middleware. It is no longer
necessary, as the Redux development tools can now be used to easily inspect and
reason about the redux store and its state.

The Thunk middleware dependency has also been removed, as Thunks are already
included in Redux Toolkit.

The redux-promise-middleware dependency has been left in place for now,
but its functionality is also available in Redux Toolkit and it may be
considered for removal in the future.

Using Redux Toolkit will also allow us to move to the `Slice` pattern when
defining actions/reducers in the future if we wish. This will make
writing, reasoning about, and debugging the code related to the Redux
store much easier.
2022-09-06 11:01:25 +02:00
lucasgarfield
1d6a92a7f9 Wizard: CentOS acknowledgement text updated for production 2022-09-02 17:01:12 +02:00
regexowl
c9c75da7ba Wizard: Fix UI issues for Microsoft Azure Target environment
Fixes #772. This updates description of the step according to recent SPUR.
The `Authorizing an Azure account` expandable was removed (both from the step and `ImageCreator.js`) as well as `Destination` heading. Size of the Oauth 2.0 link was changed from small to default.
2022-09-02 10:37:08 +02:00
regexowl
2520b99ad1 Wizard: Match the case of System configuration with other step titles
Fixes #768. This matches System configuration case with the case of the other step titles as per recent SPUR.
2022-08-25 15:57:55 +02:00
regexowl
dfbabc1f47 Wizard: Add clarification to AWS and GCP environment steps
Fixes #770. This clarifies that the user is responsible for copying the AWS/GCP image to their account before the image expires.
2022-08-25 10:20:04 +02:00
regexowl
130e8a0532 Wizard: Display file extensions on Image output step
Fixes #769. This adds file extensions for private cloud and other target environments in Image output step as per recent SPUR.
2022-08-25 10:09:13 +02:00
regexowl
401229ee96 Wizard: Fix GCP step popover text
Fixes #771. This changes `e.g.` to `For example:` and `Google Workspace
domain/Cloud Identity domain` to `Google Workspace domain or Cloud
Identity domain` as per recent SPUR.
2022-08-19 15:28:17 +02:00
Ondřej Budai
5264896bff ImagesTable: add option to download a raw compose request
In order to help people transition from using GUI to use the API directly,
it's helpful to give them an easy way to inspect the whole raw compose
request.

This commit adds a new button next to each compose that simply downloads
the original compose request in a json format. This request can then be
directly piped into the IB API to build a new image.

Original idea by Troy Dawson

Co-authored-by: Lucas Garfield <lucas@redhat.com>

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-08-15 15:38:13 +02:00
lucasgarfield
489d6a334f CreateImageWizard: Add CentOS acknowledgement
Adds a PF4 info <Alert> that informs users that CentOS is intended only
for development of RHEL-Next if CentOS is the selected distro in the
Image Output step.
2022-07-08 11:17:10 +02:00
lucasgarfield
f6a98d2dca CreateImageWizard: Add CentOS speedbump
When selecting a distribution during the Image Output step, only RHEL
distributions are shown initially. A button at the bottom of the list of
distributions can be clicked to expand the list and display all
distributions, which at the moment adds CentOS-8 and CentOS-9 to the
list.

Implemented by passing a PF4 SelectViewMoreObject as the LoadingVariant
prop to the <Select>.

This feature (and therefore the ability to build CentOS images) is only
available in beta.
2022-07-08 11:17:10 +02:00
Sanne Raymaekers
1c5542ca81 CreateImageWizard: Use stage candlepin urls on stage consoledot 2022-06-07 14:53:45 +02:00
Jacob Kozol
4fa71cede8 update style across the project
The eslint updates require style changes in all components.
2022-05-23 12:47:20 +02:00
Sanne Raymaekers
4c881fb2b1 CreateImageWizard: Make RHEL 9 the default release 2022-05-19 12:04:27 +02:00
lucasgarfield
480c754b37 CreateImageWizard: Add /tmp mountpoint
/tmp was added to the list of valid mountpoints in the filesystem
customization step.

No validation is necessary at this time because rhel-86, centos-8, and
centos-9 all support a /tmp mountpoint.
2022-05-19 11:50:53 +02:00
Sanne Raymaekers
e160aec170 test: Add test to check for all the available releases
This obsoletes the 'non-rhel releases on beta' test, as it checks all
releases.
2022-05-18 15:24:04 +02:00
Sanne Raymaekers
2e39b47095 test: Remove commented out image output test 2022-05-18 15:24:04 +02:00
Sanne Raymaekers
cfaa8a463d CreateImageWizard: RHEL 9
Expose rhel-90, it has reached GA.
2022-05-18 15:24:04 +02:00
Jacob Kozol
40f7be170c CreateImageWizard: require max image name length of 100 chars 2022-05-13 12:51:48 +02:00
Sanne Raymaekers
070e507933 constants: Switch to rhel-86 2022-05-12 15:20:41 +02:00
Gianluca Zuccarelli
90d15807a6 ImagesTable: add error status
Add error information for failed image
builds. The error details are only displayed
for failed builds and the error highest up
the error chain is displayed in the expandable
section of the image.
2022-04-29 17:13:37 +02:00