'ami' was deprecated a while ago, and is kept around as an alias of
'aws'. Same with 'vhd' and 'azure', and 'vhd' and 'gcp'.
This maintains support for the old aliases where necessary.
Fixes#822. This adds component `ActivationKeyInformation` with additional information for an activation key on a Registration tab of Review step.
The added fields are:
- Name
- Role
- SLA
- Usage
- Additional repositories
Organization ID is added to the Activation key popover.
Function `getActivationKey` was added to `api` to get an additional information about activation key from RHSM api based on the name of the key.
Prior to this commit, the downloaded request was just an ugly unformatted
json. Surely, `jq . <request.json` could fix that, but it's much more
convenient if the frontend does it itself.
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit updates the Redux store so that the new clone API end points
can be used. The composes slice is updated - composes now have a clones
property - and a clones slice is added.
Selectors are added as well. Although not used in this commit, the
selectors will allow us to significantly simplify our React components
that need to retreive data from the store.
We now must work with both `composes` and `clones`. `Composes` and `clones`
have slightly different schema in the Redux store because of differences
in their API responses (the store schema generally mirrors the API
response schema). Selectors are defined for `images` that work for
both `composes` and `clones`.
Using selectors allows our React components to interact with the Redux store
as if it were a database - components can simply query the store by id
using a selector. This hugely simplifies our React components - they no
longer need to accept multiple props related to a `compose` (or `clone`
or `image`). They can simply take a `composeId` (or `cloneId` or
`imageId`) prop and use an appropriate selector to obtain the necessary
information.
Selectors also encapsulate the store schema. Components no longer need to know
about the store schema to get information about an image - they simply
use a selector and in return receive a normalized (and flat) object.
This means that in the future we could easily migrate the API and slices
to RTK Query without the need to modify any of our React components.
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`
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.
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`.
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.
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.
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.
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.
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.
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.
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>
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.
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.
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.
This commit displays the UUID in an expandable details row. This is
necessary because if an image was named, the UUID was not displayed.
It is important that a user know the UUID for troubleshooting, for
example in the case of requesting help with an image.
To facilitate this, the original Table component was converted to a
TableComposable component. TableComposable is newer and recommended over
the older Table by PatternFly.
The distinction is made by checking if the distribution contained
'rhel'. This is the same way the review page determins if it should show
a registration tab.
Resolves#604. The available and chosen package search inputs now have a
reset button which resets the search and list elements to their default
states. This fixes a cosmetic issue related to the focus-visible width
being smaller than the search input width. This is accomplished by passing
an onClear prop to the search input.
The functions used to add all and selected packages were split from two
functions into four functions. The functions appear similiar but this is only
superficial; the logic is actually quite different and there is very
little code reuse. Four separate functions will be easier to understand and
maintain.
This commit includes several other modifications:
1. The chosen package search is now a typeahead filter. This brings it
in line with PatternFly dual list selector examples.
2. The available package search button has changed to be in line with
the PatternFly <SearchInput /> component examples.
3. Package sorting behavior is now consistent. Previously, packages would be
sorted if 'add all' was used but not if 'add selected' was used. Now
the default behavior is to always sort the package list.
The Details step is renamed to Name Image and moved to the last step
before Review. Also, the validation is removed since all utf-8
characters are supported for image names.
Validation is not enforced on the image output step
when selecting and then deselecting an image type. This
is because the only validation which is set is `Required`.
However, after deselecting an image type the input becomes
a key-value object with all the values set to false. This
commit adds a custom validator to check that at least one
value in the object is set to true. Fixes#575
Resolves#466. The default behavior for the DDF Wizard is to either advance to
the next step or submit the form when the ENTER is pressed.
This is inappropriate for complex forms that contain many different
types of elements that are typically interacted with using ENTER. For
instance, the default behavior when a link is focused and ENTER is pressed
is not to open the link in a browser but to advance or submit the form.
This commit overrides the default behavior by passing an onKeyDown prop
to the wizard which calls a custom onKeyDown function. The new custom
function does not define any behavior for when ENTER is pressed,
but does recreate DDF's default ESCAPE behavior, which is to close the
modal.
The default behavior of Data Driven Forms when moving to the previous or
next step is to maintain focus on the previous or next button,
respectively.
This commit makes the UI more friendly to keyboard users by focusing
on the first input element of a given step when it is rendered.
Whenever possible, autofocus is achieved by passing components the
autoFocus prop. When this is not possible, then useRef and useEffect hooks
are used to set focus.
At the moment, it is not possible to autofocus the image output step's
release selector or the file system configuration step's toggle using the
above methods. This is because these PatternFly components do not
currently pass props to the appropriate child component and do not
support ref forwarding. The best option for autofocus in these cases is
currently being investigated.
Verify that clicking recreate will pass the expected compose request to
the CreateImageWizard. Also, verify that if passed a composeRequest and
initialStep of 'review', the wizard will display the review page with
all info filled.
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.