-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added required field check in wizard flow #1039
Added required field check in wizard flow #1039
Conversation
9183620
to
de21e4a
Compare
Screencast.from.2023-09-12.15-46-00.webm |
292b117
to
8973ca2
Compare
setStepIdReached(stepIdReached < id ? id : stepIdReached); | ||
} | ||
}; | ||
const [isValidationEnabled, setEnableValidation] = React.useState(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nits:
const [isValidationEnabled, setEnableValidation] = React.useState(false); | |
const [isValidationEnabled, setIsValidationEnabled] = React.useState(false); |
setEnableValidation(true); | ||
if (canJumpToNext) { | ||
setStepIdReached(stepIdReached <= stepId ? stepId + 1 : stepIdReached); | ||
onNext(); | ||
setEnableValidation(false); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setEnableValidation(true); | |
if (canJumpToNext) { | |
setStepIdReached(stepIdReached <= stepId ? stepId + 1 : stepIdReached); | |
onNext(); | |
setEnableValidation(false); | |
} | |
if (canJumpToNext) { | |
setStepIdReached(stepIdReached <= stepId ? stepId + 1 : stepIdReached); | |
onNext(); | |
setEnableValidation(false); | |
} else setEnableValidation(true); |
hasNoPaddingTop | ||
isRequired | ||
validated={ | ||
isValidationEnabled && !selectedLabels?.length ? 'error' : 'default' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we create a small util function for mco ?
const getValidatedProp = (error: boolean) => error ? 'error' : 'default'
;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PF also have a constant variable/enum for 'error' & 'default', we can use that directly...
|
||
const isPVCSelectorFound = (dataPolicy: DRPolicyType) => | ||
!!dataPolicy?.placementControlInfo?.length && | ||
!!dataPolicy?.placementControlInfo?.every( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!!dataPolicy?.placementControlInfo?.every( | |
!!dataPolicy.placementControlInfo.every( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if !!dataPolicy?.placementControlInfo?.length
is true then only we will reach to next condition... and if that is happening it means all fields are present...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack
const isPVCSelectorFound = (dataPolicy: DRPolicyType) => | ||
!!dataPolicy?.placementControlInfo?.length && | ||
!!dataPolicy?.placementControlInfo?.every( | ||
(drpc) => !!drpc?.pvcSelector?.length |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(drpc) => !!drpc?.pvcSelector?.length | |
(drpc) => !!drpc.pvcSelector?.length |
Signed-off-by: Gowtham Shanmugasundaram <[email protected]>
8973ca2
to
0090f7d
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: GowthamShanmugam, SanjalKatiyar The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/cherry-pick release-4.14 |
@SanjalKatiyar: once the present PR merges, I will cherry-pick it on top of release-4.14 in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/cherry-pick release-4.14-compatibility |
@SanjalKatiyar: once the present PR merges, I will cherry-pick it on top of release-4.14-compatibility in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@@ -141,7 +128,7 @@ export const AssignPolicyView: React.FC<AssignPolicyViewProps> = ({ | |||
}; | |||
// assign DRPolicy | |||
const promises = assignPromises(state.policy); | |||
Promise.all(promises) | |||
await Promise.all(promises) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed... still not blocking the PR for this small nit...
await Promise.all(promises) | |
Promise.all(promises) |
4cdc53a
into
red-hat-storage:master
@SanjalKatiyar: new pull request created: #1044 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@SanjalKatiyar: new pull request created: #1045 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=2236436