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.
This commit is contained in:
regexowl 2024-04-19 14:19:51 +02:00 committed by Lucas Garfield
parent 2fa2c0efa6
commit bd2860890a
2 changed files with 10 additions and 0 deletions

View file

@ -90,6 +90,7 @@ export const mapRequestFromState = (
* @returns wizardState
*/
export const mapRequestToState = (request: BlueprintResponse): wizardState => {
const wizardMode = 'edit';
const gcp = request.image_requests.find(
(image) => image.image_type === 'gcp'
);
@ -109,6 +110,7 @@ export const mapRequestToState = (request: BlueprintResponse): wizardState => {
.options as AzureUploadRequestOptions;
return {
wizardMode,
details: {
blueprintName: request.name,
blueprintDescription: request.description,