The way the on premise wizard is initialized needed to be tweaked to
make it work for isEdit. Let's assume that the host distro and host
architecture are already correct in the blueprint.
Add a `contentSourcesApi` for the on-prem frontend. We need to add a small
workaround and put these endpoints under the `cockpitApi` reducer.
since RTK query here, doesn't like splitting out apis when they are
fundamentally the same.
To workaround this we can will just chain the endpoints so:
`emptyCockpitApi` -> `contentSourcesApi` -> `cockpitApi`
This allows us to keep the `contentSourcesApi` separate so
we can export some of the endpoints so that the `cockpitApi`
doesn't become a monolith.
This is not ideal, but we needed to add an empty endpoint for
this, even though we're ignoring it on prem. The frontend for
the service makes the api call regardless, so we can't ignore
this.
add condition that check if there is value in Hostname, Locale, Timezone steps
and if there is no value, we dont see the extendable part in review step
FIX ISSUE: (#2718)
after changes when there is no value in Timezone step, we should update
test if we want to see the extendable section
Set sane defaults for some types rather than setting them to `undefined`.
This is so that we can set `exactOptionalPropertyTypes` to true in our
tsconfig.
Export a dynamic query hook depending on which backend is
being used (service or on-prem). This means we can just import
a query from the new `backendApi` and it will work for both
on-prem and the service.
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 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.
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.