[TS migration] Migrate 'MultipleAvatars.js' component to TypeScript#31056
Conversation
| displayName: props.icons[0].name, | ||
| avatar: props.icons[0].avatar, | ||
| displayName: icons[0].name, | ||
| avatar: icons[0].source, |
There was a problem hiding this comment.
Can you explain to me why has this changed across the files? I don't understand why it was icon.avatar before and now it's icon.source, maybe I'm missing something 😄
There was a problem hiding this comment.
@BartoszGrajdek I haven't found any place where icons have an avatar field, so it looked wrong, that's why I replaced it with source which makes more sense
There was a problem hiding this comment.
Wow, this is really weird, I do not know how it's been working before then... Have you heard anything about it @blazejkustra?
There was a problem hiding this comment.
Nooo, that has to be a mistake. It worked as we have fallback icons and probably nobody noticed 😄
There was a problem hiding this comment.
@blazejkustra Maybe it makes sense to remove it then?
There was a problem hiding this comment.
Why would you remove it? 🤔
There was a problem hiding this comment.
@blazejkustra Because the tooltip anyway use the icon from props first and only then try to get user avatar. Since we pass the same icon as a prop, it doesn't make a difference if we pass it to the fallback details. Plus, it looks like before, undefined was always put as an avatar, so we shouldn't break anything.
There was a problem hiding this comment.
Thank you for explanation, I'm fine with removing!
|
@thesahindia 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] |
# Conflicts: # src/types/onyx/OnyxCommon.ts
|
@thesahindia kind bump 😄 |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2023-11-15.at.8.42.26.PM.movAndroid: mWeb ChromeScreen.Recording.2023-11-15.at.8.41.53.PM.moviOS: NativeScreen.Recording.2023-11-15.at.8.57.51.PM.moviOS: mWeb SafariScreen.Recording.2023-11-15.at.8.44.48.PM.mov |
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #25077 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
| {[...avatars].splice(0, maxAvatarsInRow).map((icon, index) => ( | ||
| <UserDetailsTooltip | ||
| key={`stackedAvatars-${index}`} | ||
| key={`stackedAvatars-${icon.id}`} |
There was a problem hiding this comment.
icon.id was undefined for Workspaces and hence created warnings. It was fixed here #31484
| {[...avatars].splice(0, maxAvatarsInRow).map((icon, index) => ( | ||
| <UserDetailsTooltip | ||
| key={`stackedAvatars-${index}`} | ||
| key={`stackedAvatars-${icon.id}`} |
There was a problem hiding this comment.
There was small regression on this line. Workspace avatars don't have id so console error happened on Settings > Workspaces list page
Fixed in #31484
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.0-3 🚀
|



Details
[TS migration] Migrate 'MultipleAvatars.js' component to TypeScript
Fixed Issues
$ #25077
PROPOSAL: N/A
Tests
Offline tests
N/A
QA Steps
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 */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
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop