Skip to main content

Adding Additional Steps to Wizard

This guide explains how to add additional steps to an existing wizard using the platform wizard command.

Prerequisites

  • An existing wizard menu structure in your project
  • Platform CLI installed

Command Usage

To add additional steps to your wizard, use the following command:

platform wizard

Process Flow

  1. Menu Selection

    • The command will first display a list of available portal menus
    • Select the menu where you want to add additional steps
  2. Folder Structure Validation

    • The command validates the existing folder structure in your selected menu
    • Ensures all required directories and files are present
  3. Step Configuration

    • The system identifies existing wizard steps
    • You'll be prompted to specify the number of additional steps you want to add
    • Enter 0 to cancel the operation
  4. Confirmation

    • The command will show the total number of steps (existing + new)
    • Confirm to proceed with the generation

Generated Changes

When you confirm the addition of new steps, the command will:

  1. Update Configuration Files

    • Updates the _config directory with new step configurations:
      • stepLabels.ts: Adds labels for new steps
      • stepsNavigation.ts: Updates navigation configuration
      • totalSteps.ts: Updates the total number of steps
      • wizardSummaryConfig.tsx: Updates summary configuration
  2. Generate Step Templates

    • Creates new step directories in the wizard structure:
      wizard/
      ├── [code]/
      │ ├── [new-step-number]/ # New step directory
      │ │ └── _TEMPLATE/ # Step template files
      │ └── ...
      └── (summary)/
      ├── _[new-step-number]/ # Summary step directory
      │ └── _TEMPLATE/ # Summary template files
      └── ...

Template Structure

Each new step will include:

  1. Main Wizard Template ([code]/_TEMPLATE/)

    • Contains the base components and logic for the wizard step
    • Includes form configurations and validations
  2. Summary Template ((summary)/_TEMPLATE/)

    • Contains components for displaying step summary
    • Includes review and confirmation layouts

Example

Let's say you have a wizard with 2 existing steps and want to add 1 more step:

$ platform wizard
# Select your menu from the list
# Validate folder structure
# Enter number of additional steps: 1
# Confirm total steps will be 3

The command will generate:

  • New step directory: wizard/[code]/3/_TEMPLATE/
  • New summary directory: wizard/(summary)/_3/_TEMPLATE/
  • Updated configurations in the _config directory