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 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.
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.
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.
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.
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.
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 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.
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
Fixes#795. This commit adds rules to `.eslintrc.yml` which enforce sorting of the import declarations.
Added plugin `eslint-plugin-import` allows to sort the import declarations based on their types (builtin, external, internal, etc.) and rule `sort-imports` then sorts the declarations inside these groups alphabetically.
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.
This adds the ability to use our Schutzbot Gitlab CI and run Sonarqube
scan there. We have pretty much the exact same thing in weldr-client
repo and use it only for Sonarqube. This could also be used in the
future if there is any need to use our own CI.
The added scan is just informative and is by no means supposed to be
used to gate PRs, there will be just one more link to
check the results in case anyone is interested.
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.