-
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
[TS migration] Migrate 'MultipleAvatars.js' component to TypeScript #31056
[TS migration] Migrate 'MultipleAvatars.js' component to TypeScript #31056
Conversation
src/components/MultipleAvatars.tsx
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blazejkustra Maybe it makes sense to remove it then?
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.
Why would you remove it? 🤔
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.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for explanation, I'm fine with removing!
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.
Updated!
@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. |
<UserDetailsTooltip | ||
key={`stackedAvatars-${index}`} | ||
key={`stackedAvatars-${icon.id}`} |
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.
icon.id
was undefined for Workspaces and hence created warnings. It was fixed here #31484
<UserDetailsTooltip | ||
key={`stackedAvatars-${index}`} | ||
key={`stackedAvatars-${icon.id}`} |
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 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 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)/** comment above it */
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)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
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop