V2Wizard: Add search parameter for target selection (HMS-3684)
Add an optional search parameter to the wizard like so: `/insights/image-builder/imagewizard?target=iso` or `/insights/image-builder/imagewizard?target=qcow` This results in wizard being opened and iso or qcow target being pre-selected. The Insights assistant chat bot will make use of this feature.
This commit is contained in:
parent
7c5a040ad7
commit
a7cc88af44
2 changed files with 60 additions and 1 deletions
|
|
@ -53,6 +53,7 @@ import {
|
|||
selectGcpShareMethod,
|
||||
selectImageTypes,
|
||||
selectRegistrationType,
|
||||
addImageType,
|
||||
} from '../../store/wizardSlice';
|
||||
import { resolveRelPath } from '../../Utilities/path';
|
||||
import { ImageBuilderHeader } from '../sharedComponents/ImageBuilderHeader';
|
||||
|
|
@ -105,6 +106,10 @@ const CreateImageWizard = ({ startStepIndex = 1 }: CreateImageWizardProps) => {
|
|||
dispatch(changeDistribution(RHEL_8));
|
||||
searchParams.get('arch') === AARCH64 &&
|
||||
dispatch(changeArchitecture(AARCH64));
|
||||
searchParams.get('target') === 'iso' &&
|
||||
dispatch(addImageType('image-installer'));
|
||||
searchParams.get('target') === 'qcow' &&
|
||||
dispatch(addImageType('guest-image'));
|
||||
// This useEffect hook should run *only* on mount and therefore has an empty
|
||||
// dependency array. eslint's exhaustive-deps rule does not support this use.
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue