-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Correctly display first name for IOU requests #12184
Conversation
Having some trouble testing in mobile, but it should work fine across platforms. Trying again tomorrow, anyways |
src/libs/actions/IOU.js
Outdated
* @param {String} comment | ||
*/ | ||
function requestMoney(report, amount, currency, recipientEmail, debtorEmail, comment) { | ||
function requestMoney(report, amount, currency, recipientEmail, debtorEmail, debtorName = '', comment = '') { |
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.
Not sure why we need default empty values here.
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 think they'll always be available. Mostly a sanity check
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 function is used only once and already state.comment initial value is '' and fallback value for debatorName is also '' i.e if firstName is missing then we passed '' as default value in lodash
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.
That's fair. Removed.
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.
LGTM! Tested well.
|
|
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.
Other wise looks good! Need to test on android #12184 (comment)
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.
Screenshots: #12184 (comment)
Checklist: #12184 (comment)
LGTM!
C+ Reviewed
🎀 👀 🎀
d3eae9a
src/pages/iou/IOUModal.js
Outdated
OptionsListUtils.addSMSDomainIfPhoneNumber(this.state.participants[0].login), | ||
lodashGet(this.state.participants[0], 'firstName', ''), | ||
selectedParticipants[0], |
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.
selectedParticipants[0]
or this.state.participants[0]
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.
selectedParticipants[0] works :)
Large changes after conflict resolution, but it is way simpler now. |
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.
Looks good, tests pass!
all you @youssef-lr
Conflicts solved (again!). |
src/libs/ReportUtils.js
Outdated
@@ -702,8 +702,7 @@ function buildOptimisticIOUReport(ownerEmail, userEmail, total, chatReportID, cu | |||
*/ | |||
function getIOUReportActionMessage(type, total, participants, comment, currency) { | |||
const amount = NumberFormatUtils.format(preferredLocale, total / 100, {style: 'currency', currency}); | |||
const isMultipleParticipantReport = participants.length > 1; | |||
const displayNames = _.map(participants, participant => getDisplayNameForParticipant(participant.login, isMultipleParticipantReport) || participant.login); | |||
const displayNames = _.map(participants, participant => getDisplayNameForParticipant(allPersonalDetails[participant.login], true) || participant.login); |
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 is a throwing a text.replace
is not function for me. Due to the change here, getDisplayNameForParticipant
now expects a string instead of the participant
object.
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.
Oh, you are completely right!
Fixed and tested. Seems to be working!
Left a comment @Gonals |
Addressed! All yours! |
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.
LGTM and tests well!
@youssef-lr looks like this was merged without the checklist test passing. Please add a note explaining why this was done and remove the |
✋ 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 @youssef-lr in version: 1.2.24-0 🚀
|
🚀 Deployed to production by @yuwenmemon in version: 1.2.24-4 🚀
|
1 similar comment
🚀 Deployed to production by @yuwenmemon in version: 1.2.24-4 🚀
|
🚀 Deployed to production by @yuwenmemon in version: 1.2.24-4 🚀
|
@Gonals Can you tag a BZ here, to track payment for C+ Review?
|
Not sure why the checks show that the workflow didn't run, but this wasn't an emergency. |
Details
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/233534
Tests
5. Repeat steps 1-5 but requesting money from an account with no name. 6. Confirm the email displays instead:
QA Steps
Same as tests
PR Review Checklist
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
Desktop
iOS
Android