Skip to content
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

Refactor AddDebitCardPage to use the new Form component #9043

Closed
8 tasks
luacmartins opened this issue May 16, 2022 · 2 comments
Closed
8 tasks

Refactor AddDebitCardPage to use the new Form component #9043

luacmartins opened this issue May 16, 2022 · 2 comments
Assignees
Labels
Engineering Improvement Item broken or needs improvement. Reviewing Has a PR in review Weekly KSv2

Comments

@luacmartins
Copy link
Contributor

Coming from the New Expensify Forms design doc, we should refactor our forms to use the new form component, follow the guidelines below:

Guidelines

  1. Replace the form component with Form.js.
  2. Create a unique Onyx key in ONYXKEYS.FORM and pass it as the formID prop to Form.
  3. Pass a validate callback prop.
  4. Pass an onSubmit callback prop that calls the API via an action.
  5. Update all inputs wrapped by Form, following the guidelines in Refactor inputs.
  6. 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 errors link focuses the first input with error
  • No duplicate submission of the form occurs (when it's already submitting)
@luacmartins luacmartins added Engineering Daily KSv2 Improvement Item broken or needs improvement. labels May 16, 2022
@luacmartins luacmartins self-assigned this May 16, 2022
@luacmartins
Copy link
Contributor Author

Working on #9075 as it's a blocker for this one

@luacmartins luacmartins added Weekly KSv2 and removed Daily KSv2 labels May 19, 2022
@melvin-bot melvin-bot bot added the Overdue label May 27, 2022
@luacmartins
Copy link
Contributor Author

Working on a few input refactors before getting to this.

@melvin-bot melvin-bot bot removed the Overdue label May 27, 2022
@luacmartins luacmartins added the Reviewing Has a PR in review label Jun 1, 2022
@melvin-bot melvin-bot bot closed this as completed Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Engineering Improvement Item broken or needs improvement. Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

1 participant