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.
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.
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.
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`.
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)
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.
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.
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.
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.
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.
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.
this commit change the default name to different format
<release>-<arch>-<date>-<time>
const dateString = `${day}${month}${year}`;
const timeString = `${hours}`;
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.
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.
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.
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.
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.
CentOS 8 was deprecated and is no longer used, but 'On Edit' for a no longer valid blueprint with 'centos-8' as their distribution defaulted to RHEL 9.