Repository navigation
Closed
Labels
EngineeringExternalAdded to denote the issue can be worked on by a contributorNewFeatureSomething to build that is a new item.ReviewingHas a PR in reviewWeeklyKSv2
Description
Coming from the New Expensify Forms design doc, we should refactor the inputs within the IdentityForm to be compatible with the new Form component, following the guidelines below:
Here's an example of a Form refactor: #9056
Here is a component that had its inputs refactored to be compatible with Form.js.
Guidelines
Contributors should first read FORMS.md.
The refactored inputs should be functional when wrapped by Form.js and when not.
- Add an optional inputID prop.
- Add an optional shouldSaveDraft prop that defaults to false.
- Make the value prop optional.
- Change any onChange prop, e.g. onTextChange to onChange.
- In the input’s onBlur method, call props.onBlur().
- In the input’s onChange method, call props.onChange() .
- Remove the hasError prop.
- Update the error message to display if errorText is truthy.
- Make sure that props.ref is attached to the appropriate DOM node. This could involve forwarding the ref to a child component.
- Make sure the ref is exposing both value and focus().
- Add an optional maxLength prop to text inputs and UI to display the current character count out of the limit.
- Add a hint prop and display the text under the input if there is no existing error.
- Remove any unused code.
Testing
Verify that:
- UI looks as it did before the refactor
- Values can be added and edited
- Errors are highlighted correctly (input border)
- Error messages show up correctly
- Draft values are saved properly
- Form alerts are displayed correctly
- Clicking the
fix the errorslink focuses the first input with error - No duplicate submission of the form occurs (when it's already submitting)
Metadata
Metadata
Labels
EngineeringExternalAdded to denote the issue can be worked on by a contributorNewFeatureSomething to build that is a new item.ReviewingHas a PR in reviewWeeklyKSv2
Activity
melvin-bot commentedon Aug 31, 2022
Triggered auto assignment to @JmillsExpensify (
External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.neil-marcellini commentedon Aug 31, 2022
It might be a good idea to price this issue at $500+ right away since it's a precursor to the RequestorStep refactor.
mollfpr commentedon Aug 31, 2022
@neil-marcellini May I know the plan for deploying this form? Is this form will be deployed before refactoring
ACHContractStepandRequestStep?I also think the proposal should include refactoring
AddressForm(since it's been used inIdentityForm).[-][Form Refactor] IdentityForm[/-][+][HOLD 10738] [Form Refactor] IdentityForm[/+]neil-marcellini commentedon Sep 1, 2022
Great point about the AddressForm. I created this issue to refactor it #10738. I also updated this description because this refactor will only involve updating the inputs to be compatible with Form.js. Please submit your proposal for AddressForm. Thanks.
neil-marcellini commentedon Sep 1, 2022
Yes. We will start with AddressForm, then IdentityForm, and then RequestorStep. Then eventually
ACHContractStep.mollfpr commentedon Sep 1, 2022
@neil-marcellini Got it! I'm on my way to send the proposal for AddressForm.
JmillsExpensify commentedon Sep 5, 2022
Just created an Upwork job here: https://www.upwork.com/jobs/~01604cc324bbf955b6. I went ahead and started the posting at $500. cc @neil-marcellini
98 remaining items
JmillsExpensify commentedon Nov 16, 2022
@Santhosh-Sellavel @neil-marcellini The regression period has passed. At this point, this PR is merged and IndentityForm is "done." What's our plan for testing this in conjunction with related issues? Should that happen in a separate issue when #12400 and #9581 are ready?
Santhosh-Sellavel commentedon Nov 16, 2022
@JmillsExpensify When #9581 is ready, this should work!
JmillsExpensify commentedon Nov 17, 2022
Ok, I'm going to go ahead and issue payment. Per the process, the PR is merged and has been for 7 days. I don't feel great about waiting on a related issue that is not yet merged. That part is on Expensify.
JmillsExpensify commentedon Nov 17, 2022
Alright, all contributors paid out. I removed the
Awaiting Paymentlabel and I'm also updating the hold as well. We can come back to this and test when #9581 is ready.[-][HOLD for payment 2022-11-16] [$500] IdentityForm[/-][+][HOLD #9581] [$500] IdentityForm[/+]JmillsExpensify commentedon Nov 22, 2022
Review of the linked/holding PR is in progress! I'll have to check back in the coming days.
JmillsExpensify commentedon Nov 27, 2022
#9581 is merged and on staging at this point, so I think we should be able to remove the hold and move forward with next steps. Does that sound right @Santhosh-Sellavel @neil-marcellini?
Santhosh-Sellavel commentedon Nov 27, 2022
We can close this now or along with #9581.This is already merged, we were waiting for test a particular test case which is passing now. @JmillsExpensify
JmillsExpensify commentedon Nov 27, 2022
Awesome, sounds like a plan. As for regression tests, I think we are already covered via this test. Accordingly, I'm going to close. cc @luacmartins please re-open if you disagree and I'll make sure any additional cases are added to that existing test.
[-][HOLD #9581] [$500] IdentityForm[/-][+][$500] IdentityForm[/+]