Refactor close account page to use Form#12534
Refactor close account page to use Form#12534Beamanator merged 15 commits intoExpensify:mainfrom Puneet-here:form-refactor-close-account-page
Conversation
|
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
Co-authored-by: Sahil <thesahindia@gmail.com>
|
When we get an error the error will be shown above the button which is expected in the Form refactor, the problem I see is that the error contains html tag (the error is from backend) |
| addressZipCode: 'Por favor ingresa un código postal válido', | ||
| debitCardNumber: 'Ingresa un número de tarjeta de débito válido', | ||
| expirationDate: 'Por favor introduzca una fecha de vencimiento válida', | ||
| securityCode: 'Ingrese un código de seguridad válido', |
There was a problem hiding this comment.
This change is not related to this PR but added since it was asked here
…efactor-close-account-page
…/Puneet-here/App into form-refactor-close-account-page
Ooh that's a very interesting point, it seems like we either need to do one of these:
I call upon @shawnborton to assist with this question - @shawnborton on the "Close account" page we currently don't actually tell the user what error may have occurred when closing their account, we just show the "Unable to close account" modal (see this comment). Is this a pattern we are ok with?
|
|
@shawnborton is OOO, should we tag the design team? |
|
Aah shucks good point @thesahindia - currently @shawnborton is the whole @Expensify/design team 😅 @thesahindia do you mind posting in #expensify-open-source to get some feedback on this idea? I think we can pause the PR-merge-timer while we wait for feedback |
|
Just confirming that I like where we ended up in Slack, where we can omit the modal and just use the error message above the form button. |
|
@Beamanator @thesahindia I have updated the code to remove the modal, we need to remove the |
|
@Puneet-here thanks for the reminder, made a follow-up issue for myself here: #12747 |
|
@thesahindia please feel free to test when you have time 👍 |
|
@Puneet-here, let's remove the modal part since we don't have a modal now App/src/libs/actions/CloseAccount.js Line 6 in 672dc9e P.S. I have reviewed the code, it looks good. I will test it again in the morning. EOD for me 🌃 |
|
@Puneet-here, great work! cc: @Beamanator |
Reviewer Checklist
Screenshots/Videos |
Beamanator
left a comment
There was a problem hiding this comment.
A few small requested changes, happy to discuss :D
Also going to request @shawnborton check out the new Close Account page design, I don't know if I love the two error messages both showing in red, with red dots 🤔
|
I agree that the red dot + red text is not my favorite, but I had posted some options in open source a while ago and this is what the group decided. |
|
Updated! |
|
Thanks for the changes! All yours @Beamanator |
Beamanator
left a comment
There was a problem hiding this comment.
Sounds good, looks like we're good to go here!
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by @Beamanator in version: 1.2.30-0 🚀
|
|
🚀 Deployed to staging by @Beamanator in version: 1.2.30-0 🚀
|
|
🚀 Deployed to production by @luacmartins in version: 1.2.30-0 🚀
|
| /** Should the button be enabled when offline */ | ||
| enabledWhenOffline: PropTypes.bool, | ||
|
|
||
| /** Whether the action is dangerous */ |
There was a problem hiding this comment.
I don't understand this - what does it mean for an action to be "dangerous"? 😕
Why was this added to such a low level component..
There was a problem hiding this comment.
To me, "Dangerous" means if the user clicks the "Submit" button, the action being taken should only be taken with caution. I think it would be helpful if you can recommend a "better solution" or what you'd prefer seeing - I am guessing you are saying you'd like to see a more generic prop name, maybe something having to do with the submit button color?
There was a problem hiding this comment.
To me, "Dangerous" means if the user clicks the "Submit" button, the action being taken should only be taken with caution.
I am guessing you are saying you'd like to see a more generic prop name
No, I think it's too generic. Which "action" is "dangerous"? It's a Form so the user can take many actions. It looks like this just controls the color of the button. So my suggestion would be something like isSubmitButtonDangerous, isSubmitActionDangerous etc.
There was a problem hiding this comment.
Aah ok I'm glad we got that clarified, I see what you mean that technically there can be many "actions" taken in a form, though I thought it was a bit self explanatory that the main "action" is submitting the form - but it's good to be clear 👍 I like your suggestions, I think isSubmitActionDangerous is a bit more clear to me - there should only be 1 "submit action" (clicking on the submit button) so I'll go with that - follow-up PR incoming!







Details
We are refactoring close account page to use Form
#11341 (comment)
Fixed Issues
$ #11341
PROPOSAL: #11341 (comment)
Tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*filesWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)PR Reviewer Checklist
The reviewer will copy/paste it into a new comment and complete it after the author checklist is completed
### Fixed Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick).src/languages/*filesWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarhave been tested & I retested again)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)Screenshots
Web
Screen.Recording.2022-11-08.at.4.01.59.PM.mov
Mobile Web - Chrome
Mobile Web - Safari
Desktop
Screen.Recording.2022-11-08.at.4.10.41.PM.mov
iOS
Android