-
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
Set up Avatars for Workspace Chats #7852
Conversation
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.
Great start on this, excited for you to finish it. I just had one suggestion ahead of you finishing this.
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 LGTM just one had more comment to leave.
Very nice work overall with this and I appreciate the clean up that is happening here. I would maybe have liked to see a PR with fewer changes (though not sure how possible it would have been in this case). Did find it a bit hard to focus on all the changes at once.
* @returns {Array<*>} | ||
*/ | ||
function getAvatarSources(report) { | ||
return _.map(lodashGet(report, 'icons', ['']), (source) => { |
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.
If can, please add some kind of comment here about why we are defaulting to an array with an empty string.
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 I'm planning to merge this function with getReportIcons
in another PR (GH issue), in theory if we use only one function (get the Icon components just when the option row is created) we won't need to use empty strings to represent a possible icon.
Also I think this solution is important in order to show the up-to-date avatar when the workspace avatar is changed, because right now we can only display the up-to-date workspace image when we reload the app (yesterday I tried to addressed this by updating the icons
from Onyx storage, but then I realized is better to merge these functions and get the icons after the reports are retrieved from Onyx, and not before like currently happens).
I'm going to be OOO for a few days but I will address this issue when I'm come back.
This is some good advice here (at least I realized how important it is as time goes on). |
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.
You can add the comment that Marc mentioned but otherwise this LGTM.
containerStyles={[styles.singleAvatarLarge, styles.mb4]} | ||
imageStyles={[styles.singleAvatarLarge]} | ||
source={this.props.report.icons[0]} | ||
source={_.first(OptionsListUtils.getAvatarSources(this.props.report))} |
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 wanna note that this breaks the icons here, but I've already fixed that in my PR with this commit (I used your updates to RoomHeaderAvatars too!): 5030078
It's not really relevant in this PR, so no need to add it here, I just noticed it when I added reportDetailsView for the policyExpenseChats (which is something I have to do for my PR). The only reason I bring it up is that if anyone notices this is off, it's already fixed!
secondaryTooltip: PropTypes.string, | ||
|
||
/** Set the size of avatars */ | ||
mode: PropTypes.oneOf(_.values(CONST.OPTION_MODE)), |
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.
NAB but in your follow-up I would recommend changing this prop to size
to match the other avatar components
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.
Sure thing, also I will add a Storybook stories of SubscriptAvatar
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 addressed this change here #8144
Triggered auto assignment to @ctkochan22 ( |
@roryabraham looks like this was merged without passing tests. Please add a note explaining why this was done and remove the |
I'm like 90% sure tests were already passing here. If not, that was a mistake on my part 😬 Unless I'm going crazy I've seen this |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Looks like we have got a regression |
@thesahindia I've got a fix for this, let me pull it out of my PR so it can be merged sooner. |
🚀 Deployed to staging by @roryabraham in version: 1.1.42-0 🚀
|
🚀 Deployed to production by @chiragsalian in version: 1.1.42-6 🚀
|
Details
This PR includes the avatars for workspace chats (for both admins and workspace members) and shows the workspace chats when the user has the
policyExpenseChat
beta. I also included fixes for some minor issues I found (like duplicate rows on the Search Page and the user name not included in the second line of the chat header).Additionally, I created a Web-E PR to fix a few issues I found while I was implementing the workspace chats: https://github.com/Expensify/Web-Expensify/pull/33166
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/195471
Tests / QA
Pre-requisites:
policyExpenseChat
betaSteps:
Tested On
Screenshots
Web
User:
Admin:
Mobile Web
User (with search value):
Admin (with search value):
Desktop
iOS
Android