Commit graph

421 commits

Author SHA1 Message Date
regexowl
076fb3fc9d src: Resolve type-only imports 2024-10-11 14:55:03 +02:00
regexowl
4e23c476e8 Wizard/test: Implement keydown for target tiles
This implements onKeyDown functionality for the Public cloud tiles, allowing selecting them with a Space key.

Corresponding test was also re-enabled.
2024-10-10 08:47:49 +02:00
regexowl
d46f6b83ac Wizard: Fix repos toggle height
The repos toggle height was slightly bigger than the Available/Selected toggle. This was caused by the popover button. Changes its size to small to fix the issue.
2024-10-08 16:44:36 +03:00
regexowl
f33a050120 Wizard: Default to Included repos in package search
Previously when you searched for package from repositories recommendations and switched to "Other repos", new search left you in Other repos and didn't show results even if they were found in "Included". Since we search for recommendations only when no matches were found in distro and custom repos, the results will be always empty.

This solves the problem by defaulting to "Included repos" toggle with every new search, limiting clicks required from the user.

How to reproduce previous behaviour:
1. search for 'gnuplot' packages
2. no results should be found, switch to "Other repos"
3. search for a distro/custom repo package like "vim"

Previous behaviour - the "Other repos" toggle is still selected, showing no results. When switching to "Included repos" manually, the results can be found there.

New behaviour - "Included repos" gets automatically selected, showing results for packages found in distro and custom repos.
2024-10-08 12:39:12 +03:00
regexowl
bde02b7eec Wizard: Fix incorrect aria labels
This updates previously incorrect aria labels for VMware popovers.
2024-10-07 10:48:55 +03:00
Dominik Vagner
2ef545111f Wizard: remove no repos selected message 2024-09-30 16:58:08 +02:00
Florian Schüller
faa3385054 CreateImageWizard/requestMapper: fix enabling firstboot
Reorder the code to be easier to read:

when there none of service.{enabled|masked|disabled}
firstboot also is not enabled (if requested)
this patch fixes this bug
2024-09-30 10:14:11 +02:00
Florian Schüller
bd8eaaf8b9 CreateImageWizard/requestMapper: fix enabling firstboot
when there none of service.{enabled|masked|disabled}
firstboot also is not enabled (if requested)
this patch fixes this bug
2024-09-30 10:14:11 +02:00
regexowl
acbb07ad53 Wizard: OpenSCAP profile is not a mandatory field
OpenSCAP profile was marked as a mandatory field, this removes the red asterisk as the profile is optional.
2024-09-25 17:37:33 +02:00
Sanne Raymaekers
cbb9598f1d Wizard: clear compliance data when switching between types
When switching between openscap and insights compliance, clear the data
so the profile information isn't showing anymore.
2024-09-25 15:26:09 +02:00
Sanne Raymaekers
4c6d277ff1 test: add test for insights compliance step 2024-09-25 15:26:09 +02:00
Sanne Raymaekers
70635c8445 Wizard: adapt file system step to new compliance state 2024-09-25 15:26:09 +02:00
Sanne Raymaekers
0908cd2ae9 Wizard: add compliance step to the wizard
The title is changed depending on the flag, to make it easier to change
the IQE tests.
2024-09-25 15:26:09 +02:00
Sanne Raymaekers
e43357bf55 Wizard: add compliance step
The Insights compliance support reuses most of the existing OpenSCAP
step.

Depending on the state of the feature flag, it will show radio buttons
allowing users to switch between regular openscap and Insights
compliance.
2024-09-25 15:26:09 +02:00
Sanne Raymaekers
571fe18861 Wizard: support compliance in Oscap/OscapProfileInformation
Let's reuse this component for the compliance step.
2024-09-25 15:26:09 +02:00
Sanne Raymaekers
1a19684d97 Wizard: support compliance in review step
Reuses the existing oscap profile information.
2024-09-25 15:26:09 +02:00
Sanne Raymaekers
110e1d7d75 Wizard: support openscap compliance customisation in state
Merges all the compliance related state into a single compliance object.
2024-09-25 15:26:09 +02:00
Sanne Raymaekers
c6a9d0a17a Wizard: adapt Oscap step to new openscap customisations 2024-09-25 15:26:09 +02:00
regexowl
e051aa3f7f requestMapper: Fix enabled services with firstboot
Previously used `.push()` method was limited by non-writable length of the enabled services array, ending up in the following error:
```
 Uncaught (in promise) TypeError: can't define array index property past the end of an array with non-writable length
```

This fixes the problem by updating the array via spread operator.

Before: when creating an image with Oscap profile with enabled serviced and adding a firstboot script, the Create blueprint button at the Review step threw an error on click.
After fix: it's possible to create an image with Oscap profile that includes enabled services and a firstboot script.
2024-09-24 15:42:30 +02:00
regexowl
bc0ad00aa7 Wizard: Temporarily disable fixed footer
There's a new bug that's at least partially caused by styling commented out in this PR: when zooming in or out while in Wizard, the Wizard shrunks it's height to an unusable value.
2024-09-23 09:25:41 +03:00
Dominik Vagner
2c0d753d82 fix: unify snapshot date format 2024-09-19 09:12:16 +02:00
regexowl
003aa9df48 Wizard: Fix Registration bug
The second condition in `useRegistrationValidation` needs to be triggered only for `register-now` options, otherwise the Next button stays disabled on fetching and error even for `register-later`.
2024-09-18 16:16:32 +03:00
regexowl
39d2f91f03 Wizard: Add isPreview property to analytics tracking
This adds `isPreview` property to the analytics tracking with the use of chrome's `isBeta()`.
2024-09-18 12:47:22 +02:00
regexowl
b3d7a1606c Wizard: Validate registration with useValidation
This migrated Registration step validation to `useValidation`.

The scenarios in which the Next button and Create/Save button should be disabled are:
- any of "register now" options is chosen, but no activation key is selected
- activation key is selected, but it's invalid (information about it cannot be fetched)
2024-09-16 12:59:43 +03:00
Sanne Raymaekers
0897257125 src/store: Remove server store hooks
Removing the server store makes the way we handle data going in and out
of the wizard state more consistent. Each customisation is mapped into
the wizard state and pulled out when generating the blueprint
payload.

When the services and kernel customisations are implemented, this
information will need to be stored inside of the wizard state anyway.

Lastly this will make implementing a compliance step easier for edit
mode, removing the need to write to the wizard state from within the
server store when only a compliance policy id is available (on the
review page), which would be used to fetch the profile ref id, which
would in turn be used to fetch the customisations not stored in the
wizard state.
2024-09-16 11:45:54 +02:00
Anna Vítová
3af0704a2f src: Enable import of image_requests 2024-09-04 17:45:11 +02:00
Anna Vítová
22c9b0c106 src: Cleanup import modal on close 2024-09-04 17:45:11 +02:00
Anna Vítová
c385417e93 HMS-4459: Use export endpoint 2024-09-04 17:45:11 +02:00
regexowl
558bb50c34 test: Add revisit step button checks
This adds tests to check that the revisit buttons on the Review step are working correctly.

Also some minor cleanup, namely making case used in the names of describe and test more consistent and moving render functions outside of functions selecting targets to make the structure easier to go through.
2024-09-04 01:21:28 +02:00
regexowl
4a15b25ceb Wizard: Optional steps
This adds an "Optional steps" section to the Wizard and moves all the non-mandatory customisation options there. "Review and finish" button was also added to allow jumping through the optional section.
2024-09-04 01:21:28 +02:00
regexowl
10f0c92410 Wizard: Fix "button in a button" warning
This adds a component prop to the expandable button, solving the `Warning: validateDOMNesting(...): <button> cannot appear as a descendant of <button>.` warning that was repeatedly printed to the test output.
2024-09-02 16:58:04 +02:00
regexowl
23aa2ae4c6 Wizard: Align revisit buttons
This aligns Revisit step buttons on the Review step with the second column of description lists.

The formatting of the expandable's toggleContent is formatted the same way as the main content. That way if the value of min-width gets updated, the spacing will stay consistent.

The duplicate code was moved to `composeExpandable` function that takes two arguments - name of the expandable/step and a stepId that links to the correct step in the Wizard.
2024-08-30 16:12:55 +02:00
Ondrej Ezr
2cf95bea02 Wizard: Validate snapshot date with useValidation 2024-08-30 10:17:25 +02:00
Ondrej Ezr
e38ffe4706 Wizard: Debounce unique validation
Debounce the validation, so we don't validate every character.
Debounce also ensures the right ordering.
Only one request runs at a time, we cancel the previous before we fire a new.
2024-08-29 14:55:38 +02:00
Michal Gold
047ae0111c createImageWizard: change the default name of bllueprint
this commit change the default name to different format
<release>-<arch>-<date>-<time>
  const dateString = `${day}${month}${year}`;
  const timeString = `${hours}`;
2024-08-27 14:55:37 +02:00
regexowl
be8a00d186 Wizard: Update Amplitude tracking
This updates snippets used for event tracking in Amplitude, adding `imageBuilder` to the name of the event and as a `module` property.

Two more typed events were also added to track number of created blueprints. Name for both events is the same `blueprintCreated`, the differentiation between Create and Create and build images is captured in the `type` property.

These new events will allow to calculate percentage of users that were shown recommendations and of those who added a recommended package while succesfully finishing blueprint creation.
2024-08-27 12:45:19 +02:00
regexowl
f60e80b4e8 Wizard: Fix disable Next on Registration step
When the option to register with rhc and insights was added back the disableNext condition wasn't updated, allowing user to continue with registration even without selecting activation key.
2024-08-20 12:44:20 +02:00
regexowl
0ecf7c9887 Wizard: Unique default key name
Fixes #2353

This adds a random suffix to the default activation key name, making it less predictable.
2024-08-16 16:33:54 +02:00
Andrew Dewar
be95cd9dc0 Fixes 4426: Confirm Image builder is using origin 2024-08-16 10:26:40 +02:00
regexowl
c1049b32ad Wizard: Add analytics tracking for package recommendations
This adds a code snippet to track package recommendations via Amplitude.

Tests were failing without default mock for `analytics.track()` value used to track package recommendations.
2024-08-15 12:31:06 +03:00
regexowl
a5f9339d27 Wizard: Update the code after comments
This reverts Customer portal -> Activation keys page and ensures all the boxes are checked when the "Automatically register" option is checked again.
2024-08-14 15:26:08 +02:00
regexowl
2caddb66c7 Wizard: "Always blue" update to the Registration step
This updates the Registration step as per recent mocks.

There is now only one checkbox which switches between (register everything now / register later). When the checkbox is not checked "register later" option gets selected, activation key dropdown gets disabled and information about activation keys is hidden to support the fact that no activation key will be used.

When the checkbox is checked it either loads previously used activation key in the case of "on edit" scenario, looks for a recently used activation key in localStorage or in a case there are no activationKeys automatically creates and selects one.

The Next button gets disabled only when "register-now" is selected, but there is no activationKey selected. As the option to clear the dropdown got removed this should occur only when fetching/creating activation key.
2024-08-14 15:26:08 +02:00
regexowl
e6a35eaf79 Wizard: Rename FileSystemPartitionMode to FileSystemConfigurationType
This renames `FileSystemPartitionMode` to `FileSystemConfigurationType` in preparation to expose raw/lvm partitioning in the UI.
2024-08-13 14:59:23 +03:00
regexowl
a3abc29f51 Wizard: Add eslint-disable to useEffect
This disables `react-hooks/exhaustive-deps` rule for dependency arrays that should run only once on mount and therefore need to stay empty.
2024-08-12 13:09:58 +03:00
Michal Gold
3c44d9414a createImage: add default name in details step <HMS-4494>
this commit add default name for blueprint name field to be able
to create an image without filling any name
format name: "$OS $ARCH $TARGETS $DATE".
2024-08-12 08:43:26 +02:00
regexowl
5d73adfbd6 src: Absolute imports
While running build there was a bunch of PatternFly imports that were resolved as undefined. This adds an absolute path for each of those imports.
2024-08-09 09:22:17 +02:00
regexowl
79d54eed7b Wizard: Fix information rendered in package recommendations
When a package got selected and deselected again, landing on 0 for selected packages, the information shown in the package recommendations was "Select packages to generate recommendations.No recommendations found for the set of selected packages", this updates the logic to separate the messages.
2024-08-08 12:50:56 +02:00
regexowl
933e65d590 Wizard: Update docs after move to new preview
`/preview` is no longer used in url.
2024-08-05 13:54:13 +02:00
regexowl
44dc900370 src: Fix new errors after linter bump
This addresses problems caused by dependency updates.
2024-08-05 11:51:20 +02:00
Michal Gold
4b85ad064a createImageWizrad: add scroll to the creation image
this commit change the resoluiton of wizard__outer-wrap to solve
the problem that user should scroll to see the next, backl and cancel buttons
2024-08-05 09:07:48 +02:00