diff --git a/src/components/wizard/DeploymentStep.tsx b/src/components/wizard/DeploymentStep.tsx new file mode 100644 index 0000000..bacc488 --- /dev/null +++ b/src/components/wizard/DeploymentStep.tsx @@ -0,0 +1,106 @@ +// src/components/wizard/DeploymentStep.tsx +// Step 2 — deployment options: includeInstall toggle, configPath radio, scriptTargets checkboxes. +// Dispatches SET_DEPLOYMENT live on every control change (no submit needed for deployment options). + +import { useWizard } from '../../store/context'; + +export function DeploymentStep() { + const { state, dispatch } = useWizard(); + const { includeInstall, configPath, scriptTargets } = state.deployment; + + function handleScriptTargetChange(target: 'intune' | 'rmm', checked: boolean) { + let next: ('intune' | 'rmm')[]; + if (checked) { + next = scriptTargets.includes(target) ? scriptTargets : [...scriptTargets, target]; + } else { + next = scriptTargets.filter((t) => t !== target); + } + dispatch({ type: 'SET_DEPLOYMENT', payload: { scriptTargets: next } }); + } + + return ( +
+

Step 3: Deployment Options

+ + {/* Include rclone installation toggle */} +
+ +
+ + {/* Config deployment path radio group */} +
+ Config deployment path + + +
+ + {/* Script targets checkboxes */} +
+ Script targets + + +
+ + {/* Navigation buttons */} +
+ + +
+
+ ); +} diff --git a/src/components/wizard/StepIndicator.tsx b/src/components/wizard/StepIndicator.tsx new file mode 100644 index 0000000..bb7ba1d --- /dev/null +++ b/src/components/wizard/StepIndicator.tsx @@ -0,0 +1,54 @@ +// src/components/wizard/StepIndicator.tsx +// Breadcrumb navigation — 1.Backend > 2.Remote Config > 3.Deployment +// Completed steps are clickable. Clicking step 0 also clears remote.params (SET_REMOTE_PARAMS({})). +// CRITICAL: never dispatches RESET — deployment options must be preserved on back navigation. + +import { useWizard } from '../../store/context'; + +const STEP_LABELS = ['Backend', 'Remote Config', 'Deployment']; + +export function StepIndicator() { + const { state, dispatch } = useWizard(); + const { currentStep } = state; + + function handleStepClick(targetStep: number) { + if (targetStep === 0 && currentStep > 0) { + // Clear remote params so the next backend selection starts fresh + // Do NOT dispatch RESET — deployment options must be preserved + dispatch({ type: 'SET_REMOTE_PARAMS', payload: {} }); + } + dispatch({ type: 'SET_STEP', payload: targetStep }); + } + + return ( + + ); +}