Commit graph

55 commits

Author SHA1 Message Date
regexowl
2bed43645d V2Wizard/test: Fix bug on registration step and enable tests
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
2024-03-01 10:49:43 +01:00
lucasgarfield
e923cccd41 V2Wizard/Repositories: Add payload_repositories to request and test it
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.
2024-03-01 10:02:52 +01:00
regexowl
08563b9dfa V2Wizard/test: Add autofocus to radios and enable Keyboard accessibility tests
This adds `autoFocus` attribute to radios on AWS, Azure and GCP step.

The Keyboard accessibility tests have been re-enabled.
2024-03-01 09:38:47 +01:00
mgold1234
89bee6a723 V2Wizrd: clean resource group when user change the source name
this commit fix https://github.com/osbuild/image-builder-frontend/issues/1691
when user change the source name, resource gruop should clean up
2024-03-01 09:14:18 +01:00
mgold1234
3118fc0112 v2Wizard : Add Azure to review 2024-02-29 15:29:03 +01:00
regexowl
8b224a0327 V2Wizard: Remove bulk select and refresh button from the Packages step
This removes bulk select and a refresh button from the Packages step and updates tests accordingly.
2024-02-29 12:39:09 +01:00
regexowl
d9f9c61307 V2Wizard: Add packages to requestMapper
This adds packages to the request mapper in a needed format - a flat list of package names.
2024-02-28 17:17:00 +01:00
regexowl
2c6c326677 V2Wizard: Add packages to the Review step
This adds packages counter and a table of packages in a popover to the Review step.

