fix: scope ActivationStep validation to current step only
The "Continue to Add-ons" button was unresponsive when selecting scheduled activation because validate() ran full-form schema validation (all steps), silently failing on incomplete fields from other steps. Now only checks that a date is selected for scheduled activation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
1ef2c5e125
commit
1fa8c6b5ad
@ -79,7 +79,6 @@ function SimConfigureStep(props: Omit<Props, "loading"> & { plan: NonNullable<Pr
|
||||
scheduledActivationDate={scheduledActivationDate}
|
||||
setScheduledActivationDate={setScheduledActivationDate}
|
||||
activationFee={activationFeeDetails}
|
||||
validate={validate}
|
||||
onNext={() => setCurrentStep(3)}
|
||||
onBack={() => setCurrentStep(1)}
|
||||
/>
|
||||
|
||||
@ -13,12 +13,13 @@ export function ActivationStep({
|
||||
scheduledActivationDate,
|
||||
setScheduledActivationDate,
|
||||
activationFee,
|
||||
validate,
|
||||
onNext,
|
||||
onBack,
|
||||
}: ActivationStepProps) {
|
||||
const handleContinue = () => {
|
||||
if (activationType === "Scheduled" && !validate()) {
|
||||
// Only validate that a date is selected for scheduled activation —
|
||||
// full-form validation runs at checkout, not mid-wizard.
|
||||
if (activationType === "Scheduled" && !scheduledActivationDate) {
|
||||
return;
|
||||
}
|
||||
onNext();
|
||||
|
||||
@ -35,7 +35,6 @@ export interface ActivationStepProps extends BaseStepProps {
|
||||
scheduledActivationDate: string;
|
||||
setScheduledActivationDate: (date: string) => void;
|
||||
activationFee?: ActivationFeeDetails | undefined;
|
||||
validate: () => boolean;
|
||||
}
|
||||
|
||||
export interface AddonsStepProps extends BaseStepProps {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user