Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[Form Refactor] ACHContractStep #13501
[Form Refactor] ACHContractStep #13501
Changes from 8 commits
05d3bb2
4b089ce
797e578
780212a
bee453f
6abfb7e
cb0fff7
292e3f3
57c61d3
b816f5b
382b75a
a379d39
3ad4f46
fbe7e15
a36e8a8
6a32616
49098db
3f5c1cc
ea35dc3
b67bd24
efed1c3
8d167d8
ccb589b
d5085c6
45c97c1
853a4f9
d4a95a0
d27dc93
aee6c38
a63e322
5937ed9
0df7ec4
27a6f27
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
These keys should be dynamic
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'll look into a solution for these since we might need to make changes to the Form component itself
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.
@grgia I took a look at dynamically adding/removing
IdentityForm
and the solution below should work:beneficialOwners
in local state like we do now. However, we'll only store an ID for theIdentityForm
instead of the full form input keys. No need to change anything here, we'll do so in the other methods that use state.addBeneficialOwner
to store this ID inbeneficialOwners
and set the Form draft values accordingly. Something like:removeBeneficialOwner
to take the ID of theIdentityForm
we are removing and update the Form draft accordingly. Like so:beneficialOwners
state, which now stores IDs, and pass a key in the formatbeneficialOwner.${id}.firstName
to bothdefaultValues
andinputKeys
. Something like:onValueChange={value => this.setState({hasOtherBeneficialOwners: value})}
to thehasOtherBeneficialOwners
checkbox.this.removeBeneficialOwner
to pass the ID of theIdentityForm
we are removing.validate
function to use the new keys.IdentityForms
(if the user removed a beneficial owner as they are editing the form). The only drawback that I can think of is that we will have to filter these values in thesubmit
function so we don't send them with the API request. I think this is a fine trade off considering that it makes the rest of the implementation easier.Let me know what you think of this approach!
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.
This method looks like it's working well! I wrote out my plan for testing, so I still need to QA edge cases
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.
Sounds good! I'll take another look today! Thanks for working on this.
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.
OK I am still a little confused, but haven't yet given this a proper investigation to produce any alternatives. Something does not sit right with me about the random id thing. I feel like I would have remembered this from the Design Doc (maybe it didn't come up). It has the feeling of something we might want to bring up in Slack, decide together the best way to do it, and then update everyone on the process (maybe modify the very awesome
FORMS.md
doc 😉).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 don't think this came up in the doc (at least I don't recall it either). IMO the random id solution solves this issue quite well, but I'm open to discussing this further in Slack if others prefer that.
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'd love to see this get to the finish line this week, but I'm happy to hold this for a discussion and move forward with whatever is decided (final testing for the current method or implementing a new method). I agree that the current method works well, and also that it would be worth updating everyone on the process and why it's done this way in FORMS.md
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.
so, sounds like we agree that it's a good thing to discuss and that you are offering to lead a discussion on it? Or no? 😄
It might feel like a small battle - but I am concerned with this solution because it feels like something I would never remember how to do or know the reason why a random ID is used. I am barely understanding the explanation about why it is needed. I'd say that's a sign we haven't solved it in the best way possible (maybe I'm wrong). But if it has to be difficult to understand then at least we can document it better.
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.
Started here!