The name of the field was also updated to "Additional packages".
2024-02-28 17:17:00 +01:00
regexowl
af80b78e93 V2Wizard: Add Packages step
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.
2024-02-28 17:17:00 +01:00
regexowl
ac4a0829e2 V2Wizard: Add Packages step to the Wizard
This adds Packages to the new Wizard as a substep of the Content step.
2024-02-28 17:17:00 +01:00
regexowl
607bd6ed45 V2Wizard: Create a folder for Packages step
This creates a new folder for the Packages step and copies over needed file:
- Packages.tsx
2024-02-28 17:17:00 +01:00
lucasgarfield
a22f0deacc V2 Wizard: Fix AWS account id in review step (HMS-3553)
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).
2024-02-28 14:33:11 +01:00
mgold1234
ba42cceac4 V2Wizard: add azure case to the requestMapper 2024-02-28 12:10:00 +01:00
mgold1234
f77cc39135 V2Wizard: add all necessary components 2024-02-28 12:10:00 +01:00
mgold1234
fa016c3228 V2Wizard: Create a folder for Azure step and copy needed components
This created a new folder for the Azure step and copies components that will be needed:
- AzureAuthButton.tsx
- AzureResouceGroups.tsx
- AzureSourcesSelect.tsx
2024-02-28 12:10:00 +01:00
regexowl
5ab0b6511b Blueprints: Add guest-image and vsphere-ova to requestMapper
This adds guest-image and vsphere-ova as possible target environments to the requestMapper.
2024-02-27 15:09:39 +01:00
lucasgarfield
8c31e6f54f V2Wizard/Registration: Add request assertion tests
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`.
2024-02-14 17:01:52 +01:00
mgold1234
40b1d4de57 v2Wizrd: add kernel and services data
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.
2024-02-12 17:12:26 +01:00
Amir
74f71f2dca Blueprints: Add handler for creating new blueprint 2024-02-12 15:12:14 +01:00
mgold1234
07cfaf2ccf feat(HMS-3566) V2Wizrd: fix titles at aws step 2024-02-09 11:47:18 +01:00
mgold1234
61abf24644 V2Wizard: fix ReleaseLifecycle component in the Review step
this commit fix https://github.com/RedHatInsights/image-builder-frontend/issues/1615
add the relevant data to release lifeCycle at review step
2024-02-07 08:40:24 +01:00
mgold1234
c80e933c2c V2Wizard: Create a folder for Review step and copy review component and enable tests
This created a new folder for the Review step and copies components that will be needed:
- ReviewStep.tsx
- ReviewStepTables.tsx
- ReviewStepTextLists.tsx
2024-02-06 14:16:16 +01:00
mgold1234
854d87c2f2 Resolve Controlled Component Error by Initializing with Empty Strings
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.
2024-01-30 10:58:48 +01:00
regexowl
8a178f5b7d V2Wizard: Add components to the Repositories step skeleton
This adds needed components to the Repositories step skeleton.
2024-01-26 14:04:56 +01:00
regexowl
3c441425bb V2Wizard: Add checkRepositoriesAvailability
This adds checkRepositoriesAvailability.ts to a newly created `utilities` folder.
2024-01-26 14:04:56 +01:00
regexowl
7fe7919dfa V2Wizard: Add Repositories step to the Wizard
This adds Content as a step and Repositories as a substep to the Wizard.
2024-01-26 14:04:56 +01:00
regexowl
e854ee390c V2Wizard: Create a folder for Repositories step
This creates a new folder for the Repositories step and copies over all needed files:
- Repositories.tsx
- RepositoriesStatus.tsx
- RepositoryUnavailable.tsx
2024-01-26 14:04:56 +01:00
dependabot[bot]
f081ca78b0 V2Wizard: add Details step to wizrd2
this commit add Details step to v2Wizard
2024-01-25 12:48:25 +01:00
mgold1234
c4e1709de8 V2Wizard: add oscap to wizard2
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
2024-01-24 13:36:04 +01:00
regexowl
360984df7c V2Wizard: Add components to the Registration step
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.
2024-01-17 09:33:13 +01:00
regexowl
9ce438295d V2Wizard: Create a folder for Registration step and copy needed components
This created a new folder for the Registration step and copies components that will be needed:
- ActivationKeyInformation.tsx
- ActivationKeys.tsx
- Registration.tsx
- RegistrationKeyInformation.tsx
2024-01-17 09:33:13 +01:00
lucasgarfield
d26a7658db V2Wizard: Fix wizard initializeWizard action
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.
2024-01-16 17:23:22 +01:00
regexowl
55686cc844 V2Wizard: Improve validators
Follow up to https://github.com/RedHatInsights/image-builder-frontend/pull/1548

This cleans up implementation for the AWS account ID ad GCP e-mail validators.
2024-01-15 17:37:28 +01:00
lucasgarfield
ce23667833 V2Wizard: Add datatest-id support to <ValidatedTextInput>
Adds a `dataTestId` prop to the `<ValidatedTextInput>`.
2024-01-15 16:42:28 +01:00
lucasgarfield
698037a7dc V2Wizard: Uncomment relevant GCP tests and add data-testids
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.
2024-01-15 16:42:28 +01:00
lucasgarfield
5a3726a4c8 V2Wizard: Update GCP validator and state management
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.
2024-01-15 16:42:28 +01:00
lucasgarfield
7c8cfe7f63 V2Wizard: Add <Gcp> step
`<Aws>` state is now managed with RTK instead of DDF.
2024-01-15 16:42:28 +01:00
lucasgarfield
9953207d25 V2Wizard: Refactor Aws step
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.
2024-01-11 09:22:18 +01:00
lucasgarfield
091c34431e V2Wizard: Implement <Aws> subset of Image Output step
DDF has been dropped, RTK being used for state management now.
2024-01-11 09:22:18 +01:00
lucasgarfield
e5c55828e3 V2Wizard: Copy <AwsSourcesSelect> and convert to Typescript
No changes made, file simply copied so future commits have clear diffs
when dropping DDF.
2024-01-11 09:22:18 +01:00
lucasgarfield
f778b5431c V2Wizard: Create foundation for Target Environments substep AWS
Substep for an AWS target environment created in wizard, component to
follow in subsequent commit.
2024-01-11 09:22:18 +01:00
lucasgarfield
f41f3c51b7 V2Wizard: Add <CentOSAcknowledgement> to Target Output step
The state from RTK is now used to determine whether or not to display
the CentOS acknowledgement.
2024-01-08 11:59:23 +01:00
lucasgarfield
779416785f V2Wizard: Correctly enable/disable Next button for Image Output step
The 'next' button is now disabled if no target environments are selected
on the Image Output step.
2024-01-08 11:59:23 +01:00
lucasgarfield
a3ef0cc2f7 V2Wizard: Add <TargetEnvironment> to Image Output step
DDF has been dropped from `<TargetEnvironment>`, state is managed with
RTK.
2024-01-08 11:59:23 +01:00
lucasgarfield
937219ba51 V2Wizard: Add <ArchSelect> to Image Output step
This commit drops the DDF dependency from the `<ArchSelect>`.
2024-01-08 11:59:23 +01:00
lucasgarfield
1f38ce5187 V2Wizard: Add <ReleaseLifecycle> to Image Output step
The `<ReleaseLifecycle>` component has dropped DDF and now uses RTK.
2024-01-08 11:59:23 +01:00
lucasgarfield
ad2bd7a31a V2Wizard: Add <ReleaseSelect> to Image Output step
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.
2024-01-08 11:59:23 +01:00
lucasgarfield
2465ab4b84 V2Wizard: Add <ImageOutput> skeleton
Adds the foundation for the image output step.
2024-01-08 11:59:23 +01:00
lucasgarfield
b446f1d1e4 V2Wizard: Copy components needed for image output step
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.
2024-01-08 11:59:23 +01:00
lucasgarfield
bb6bf51068 V2Wizard: Add <CreateImageWizard>
Adds the scaffolding for the V2 wizard, only empty Image output and
Review steps present at this time.
2024-01-08 11:24:54 +01:00