We encountered a number of bugs with the previous implementation where
going to the next or previous step and returning to the AWS step
resulted in incorrectly displayed information about the selected source,
etc...
All state that needs to be available during the entire wizard life cycle
has been moved to RTK.
This commit addresses warnings related to the react-hooks/exhaustive-deps rule.
It resolves these warnings by adding the missing dependencies to the useEffect hook.
Listeners are used to monitor changes to the release (aka distribution)
and architecture. If either of these values is changed, the listener
will correct the list of target environments by removing unsupported
targets. e.g. aarch64 images do not support azure, if azure is a
selected target and the arch is changed from x86 to aarch64, azure will
be removed from the list of selected targets.
The `<ReleaseSelect>` component now uses RTK instead of DDF. Some
additional small changes were necessary due to Typescript - in
particular, we use a Map() to store the releases (in order to ensure
they appear in the correct order) and .tsconfig had to be modified to
allow iteration over the Map() object.
The components for the architecture select, centos acknowledgement,
release select, and target environement have been copied and converted
to Typescript files. When these files are modified in future commits,
the result will be a clean diff where all changes made are obvious.
The tests have been converted from .js to .tsx and all lines have been
commented out. As steps are added to the wizard, the relevant lines will
be uncommented. The V2 wizard can be considered finish when all
commented lines have been removed. Proceeding this way (as opposed to
starting with an empty test file and adding tests back) will help us
ensure we do not accidently 'drop' a test.
This updates the type of `testingRepos` fixtures from `ApiRepositoryResponse[]` to `ApiRepositoryResponseRead[]`.
The new type was added automatically after bumping @rtk-query/codegen-openapi to a higher version. The difference between the types is the uuid field which is not a part of `ApiRepositoryResponse[]`.
Before, in the Oscap step, the drop down select menu was only listing profile_ids
Now, it shows the profiles names. When the user selects one, the details about the
profile are displayed under the selection, improving user experience.
FIXES# HMS-3087
Previously a Skeleton component was used as a placeholder for an AMI when the build was still pending.
This removes the Skeleton and returns undefined rendering the AMI as empty.
When a compose request was failing, the promises callback function was
crashing. The reason was because of a misuse of the error object. This
commit simply puts back the correct `path` to access the values within
the error object to fix it.
From the RTK docs:
```
Using configureStore should not need any additional typings. You will,
however, want to extract the RootState type and the Dispatch type so
that they can be referenced as needed. Inferring these types from the
store itself means that they correctly update as you add more state
slices or modify middleware settings.
----------------------------------------------------------------------
While it's possible to import the RootState and
AppDispatch types into each component, it's better to create pre-typed
versions of the useDispatch and useSelector hooks for usage in your
application. This is important for a couple reasons:
For useSelector, it saves you the need to type (state: RootState)
every time
For useDispatch, the default Dispatch type does not know about
thunks or other middleware. In order to correctly dispatch thunks,
you need to use the specific customized AppDispatch type from the
store that includes the thunk middleware types, and use that with
useDispatch. Adding a pre-typed useDispatch hook keeps you from
forgetting to import AppDispatch where it's needed.
```
source:
https://react-redux.js.org/using-react-redux/usage-with-typescript#define-root-state-and-dispatch-types
This adds await to call of asynchronous `setUp()` function. Previously this wasn't awaited which sometimes caused the tests to continue without being properly set up first.
This commit updates the image-builder API due to these two recent
changes:
A new type added for the ClientId, used when differentiating between API
and UI users.
fce3d1c355
OpenSCAP profile names and descriptions.
1d292917d1