-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 close account page to use Form #12534
Refactor close account page to use Form #12534
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) |
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
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.
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 |
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, 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 🚀
|
@@ -48,6 +48,9 @@ const propTypes = { | |||
/** Should the button be enabled when offline */ | |||
enabledWhenOffline: PropTypes.bool, | |||
|
|||
/** Whether the action is dangerous */ |
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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!
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.
@marcaaron follow-up PR here: #13981
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 Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is 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 Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
).src/languages/*
filesWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
have been tested & I retested again)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is 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