Skip to content

Commit

Permalink
Initilalize the validation value for the wizard's 'plan name' field t…
Browse files Browse the repository at this point in the history
…o default instead of error

Reference: https://issues.redhat.com/browse/MTV-1651

To avoid displaying an error on initialization for the 'plan name'empty field,
when entering the wizard's step 2, leave the initialized
validation value for this field as 'default.

Signed-off-by: Sharon Gratch <[email protected]>
  • Loading branch information
sgratch committed Dec 26, 2024
1 parent e35e84a commit 990f13e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ export const PlanCreatePage: React.FC<{ namespace: string }> = ({ namespace }) =
!emptyContext &&
!(
!!state?.flow?.apiError ||
Object.values(state?.validation || []).some((validation) => validation === 'error')
Object.values(state?.validation || []).some((validation) => validation === 'error') ||
state?.validation?.planName === 'default'
),
canJumpTo: filterState?.selectedVMs?.length > 0,
nextButtonText: 'Create migration plan',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,6 @@ const handlers: {
) {
// triggered from useEffect on any data change
draft.existingResources.plans = existingPlans;
draft.validation.planName = validatePlanName(
draft.underConstruction.plan.metadata.name,
existingPlans,
);
},
[SET_AVAILABLE_TARGET_NAMESPACES](
draft,
Expand Down

0 comments on commit 990f13e

Please sign in to comment.