-
Notifications
You must be signed in to change notification settings - Fork 3.5k
update report preview message to use workspace name, not admin name #18945
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
update report preview message to use workspace name, not admin name #18945
Conversation
|
@roryabraham @mananjadhav One of you needs to 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] |
| const reportAmount = CurrencyUtils.convertToDisplayString(ReportUtils.getMoneyRequestTotal(props.iouReport), props.iouReport.currency); | ||
| const managerEmail = props.iouReport.managerEmail || ''; | ||
| const managerName = ReportUtils.getDisplayNameForParticipant(managerEmail, true); | ||
| const managerName = ReportUtils.isPolicyExpenseChat(props.chatReport) ? ReportUtils.getPolicyName(props.chatReport) : ReportUtils.getDisplayNameForParticipant(managerEmail, true); |
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.
We're pulling the chatReport object to simply get the managerName? Is it not possible to get this from the IOUReport?
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.
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.
Ah, right. What about the reportAction? IOUActions should contain participants under action.originalMessage.participants
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.
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.
Hmm, that seems like a separate issue to me. But okay, we can follow up with that fix.
|
Is anyone against me putting the |
|
|
|
Ready for review @mananjadhav |
Reviewer Checklist
Screenshots/Videos |
| <SubscriptAvatar | ||
| mainAvatar={{source: avatarSource, type: CONST.ICON_TYPE_AVATAR}} | ||
| secondaryAvatar={ReportUtils.getIcons(props.report, {})[0]} | ||
| secondaryAvatar={ReportUtils.getIcons(props.report, {})[props.report.isOwnPolicyExpenseChat ? 0 : 1]} |
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.
@0xmiroslav this code needs a comment explaining why and what we're doing. It seems arbitrary to me
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'm guessing index 0 has your own icon, and index 1 has the workspace icon.
Lines 753 to 755 in 50ed3e6
| // If the user is an admin, return avatar source of the other participant of the report | |
| // (their workspace chat) and the avatar source of the workspace | |
| return [adminIcon, workspaceIcon]; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
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.
shouldShowSubscriptAvatar is only for workspace chat (policyExpenseChat).
If isOwnPolicyExpenseChat, it returns array with only 1 element - workspace icon:
Line 854 in d28ec8f
| return [result]; |
|
Rushat, I had the same issue on staging now when I created a Group and sent message my avatar was missing so maybe its not related |
|
Hey @rushatgabhane, Good spot. I think we've seen that elsewhere so we can ignore that for this PR review 👍 |
|
oh okayy, thanks! |
|
@0xmiroslav the preview message is overflowing for long workspace names
|
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!
@Julesssss can be merged
I suggest to separate issues which already happen on |
|
@0xmiroslav we have it covered. There's a PR for it - #18933 |
Nice find! |
…pace-name update report preview message to use workspace name, not admin name (cherry picked from commit 444a55b)
…-18945 🍒 Cherry pick PR #18945 to staging 🍒
|
🚀 Cherry-picked to staging by https://github.com/Julesssss in version: 1.3.14-8 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.3.14-14 🚀
|
|
🚀 Cherry-picked to staging by https://github.com/AndrewGable in version: 1.3.28-2 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 1.3.28-5 🚀
|











Details
{workspace name} owes $xxxmessage for all money requests in workspace chatFixed Issues
$ #18858
PROPOSAL: N/A
Tests
policyExpenseChatbetapolicyExpenseChatbeta) to any workspace{workspace name} owes xxxNOTE: A is admin, B is invited member (not admin)
Offline tests
Same as Tests
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting 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)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Web
desktop-web.mov
Mobile Web - Chrome
Mobile Web - Safari
Desktop
desktop-web.mov
iOS
Android