-
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
[fix]: Able to save a phone number with some spaces before and After the number #36961
Conversation
@cubuspl42 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
I'm sorry that I'm doing it this late, but I started a thread on Slack to figure out the details of the expected behavior. I'm having second thoughts about presenting an error to the user. |
From the comment on the slack thread i guess we should throw an error over here then, so no change needed i guess ? @cubuspl42 |
One of the internal engineers pressed "Agree". Also, I believe that the common sense should be always prioritized. I'm sorry to put the extra work on you. I'll ask you to pivot to that behavior. On the optimistic side, I think the code diff might be quite small! |
will do, can you please ask them to update the bug description ?
…On Thu, Feb 22, 2024 at 4:50 PM Jakub Trzebiatowski < ***@***.***> wrote:
One of the internal engineers pressed "Agree". Also, I believe that the
common sense should be always prioritized.
I'm sorry to put the extra work on you. I'll ask you to pivot to that
behavior.
On the optimistic side, I think the code diff might be quite small!
—
Reply to this email directly, view it on GitHub
<#36961 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/A2LMYICDMGXWTTDMEDX2ZJ3YU4SX7AVCNFSM6AAAAABDR5PKSWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJZGI2DENBWGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
@GandalfGwaihir I don't think this is required. Sometimes we pivot during the PR implementation. If we get the PR approved by the internal engineer, we'll be fine. |
NVM, solved the issue, will update the new videos tomorrow @cubuspl42 |
src/pages/ReimbursementAccount/BusinessInfo/substeps/PhoneNumberBusiness.tsx
Outdated
Show resolved
Hide resolved
New videos have been updated @cubuspl42 |
@cubuspl42 , ready for review |
Hello @cubuspl42 , we solved a much larger problem over here, after you latest comments i checked where we get isEditing from and why it is the way it is currently, so here is the explanation: App/src/hooks/useSubStep/index.ts Line 12 in 77375e8
We get
which is passed to our phone number page: App/src/pages/ReimbursementAccount/BusinessInfo/BusinessInfo.tsx Lines 122 to 125 in 77375e8
So in App/src/pages/ReimbursementAccount/BusinessInfo/substeps/PhoneNumberBusiness.tsx Lines 51 to 53 in 77375e8
So instead of touching this, i made changes based on your suggestions, to use
We set This helps a lot, we should remove So instead this solutions works really well. Also if we don't want to save drafts on any page, there we can pass simply Also I found similar bugs on other Company pages as well, company name, address all were saved with blank spacesI have fixed them in this PR itself, so I wanted to ask Will the compensation for this Bug be increased now as we are dealing with a lot larger problem now and have avoided atleast 15-16 future similar bugs? (Provided you accept the current proposed solution` I have found
This change also makes us consistent with other form pages in our app, for example down below when we enter display name, we trim the input, so that here too would be consistent with the app behavior: simplescreenrecorder-2024-03-11_01.43.40.mp4 |
...sementAccount/BeneficialOwnerInfo/substeps/BeneficialOwnerDetailsFormSubsteps/AddressUBO.tsx
Show resolved
Hide resolved
Implemented suggested changes @cubuspl42 , can you please checkoff the checklist, thanks |
@@ -44,6 +44,8 @@ function PhoneNumberBusiness({reimbursementAccount, onNext, isEditing}: PhoneNum | |||
const handleSubmit = useReimbursementAccountStepFormSubmit({ | |||
fieldIds: STEP_FIELDS, | |||
onNext, | |||
// We want to remove sanitize user input i.e. remove leading and trailing whitespaces |
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.
Suggestion:
// During draft saving, the phone number is sanitized (i.e. leading and trailing whitespace is removed)
- Link between draft saving and sanitization
- Small language mistake fixed (whtespaces)
- Stressing that we want this for the phone numbers specifically
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.
Fixed it, thanks
In the future, try to ensure that "Tests" make sense for engineers. "Same as QA steps" doesn't work if the QA steps mention stuff like "applause.expensifail account". |
I think that this is just outdated, right? Same in the PR title. |
resolved your comments @cubuspl42 |
Reviewer Checklist
Screenshots/VideosAndroid: mWeb Chrometrim-phone-number-android-web-compressed.mp4iOS: Nativetrim-phone-number-ios-compressed.mp4iOS: mWeb Safaritrim-phone-number-ios-web-compressed.mp4MacOS: Chrome / Safaritrim-phone-number-web-converted.mp4MacOS: Desktop |
✋ 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 https://github.com/nkuoch in version: 1.4.53-0 🚀
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 1.4.53-2 🚀
|
Details
There was a bug which allowed the user to save phone numbers with whitespaces, this needed to be fixed because we needed trimmed values to go in the BE
Fixed Issues
$ #36072
PROPOSAL: #36072 (comment)
Tests
Same as QA step
Offline tests
Cannot perform as verification is required before entering company details
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting 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)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
MacOS: Chrome / Safari
simplescreenrecorder-2024-02-23_19.12.38.mp4
MacOS: Desktop
WhatsApp.Video.2024-02-23.at.7.16.28.PM.mp4
iOS: mWeb Safari
WhatsApp.Video.2024-02-21.at.3.33.24.AM.mp4
iOS: Native
WhatsApp.Video.2024-02-21.at.3.33.50.AM.mp4
Android: mWeb Chrome
Android: Native
simplescreenrecorder-2024-02-21_03.35.45.mp4