Commit graph

161 commits

Author SHA1 Message Date
regexowl
df9ec1499d V2Wizard: Fix FSC units on Edit
This updates the logic of parsing bytesize into size/unit pair.

Currently 'GiB' is set as a default which causes problem with smaller partitions on Edit.

A validation for the min_size is in place and the rule is that the size cannot be smaller than 0 of a given unit. If there was a partition with smaller size in KiB it will break the rule when converted to GiB.
2024-05-01 19:47:41 +02:00
lucasgarfield
f14b90cf9a V2 Wizard: Disable snapshotting in prod and stage stable
It will be better to keep the stable branches in sync as much as
possible. If snapshotting is only ready for prod-preview, we should only
expose it in stage-preview.
2024-04-30 17:13:10 +02:00
Andrew Dewar
547436c177 Wizard V2: Prevents snapshot step in prod-stable. 2024-04-30 17:13:10 +02:00
lucasgarfield
8049f95d82 V2 Wizard: Fix edit mode initialization for custom file systems
Properly initializes wizard state in edit mode when custom file system
is in use.
2024-04-30 15:13:50 +02:00
lucasgarfield
61b23216f4 V2 Wizard: OpenSCAP edit tests
Edit mode is now fully tested and working for OpenSCAP profiles. A
handler for the PUT request was added and the fixtures were updated to
support this.

`EditImageWizard.tsx`: Previously we dispatched `initializeWizard()`
while waiting for the blueprintDetails to load. This meant that the
state was incorrect (empty) while the blueprintDetails request was
in flight.

`requestMapper.tsx`: Correctly populate state in edit mode if the
blueprint contains a custom file system – previously custom mountpoints
were dropped and automatic mode was selected.

`spyOnRequest()`: Differentiate between request types (e.g. GET, PUT)
for the same endpoint.
2024-04-30 15:13:50 +02:00
regexowl
baf58829eb ESLint: Make no-unused-vars rule stricter
This switches the `no-unused-vars` from warning to error and fixes the errors this caused.
2024-04-30 10:48:55 +02:00
regexowl
6e9091fab1 V2Wizard: Consistent capitalisation
This converts all headings and subheadings to sentence case for the sake of consistency.
2024-04-29 16:55:29 +02:00
regexowl
f2daa9c358 V2Wizard: Reinitialize AWS/Azure/GCP after deselecting target
Fixes #1555

This reinitializes the state of AWS/Azure/GCP target after it's tile was deselected. This way the state for the target won't be hanging there.
2024-04-29 15:35:59 +02:00
regexowl
a4eeab7156 V2Wizard: Remove manual partitioning for ISO only images
This hides the "Manually configure partitions" option from the FSC step for blueprints which have only ISO selected as a target.

There is already an alert in place for cases when ISO is combined with another target.
2024-04-29 11:57:30 +02:00
regexowl
ff2d629fc6 V2Wizard: Show packages only with a search term
Fixes #2012

Packages from custom repos stayed in the table upon clearing the search input. This show the results only when searchTerm is not empty.
2024-04-26 16:45:37 +02:00
regexowl
e9d28498e1 constants: Move URLs to constants
Fixes #1923

This moves all URLs from code to constants.
2024-04-26 15:54:46 +02:00
lucasgarfield
bb91840eef V2 Wizard: Fix snapshot_date field
The snapshot_date in the image_request must be a date. snapshot_date is
an optional field and if no snapshot is used, the field should be
undefined. Previously it was an empty string and this caused image
builder to return a code 400 with message "Snapshot date is not in
DateOnly (yyyy-mm-dd) format".
2024-04-26 15:03:17 +02:00
Ondrej Ezr
7246cfbd16 WizardV2: pass module_hotfixes to the request 2024-04-26 13:59:20 +02:00
Andrew Dewar
3231b324f0 HMS-3796: Add snapshot date selection to wizard 2024-04-25 14:45:50 +02:00
regexowl
47a2653a9f V2Wizard: Deduplicate minimum size popover and set width
This sets a maximum width to the minimum size popover. Also moved code to a reusable component.
2024-04-25 12:14:43 +02:00
regexowl
99da1e2957 V2Wizard: Fix padding and size of <HelpIcon> button
This updates padding around the popover button on OpenSCAP step and makes all `<HelpIcon>` icons the default size so it's consistent throughout the Wizard.
2024-04-25 12:08:39 +02:00
regexowl
0846e4d975 V2Wizard: Convert index.js to .tsx
Fixes #1768

This converts index.js in V2Wizard to .tsx.
2024-04-25 11:56:25 +02:00
regexowl
100c5f7809 V2Wizard: Disable stig and stig_gui
Fixes #1971

This disables stig and stig_gui profiles which are currently broken.
2024-04-25 11:48:41 +02:00
regexowl
b6041d2022 V2Wizard: Add masked services to the "Disabled services" code block
Fixes #1985

This concatenates masked service to the disabled services so both get rendered in the "Disabled service" code block.

Test to check this was also added.
2024-04-25 11:40:17 +02:00
regexowl
b80d0fa3ae V2Wizard: Debounce package search
This debounces package search so it doesn't overwhelm content API with two requests for every character.
2024-04-25 11:32:47 +02:00
regexowl
473d750145 V2Wizard: Gate package recommendations
This gates package recommendations behind an unleash flag and preview.

The flag is `image-builder.pkgrecs.enabled`.
2024-04-25 11:22:08 +02:00
regexowl
648300ffb4 V2Wizard: Add Package recommendation to the Packages step
This adds an expandable with package recommendations to the Packages step.

The recommendations are populated when two or more packages are selected.
2024-04-25 11:22:08 +02:00
regexowl
2431d176ac V2Wizard: Fix padding around registration options
This updates the padding around registration options.
2024-04-25 10:05:45 +02:00
regexowl
7124a6e2e6 V2Wizard: Update copy on empty state
This updates copy on empty state when no packages are found with "Available" and "Included repos" toggled.

Copy on "Selected" and "Other repos" was also updated.
2024-04-24 17:43:56 +02:00
regexowl
817a813107 V2Wizard: Fix VMware popovers
The popovers for VMware sphere types were not buttons. This caused weird behaviour with "ban" cursor when disabled and not opening popover when enabled.
2024-04-24 13:48:37 +02:00
regexowl
74db28de8a V2Wizard: Re-use activation popover for Review step
I was bothered by the organization's id in Activation key popover not being separated by an empty line. While adding it I've noticed we duplicated the component on Review step. Cleaned up the code a bit and got rid of a useEffect.
2024-04-24 13:38:06 +02:00
regexowl
c0459cb975 V2Wizard: Add a specific empty state for "Other" toggle
This adds an empty state specific for "Other repos" toggle.
2024-04-24 11:05:52 +02:00
regexowl
8dd9d32475 V2Wizard: Add "Look under included" empty state
This adds a new empty state to the "Other toggle" for "Selected" packages which will inform user, that their added packages are under "Included repos".
2024-04-24 09:28:57 +02:00
regexowl
02ca8140c4 V2Wizard: Show selected packages in included repos
Previously when a package from an other repo was selected, it was still shown under "Other repos" toggle.

As a recommended repository gets added together with the package, it should be shown under "Included repos".
2024-04-24 09:28:57 +02:00
regexowl
562fb0df08 V2Wizard: Update wording on empty state
This updates the wording and buttons for empty state.
2024-04-23 17:04:04 +02:00
lucasgarfield
ddca8d7430 V2 Wizard: Disable back on first step (HMS-2781)
Disables the back button on the first step of the wizard. Disabling the
back button (as opposed to hiding it) is how the wizard works in the
Patternfly official examples.
2024-04-23 14:23:59 +02:00
lucasgarfield
a1bdcaa54f V2 Wizard: Fix OpenSCAP step
OpenSCAP profile info is now correctly loaded into the state and
verified to be in the final request with tests.

I modified the fixtures for the OpenSCAP profiles. My changes ensure we
have a Venn-diagram like overlap when changing from one profile to
another where one package is the same, one package is removed, and one
package is added. The same is true for the services and partitions. For
kernel args it is not so important as that is just a string (as opposed
to an array), so it is enough to be different.

I was able to eliminate a useEffect by replacing it with a lazy query
trigger function. Setting the second arg `preferCacheValue` to `true`
means that a request is only made if cached data is not available.

I modified the Redux reducers a bit to add some additional safety.

`changeFileSystemPartitionMode` is now responsible for initializing the
partitions field in the state by adding the root partition – previously
this was done in the components themselves by dispatching
`addPartition`. This reducer can always be safely dispatched – if the
mode is ‘manual’, dispatching it with a payload of ‘manual’ will not
result in any changes to the state.

`addPackage` is also safer now. When a package is added, the list of
packages is checked. If there is a package with an identical name, the
new package overwrites the previous package. This is useful because the
description may be different for the same package – for instance, when
adding an OpenSCAP package, we use a custom description (‘this package
required by OpenSCAP’).
2024-04-23 10:02:03 +02:00
regexowl
af5d99324d V2Wizard: Update wording on repo removal modal in Edit mode
This updates wording on a repo removal modal in Edit mode as per UX feedback.
2024-04-22 13:43:06 +02:00
regexowl
9f04b4f5e4 V2Wizard: Update save button
This removes the second "Save" from a save button on Review step.
2024-04-22 13:37:40 +02:00
regexowl
13c21d0eff V2Wizard: Update repo removal alert and modal
This updates alert and modal based on UX feedback.
2024-04-19 16:26:27 +02:00
regexowl
250f84ae9d V2Wizard: Add alert when removing repos in Edit mode
When in Edit mode an alert is displayed on the Repository step warning users, that removing repository and leaving packages from it added is not recommended.

A modal pops up when deselecting a repository to make user aware they may be breaking their blueprint.
2024-04-19 14:37:25 +02:00
regexowl
bd2860890a V2Wizard: Add wizardMode to the state
This adds a new field called `wizardMode` to the state. This field can have two possible values: `create` and `edit` and it indicates whether the Wizard was opened in Create or Edit mode.
2024-04-19 14:37:25 +02:00
regexowl
2fa2c0efa6 V2Wizard: Add recommended repositories to compose request
This adds recommended repositories to the custom and payload repositories in the compose request.
2024-04-19 14:06:43 +02:00
regexowl
c56a011443 V2Wizard: Select a repository when added from recommendations
This selects a repository on the Custom repositories step when it's added on the Packages step from the recommendations.

The check box is also disabled as removing the repository would have to trigger removal of the added packages as well.

And expandable with explanation about the disabled check box was added.
2024-04-18 18:04:48 +02:00
Ondrej Ezr
709ae39d23 WizardV2: Validate steps through redux state
Store validation status in redux state.
This is bit complex on the redux side, but pretty simple on the components.
It allows for reuse of the validation state instead of revalidating wherever needed.
2024-04-18 10:01:06 +02:00
regexowl
dbeee5d066 V2Wizard: Differentiate between Create and Edit mode on Review step
This renames actions on the primary button on Review step for the Create mode so it's clear whether you're creating a blueprint from a scratch or saving changes to an already existing blueprint.
2024-04-17 18:46:49 +03:00
Ondrej Ezr
1b4bb9869e WizardV2: use the alert color darker 2024-04-16 20:56:32 +03:00
Jakub Rusz
68bfa8c351 V2Wizard: Add ouiaId for FileSystemTable
Need this to distinguish it from the table in V1.
2024-04-16 18:06:05 +03:00
regexowl
8a7d15e54d V2Wizard: Update Registration copy
Noticed there's been a small change in the copy of Registration steps as per Blueprints SPUR. This updates the text.
2024-04-16 11:59:31 +02:00
lucasgarfield
782a8eba7e V2 Wizard: Add custom file system to request customizations (HMS-3690)
The blueprint request now contains a field for the filesystem in its
customizations.
2024-04-16 10:02:19 +02:00
Jakub Rusz
eb82a6b72b V2Wizard: Add ouiaId to ValidatedTextInput 2024-04-15 19:16:21 +02:00
Jakub Rusz
fc9a119933 V2Wizard: Update ouiaIds for File system configuration
Making it consistent with V1 wizard.
2024-04-15 18:21:32 +02:00
regexowl
70b7ab7e29 V2Wizard: Update wording on "Custom repo" modal
This updates the wording on "Custom repositories will be added to your image" modal, informing the user, that the repository will get enabled in Content as well, if it wasn't enabled before.
2024-04-12 12:45:36 +02:00
regexowl
16ab5b37c5 V2Wizard: Add recommended repo to the repo table on Review
This adds the recommended repository to the table of repositories on the Review step.
2024-04-12 12:45:36 +02:00
regexowl
b7f6393be9 V2Wizard: Allow enabling repos and update state logic
This commit contains two changes:
1. When a package from popular repository gets added, the EPEL repository gets enabled in content services in case it wasn't before.
2. The logic of rendering states for the different toggle combinations on Packages step got updated.
2024-04-12 12:45:36 +02:00