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
-
Menu Selection
- The command will first display a list of available portal menus
- Select the menu where you want to add additional steps
-
Folder Structure Validation
- The command validates the existing folder structure in your selected menu
- Ensures all required directories and files are present
-
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
-
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:
-
Update Configuration Files
- Updates the
_configdirectory with new step configurations:stepLabels.ts: Adds labels for new stepsstepsNavigation.ts: Updates navigation configurationtotalSteps.ts: Updates the total number of stepswizardSummaryConfig.tsx: Updates summary configuration
- Updates the
-
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
└── ...
- Creates new step directories in the wizard structure:
Template Structure
Each new step will include:
-
Main Wizard Template (
[code]/_TEMPLATE/)- Contains the base components and logic for the wizard step
- Includes form configurations and validations
-
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
_configdirectory