-
Notifications
You must be signed in to change notification settings - Fork 1
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
MPDX-8216 - tools - fix commitment info - suggested changes #1074
MPDX-8216 - tools - fix commitment info - suggested changes #1074
Conversation
Preview branch generated at https://MPDX-8216-fix-commitment-info-suggested-changes.d3dytjb8adxkk5.amplifyapp.com |
Bundle sizes [mpdx-react]Compared against f06e55b No significant changes found |
@caleballdrin I talked with Andrew and unfortunately we can't get graphql fields for suggested changes, they need to be in JSON. Kind of unfortunate but not a big deal. I researched a little more what's going on with the old MPDx. Like you said, It appears suggested changes is used as the default for populating the form. It also looks like the other graphql fields are used as a fallback. In light of that I think all that's really needed is to switch around the |
@wjames111 I wonder if you could fetch them using the GQL proxy? |
@dr-bizz Never done that before, I could see if that works. I am currently able to get the suggested changes they're just in json format rather then gql. So it's just a matter of convenience. Would using the proxy get me gql fields or is it json as well? |
Oh, I see. I would use what you have then (Not use proxy) and convert the JSON to what you need and use it. Can you not use the JSON as is |
@@ -249,9 +249,10 @@ const Contact: React.FC<Props> = ({ | |||
initialValues={{ | |||
statusValue: statusValue, | |||
pledgeCurrency: amountCurrency, | |||
pledgeAmount: amount || suggestedAmount, |
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.
@canac Can you help us make sense of this? We don't know if Fix Commitment Info should set the initial values to blank, the suggested values, or the current values. On my personal account, it appears that it sets the initial values to the suggested values and leaves it blank if there is no suggested value.
However, in the Angular code, the mutateContacts
service appears to use defaultTo
to set the initial value to the original/current value and only use the suggested value if it doesn't have one. I was thinking you might be able to understand the angular better than we can.
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.
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.
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.
Your code should read
pledgeAmount: suggestedAmount || amount,
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.
Let me know if that makes sense
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.
Does that make sense?
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.
status: suggestedChanges.status || statusValue
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.
@dr-bizz so to clarify?
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.
Yes, that is correct
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.
Nice. So we have confirmed that the suggested values (status, frequency, amount) should be the initial form values. If they don't exist, then it will set the current values as the initial form values.
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.
Looks good!
Description
Checklist: