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
Bug 1908296: Fix pipeline builder form yaml switcher validation issue #7565
Bug 1908296: Fix pipeline builder form yaml switcher validation issue #7565
Conversation
@karthikjeeyar: This pull request references Bugzilla bug 1908296, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
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. |
/kind bug |
@karthikjeeyar did you find out why the form is not getting properly validated? Is it a formik issue? @rohitkrai03 do you have an idea about it? |
React.useEffect(() => { | ||
if (values.editorType === EditorType.Form) { | ||
// Force validation against the new data that was adjusted in the YAML | ||
// Formik isn't properly handling the immediate state of the form values during the cycle of the editorType | ||
setTimeout(() => validateForm(), 0); | ||
} | ||
}, [values.editorType, validateForm]); |
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.
Why not use useFormikValidationFix
hook here? It does a similar hack.
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.
I tried using this hook, but unfortunately it doesn't work. with pipeline builder form component, validation happens before the task is preselected, so the above code is to validate the form right after all the new changes are in place, thus setTimeout is used.
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: karthikjeeyar, rohitkrai03 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 |
/retest |
@karthikjeeyar: All pull requests linked via external trackers have merged: Bugzilla bug 1908296 has been moved to the MODIFIED state. 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. |
Fixes:
https://issues.redhat.com/browse/ODC-5249
Analysis / Root cause:
In pipeline builder page, pasting the yaml file on the yaml section and switching back to form view fails to enable the create button. Formik validation is not occurring against the immediate change in form values while switch back to form view.
Solution Description:
Add a force validation to get correct error state while switching to form view.
Screen shots / Gifs for design review:
Unit test coverage report:
No UI changes
Test Setup:
Browser conformance: