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}
|
scheduledActivationDate={scheduledActivationDate}
|
||||||
setScheduledActivationDate={setScheduledActivationDate}
|
setScheduledActivationDate={setScheduledActivationDate}
|
||||||
activationFee={activationFeeDetails}
|
activationFee={activationFeeDetails}
|
||||||
validate={validate}
|
|
||||||
onNext={() => setCurrentStep(3)}
|
onNext={() => setCurrentStep(3)}
|
||||||
onBack={() => setCurrentStep(1)}
|
onBack={() => setCurrentStep(1)}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -13,12 +13,13 @@ export function ActivationStep({
|
|||||||
scheduledActivationDate,
|
scheduledActivationDate,
|
||||||
setScheduledActivationDate,
|
setScheduledActivationDate,
|
||||||
activationFee,
|
activationFee,
|
||||||
validate,
|
|
||||||
onNext,
|
onNext,
|
||||||
onBack,
|
onBack,
|
||||||
}: ActivationStepProps) {
|
}: ActivationStepProps) {
|
||||||
const handleContinue = () => {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
onNext();
|
onNext();
|
||||||
|
|||||||
@ -35,7 +35,6 @@ export interface ActivationStepProps extends BaseStepProps {
|
|||||||
scheduledActivationDate: string;
|
scheduledActivationDate: string;
|
||||||
setScheduledActivationDate: (date: string) => void;
|
setScheduledActivationDate: (date: string) => void;
|
||||||
activationFee?: ActivationFeeDetails | undefined;
|
activationFee?: ActivationFeeDetails | undefined;
|
||||||
validate: () => boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AddonsStepProps extends BaseStepProps {
|
export interface AddonsStepProps extends BaseStepProps {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user