This adds `request` to a reponse from the `composes/{composeId}` endpoint and `meta` to a response from the `/composes/{composeId}/clones` endpoint as per API documentation.
The incomplete responses were causing problems when fetching data from the endpoints mentioned above.
The fixture was also migrated to TypeScript.
This adds validation of an image name based on a pattern, which was chosen as an intersection of the naming constrains of hyperscalers.
The pattern is based on the one for naming GCP images as those naming guidelines are the most restrictive. With added minimal length restriction of AWS.
This commit replaces all calls to the insights.chrome global with calls
to the useChrome() hook (or the useGetEnvironment() custom hook that
wraps useChrome()).
The use of chrome.isBeta is deprecated, the useChrome hook should be
used instead to obtain an isBeta() function. Using the deprecrated
chrome.isBeta pollutes the browser console with warning messages.
This commit replaces the isBeta() helper function with a new custom
hook, useGetEnvironment().
We still sometimes need to know which environment is running outside of
React components, where we cannot call the useChrome() or
useGetEnvironment() hooks. For instance, in the json used to define a
wizard step. Therefore a new isBeta variable has been added to the
form's initialState for use in these cases.
Insights offers 'quickstarts', which can be used to provide
mini-tutorials in a sidebar.
Unfortunately, these quickstarts change our URL... they add an optional
query parameter related to the quickstart. The process of doing so
destroys our router's `location`, setting it to undefined.
We have been using the location state to store the GUID of the image,
needed when opening the wizard via the `Recreate image` action or when
opening the share modal.
As a workaround, we can simply accept that the quickstarts will change
our URL and destroy our router's location. Instead, we now put the image
id (its UUID) in the route itself. We can access it in the components as
necessary via the useParams hook.
Fixes#913.
This adds status bars to the `DualListSelectorPane` on the Packages step. The status bar indicates how many packages were found and how many of those have been selected.
Warning for too many returned results was also added. When an exact match is found during a search with over 100 results, it is shown together with the warning.
This migrates calls to RHSM endpoints `activation_keys` and `/activation_keys/{name}` to RTK Query.
Tests were also updated to use Mock Service Worker instead of previous Jest mock function.
Fixes#919.
This updates the Review step as per proposed mocks.
The tabs were replaced by expandable sections containing all the information relevant to a specific step.
This bumps user-event library by a major release and resolves the breaking changes.
Direct invocation of `userEvent` APIs (such as `userEvent.click()`and `userEvent.type()`) was replaced by calling the methods returned by `userEvent.setup()` as described here:
https://testing-library.com/docs/user-event/intro
Previously the base repository links for each distribution were read from `repos.js` file. This gets the needed information
from a call to api endpoint `architectures/{distribution}`. The data is fetched via RTK Query and is then filtered by an
architecture. For now the x86_64 architecture is hardcoded, this will change when multiple architectures get available.
Require const declarations for variables that are never reassigned after
being declared. If a variable is never reassigned, using the const
declaration is better. const declaration tells readers, “this variable
is never reassigned,” reducing cognitive load and improving
maintainability.
Fixes#911. Fixes#912.
This updates the File system step. The changes are:
- changed the toggle group for selecting the mode of partitioning to radio select and updated information for each radio button as mentioned in #911
- added information to the "automatic" option of the file system configuration as mentioned in #912
- updated information for the "manual" option of the configuration as mentioned in mocks
Moving to @redhat-cloud-services/frontend-component utilities broke
several tests, this commit fixes those tests.
Additionally, this commit bumps @patternfly/react-core and
@patternfly/react-table to versions 4.267.6 and 4.112.6, respectively.
This commit fixes#893 by removing the ability to clear the release
select on the image output step (this is the select where the user
chooses from RHEL 8, RHEL 9, CentOS 8 or 9, etc...).
Originally the ability to clear the select was added so that the default
state (where CentOS options are hidden behind a 'speedbump') could be
returned to but this seems unnecessary in retrospect and introduces
opportunities for bugs (as seen with the validation in #893) so it seems
wise to simply remove the ability to clear altogether.
Adds support for 3rd party repositories using the Red Hat Insights
Repositories app on console.redhat.com.
The packages step has been refactored heavily to reduce the bug surface
area and improve its reusability (it is now used in two Wizard steps).
New features related to the Repositories app are currently only exposed
in stage. Because stage and production are quite divergent (they have
different steps, for instance) there are separate test suites for the
production and stage versions of the Wizard. When these features are
moved into production, the two test suites can be merged into one.
'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.
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`
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 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.
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.
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.
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.