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 1804852: Pipeline params & resources forms submission formik issue #4377
Bug 1804852: Pipeline params & resources forms submission formik issue #4377
Conversation
@karthikjeeyar: This pull request references Bugzilla bug 1804852, 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. 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 |
/assign @rohitkrai03 |
@karthikjeeyar I thought the problem with |
@karthikjeeyar I cannot reproduce this in current master. |
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.
@karthikjeeyar why not use useFormikValidationFix(values);
in each Form?
As far as I can tell it works out fine.
Also, can we fix the fact that |
@rohitkrai03 Here are the steps to reproduces
|
Updated the PR with useFormikValidationFix(values) in multicolumnfield and also made default as optional field |
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
}) => { | ||
const { values } = useFormikContext<FormikValues>(); | ||
const fieldValue = _.get(values, name, []); | ||
useFormikValidationFix(fieldValue); |
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.
Doesn't this put a requirement on name
being the one that is changed? What if you have a MultiColumnField with multiple required fields?
Test this by re-enabling the requirement on default. I suspect if you have a name, but edit default to be empty you can still submit.
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.
@andrewballantyne multicoulmField internally uses FieldArray from formik which accepts an key and value as array(array of objects).
eg:
{ parameters: [{name: 'test', description: '', default: 'value'}] }
here the name
key will be parameters/resources
, the values will be the array of objects which can support multiple required fields.
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.
That's the name of the whole formik field itself that manages the specific part of the form state. It was there before as well. Nothing to do with specific input fields.
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.
Ah I see - it's actually the values... I saw "name" and I assumed it was the field name, not the fieldArray name... We are good 😄 my bad.
I had a name
vs 'name'
problem.
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.
/assign @christianvogt
Christian is needed for the approval label, but this looks good to me. This should solve our validation issues.
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andrewballantyne, christianvogt, 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 Please review the full test history for this PR and help us cut down flakes. |
7 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
@karthikjeeyar: All pull requests linked via external trackers have merged. Bugzilla bug 1804852 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. |
/cherrypick release-4.4 |
@karthikjeeyar: new pull request created: #4466 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-2881
Problem:
After the formik upgrade, error objects has null values in it, which causes the submit button to disable when the fields are edited.
Solution:
Skip the null values in the error object while validating for enabling/disabling the submit button
cc: @debsmita1 @rohitkrai03