This fixes a bug on the registration step which made the text "Connect to Red Hat Insights" not to get rendered when registering with rhc.
All registration tests were also enabled in CreateImageWizard.test.tsx
Previously the V2 Wizard's request mapper was only adding the
custom_repositories field. We also need to add a nearly duplicate
payload_repositories field due to how the image-builder API works...
which is admittedly not intuitive.
Tests are also added to ensure that requests are generated correctly
when using the custom repositories feature.
Previously we've used two steps for adding packages - the Additional Red Hat packages and Additional Custom packages steps. This merges the two steps into one.
Also the steps originally used `DualListSelector` to show the packages options, this was now migrated to the packages `Table` which makes the step visually consistent with the Repositories one. Although the functionality is a bit different.
Repositories step fetches the complete list of repositories right at the beginning and then mutates it by filtering. The Packages step fetches the data based on a search term which means that the "All" table gets overwritten by new values anytime a new term is searched.
Previously used axios API calls were also migrated to RTK Query for the purpose of consistency.
The AWS account id was not displayed correctly in the review step in the
case that a source was being used. This commit fixes the issue. When a
source is used, the AWS account id is fetched as before in order to
display it on the AWS step - but that value is also now dispatched to
the store so it can be referenced later (like in the review step).
This created a new folder for the Azure step and copies components that will be needed:
- AzureAuthButton.tsx
- AzureResouceGroups.tsx
- AzureSourcesSelect.tsx
We need to start using `undefined` as the default state for when a value
has not been defined. Previously we had used things like `’’` for string
typed values. But this causes problems later when generating the request
we send to image-builder. Using `undefined` is explicit and will make
generating the requests much easier (as we don’t need to check for `’’`,
determine the intent, and convert it to undefined if necessary).
Explicit is better than implicit.
With that in mind, tests have been added to ensure that the correct
request is sent to the API for every option on the Registration step.
This is facilitated using a new `spyOnRequest()` function. In the
future, we will have similar tests for the rest of the steps.
A few other minor things:
1. We need to get the `store` using `useStore()`
for when we later call `store.getState()` because the tests use a different
store that is configured in the renderer than the one we were importing.
2. In the wizardSlice, a new type RegistrationType is added that provides
additional type safety instead of using `string`.
this commit adds kernel arguments and enabled/disabled services to Oscap step.
and also add to Review step, add some tests to kernel and services as well.
This created a new folder for the Review step and copies components that will be needed:
- ReviewStep.tsx
- ReviewStepTables.tsx
- ReviewStepTextLists.tsx
This commit fixes the "A component is changing an uncontrolled input to be controlled" error in React components by ensuring input values are consistently initialized as strings. Previously, values initialized as undefined led to inconsistencies in controlled component behavior. By initializing with empty strings or using value={someValue ?? ''}, we ensure that input components remain controlled throughout their lifecycle, complying with React's expectations for controlled components and enhancing overall component stability.
This creates a new folder for the Repositories step and copies over all needed files:
- Repositories.tsx
- RepositoriesStatus.tsx
- RepositoryUnavailable.tsx
This adds the OpenSCAP step to the V2Wizard,
adds new values to the wizardSlice and enables relevant tests in the `CreateImageWizard.test.tsx` test suite
This migrates all the needed components from Javascript and DDF to Typescript and RTK.
New slices were added for registration type and activation key.
Disabling the "Next" button should work correctly now.
This created a new folder for the Registration step and copies components that will be needed:
- ActivationKeyInformation.tsx
- ActivationKeys.tsx
- Registration.tsx
- RegistrationKeyInformation.tsx
Fixes#1552.
The wizardSlice's initializeWizard action was not working because when it
was passed to `dispatch()` as an argument it was missing the `()`...
oops!
It also needs to be dispatched inside of a useEffect hook with an empty
dependency array so that it is only dispatched once, when the wizard
opens.
The tests have not been modified at this point, only uncommented, so the
next commit will have a clear diff.
Some data-testids were added to radio selectors and the Google principle
input as well for use in the tests.
The e-mail validator now requires a domain.
Switching from 'withGoogle' to 'withInsights' now sets the other GCP
related options to 'undefined' in order to keep the store state such
that it accurately reflects the current wizard state.
This is done in the reducer, not via a listener. That is a bit
inconsistent with the current listeners in place but this is an evolving
design and the inconsistency is acceptable for now. We may either accept
it, move the reducer actions here into listeners, or move the existing
listeners into reducers at some point in the future.
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.
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.