Commit graph

706 commits

Author SHA1 Message Date
lucasgarfield
f089080cb1 V2Wizard: Copy original wizard tests
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.
2024-01-08 11:24:54 +01:00
lucasgarfield
e1f66dd444 V2Wizard: Clean up for a fresh start
To make code reviews easier, these files are being removed for now. They
will be added back over time in a way that results in clearer diffs.
2024-01-08 11:24:54 +01:00
regexowl
3ac435db85 ImagesTable: Remove unused Skeleton
This removes an unused compoment from the imports.
2024-01-05 12:25:10 +01:00
regexowl
b3fade4a5f fixtures: Update repositories fixture based on the API generated code
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[]`.
2024-01-05 09:41:10 +01:00
regexowl
2ae670bf35 store: Run code generation after codegen-openapi version bump
These changes were made by running `npm run api` after a version bump of @rtk-query/codegen-openapi from 1.0.0 to 1.2.0
2024-01-05 09:41:10 +01:00
mgold1234
1b39c30dc2 wizard/oscap: update the oscap step to latest specifications
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
2024-01-04 13:38:27 +01:00
mgold1234
f597b6b854 fsc: fix array-callback-return linting warnings
this comit fixes the array-callback warning by changing map to foreach
and return null to the second map
2024-01-03 16:15:53 +01:00
mgold1234
262ac6d3be ImagesTable: fix grey box under AMI when image build is in progress
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.
2024-01-03 08:51:14 +01:00
regexowl
d96ebc9b3e store/test: Remove unused code
This cleans up the code base by removing actions and slices which are no longer in use.
2023-12-21 15:48:36 +01:00
regexowl
850e77eb01 API/test: Remove getVersion() Axios call
This removes `getVersion()` API call previously used in Axios.
2023-12-19 15:36:49 +01:00
regexowl
b427c1a310 Wizard/test: Remove unused variables
This removes unused variable from the code.
2023-12-19 09:17:01 +01:00
Thomas Lavocat
33723c8a7d api/imageBuilder: fix the alert in case of failure
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.
2023-12-18 09:03:30 +01:00
Thomas Lavocat
888630acea wizard: remove unused code from the implementation
There were some leftovers that needs to be removed. This commit simply
cleans them up.
2023-12-13 16:36:21 +01:00
regexowl
e7dee1edfe api: Remove unused Axios API calls
This removes Axios API calls which were replaced by RTK Query.
2023-12-12 13:09:31 +01:00
regexowl
79a0060697 store: Remove actions.js
This removes the `actions.js` file and its mocking from the LandingPage test as these actions are no longer used.
2023-12-12 12:25:16 +01:00
lucasgarfield
fabd3e015a redux store: define typed useSelector and useDispatch hooks
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
2023-12-08 09:37:25 +01:00
regexowl
44bb6f62ff test: Add a test checking if release lifecycle chart renders correctly
This adds a test that checks if the release lifecycle chart rendered only when RHEL 8 release is selected.
2023-12-07 19:39:58 +01:00
regexowl
c11f80188e test: Update release select option to partial match
With description added to the RHEL release options in Release select every query using name needed to be updated from full to partial match.
2023-12-07 19:39:58 +01:00
regexowl
014a0c1d70 Wizard: Add description to RHEL release options
This adds a description to RHEL options in the Release select on Image Output step as per mocks.
2023-12-07 19:39:58 +01:00
regexowl
f6d1b12b3c Wizard: Add annotation for current date
This adds a line annotation to mark the current date.
2023-12-07 19:39:58 +01:00
regexowl
51f68bda34 test: Mock ResizeObserver
This adds mocked ResizeObserver to the jest setup so the tests don't fail on charts created with Chart.js.
2023-12-07 19:39:58 +01:00
regexowl
fd30e5b634 Wizard: Add release lifecycle charts
This adds information about release lifecycle to the Image Output step of the Wizard. Summary is also shown on the Review step.
2023-12-07 19:39:58 +01:00
Sanne Raymaekers
2b29275c2a CreateImageWizard: move oci to stable
Move the oracle cloud infrastructure PR to stable.
2023-12-07 17:01:51 +01:00
regexowl
3e07472826 Wizard/ImagesTable/test: Change "VMWare" to "VMware"
The "w" in VMware should be lower case, this updates it in all places.
2023-12-05 13:20:42 +01:00
Sanne Raymaekers
cea1caf175 CreateImageWizard: proprely gate WSL images
`isBeta` is a function, so the check would also return true in stable.
2023-12-04 15:06:28 +01:00
regexowl
e011c4ba0b test: Await asynchronous setUp()
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.
2023-12-04 11:28:16 +01:00
lucasgarfield
c7dd831645 API: Update image-builder API
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
2023-12-04 10:48:29 +01:00
Sanne Raymaekers
31d286aac3 test/CreateImageWizard: Test compose requests sent by wizard 2023-12-01 13:11:07 +01:00
Sanne Raymaekers
ae7178158e CreateImageWizard: Fix passing gcp upload_options
Upload options were added in the wrong place, this inserts them back
into the correct place.

Also see #1355.
2023-12-01 13:11:07 +01:00
Lucas Garfield
223be1f3fd Update src/Components/CreateImageWizard/steps/fileSystemConfiguration.js
Co-authored-by: Klara Simickova <49452678+regexowl@users.noreply.github.com>
2023-11-29 12:52:48 +01:00
lucasgarfield
f5039dea3c Wizard: Fix HMS-2036, bug in file system customization steps
Information about automatic partioning was also being displayed when
manual partioning was selected. This commit fixes the bug.
2023-11-29 12:52:48 +01:00
regexowl
39531bf2bb api: Update imageBuilder api schema
This includes an update to the imageBuilder api schema and changes generated by `npm run api`.
2023-11-28 13:01:00 +01:00
regexowl
ab1987660e Wizard: Add client_id to compose requests
This adds `client_id` value to compose requests for the purpose of differentiating between images created in UI and those created directly via api.
2023-11-28 13:01:00 +01:00
regexowl
62673813e2 test: Remove out-of-date comments
This cleans up comments in tests and removes all that are no longer relevant.
2023-11-27 13:52:20 +01:00
regexowl
1fc0aca5b2 Wizard: Activation key management link based on env
The "Activation keys page" link on the Registration step previously led to prod from both prod and stage envs.

This fixes the problem and ensures that the button in stage links to the activation key management in stage and the prod one to prod.
2023-11-24 15:28:51 +01:00
regexowl
44195c5334 Wizard: Remove hard coded architecture from OCI request
This replaces hard coded 'x86_64' architecture with the value based on a form state for OCI images.
2023-11-24 09:08:00 +01:00
Sanne Raymaekers
b60c37f1f8 ImagesTable: show architecture of composes 2023-11-23 17:55:43 +01:00
regexowl
ac357f4e13 Wizard: Remove hardcoded architecture
This updates requests that contained hardcoded value `x86_64` as an architecture.
2023-11-23 17:02:26 +01:00
Amir Fefer
16cf421c68 feat(HMS-2789): simplfy activation key creation 2023-11-23 16:19:07 +01:00
Sanne Raymaekers
6739851897 CreateImageWizard: package search through correct architecture
Instead of always searching through x86 repos, search through the repos
of the selected architecture. This fixes HMS-3066.
2023-11-22 13:19:34 +01:00
regexowl
e60afdbe27 Wizard: Add temporary alert about /usr sub-directories
This adds an alert to the File system configuration step that informs about newly disables `/usr` sub-directories.

It can be removed in two weeks after all the images with possible erroneous mount points are removed.
2023-11-22 11:47:23 +01:00
regexowl
c2cd4bed97 Wizard: Replace /usr path with sub-directories by /usr on Recreate
Sub-directories for `/usr` prefix are no longer supported in file system configuration. This replaces the possible erroneous path with a valid one so the user is not able to send an invalid image request via Recreate action.
2023-11-22 11:47:23 +01:00
regexowl
3036577b31 fixtures: Add file system configuration to an existing mock
This adds basic file system configuration including an `/usr` sub-directory to an already existing mock.
2023-11-22 11:47:23 +01:00
regexowl
0ea2696ac5 fixtures: Update image names
This updates the names of images to how should they look like according to the image name validation rules in Wizard.

"The image name can be 3-63 characters long. It can contain lowercase letters, digits and hyphens, has to start with a letter and cannot end with a hyphen."
2023-11-21 15:27:02 +01:00
mgold1234
9ab3d45f99 Wizard: add all/selected toggle buttons to custom repository step
This commit resolves #1201.
It adds a toggle to the repositories step that allows users to toggle
between all and selected repositories.
2023-11-21 14:43:32 +01:00
mgold1234
b8c634eac0 fix some lint warning message 2023-11-20 09:37:12 +01:00
lucasgarfield
d7bfb8efef Tests: Fix flake in recreate image tests
The getBy selector in this test caused tests to flake in CI, changing to
findBy should prevent flakes.
2023-11-16 16:25:52 +01:00
lucasgarfield
0405eda319 Wizard: Fix HMS-3031, bug in Package's step search
This fixes a bug in the packages step search where hitting enter causes
the wizard to re-render and reset to the first step.
2023-11-16 16:25:52 +01:00
lucasgarfield
196e358aa3 Wizard: Fix eslint warnings in Packages step
Most of these fixes are required because of the exhaustive dependencies
rule.
2023-11-16 16:25:52 +01:00
Sanne Raymaekers
f1141ec698 src: add RHEL 8.9 2023-11-16 14:44:21 +01:00