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.
Bring in a review step in the wizard. The purpose is to incrementally
develop it while new steps are added to the mix. This way the Wizard
gets to be integration testable from the early beginning.
Right now the review step is only showing information about the Image
Output step. Even though the Image Output step contains data about the
target environment, these information are going to need the Target
Environment step to be developed in order to be fully shown.
Port the image output step to the new wizard v2.
This is also the first step in the new redesigned wizard and this commit
message is an opportunity to detail a bit the organisation of it:
The code is organised as followed:
- CreateImageWizard is the root and contains all the code associated
with the PF wizard. (i.e Wizard and WizardStep).
- Each step has its code under the step/ sub directory.
- The step directory is named after the step (i.e ImageOutput for the
Image Output step
- At the root of the step directory there is a file which contains the
code of the step (i.e ImageOutput.tsx).
- The main component of the step can access many subcomponents and they
have to be stored alongside it in its directory.
State management:
- The state management is only done with react use states, prop drilling
and state lifting. This is to ensure simplicity as it makes the wizard
- If necessary in the future, there might be needs for context and
reducers, but it's quite not the case RN. And using them come at the
cost of making exploring the code harder.
- CreateImageWizard will declare all the states
Developing a new wizard will require many pull requests and some of them
might even be worked on in parallel. To allow to develop all of that
without interfering with the legacy wizard this commit introduces a new
dev environment alongside an unleash flag when we later want to do the
switch.
To use the new dev en use `npm run stage-beta:experimental` or `npm run
stage-beta:msw+experimental` depending on what you want.
Then unleash flag to toggle in stage and prod is: `image-builder.new-wizard.enabled`
fixes: HMS-2859