-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
fix: avatar not changed in tooltip when updating avatar #20713
Conversation
@pecanoro @parasharrajat 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] |
Reassigning since @allroundexperts can review it sooner! |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-06-14.at.6.49.47.AM.movMobile Web - ChromeScreen.Recording.2023-06-14.at.7.03.38.AM.movMobile Web - SafariScreen.Recording.2023-06-14.at.7.07.32.AM.movDesktopScreen.Recording.2023-06-14.at.6.51.11.AM.moviOSScreen.Recording.2023-06-14.at.7.11.54.AM.movAndroidScreen.Recording.2023-06-14.at.7.12.37.AM.mov |
src/libs/actions/PersonalDetails.js
Outdated
@@ -416,7 +454,7 @@ function updateAvatar(file) { | |||
*/ | |||
function deleteAvatar() { | |||
// We want to use the old dot avatar here as this affects both platforms. | |||
const defaultAvatar = UserUtils.getDefaultAvatarURL(currentUserEmail); | |||
const defaultAvatar = UserUtils.getDefaultAvatarURL(currentUserEmail, 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.
@s-alves10 Let's not try to change it to true
. I'm sure we had it as false
due to a reason.
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 set to false, default user avatar URL is different than the ones that are current using. When user removes avatar, there is an inconsistency. You can easily check that.
Please let me know if you still want to change 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.
I can see the in-consistency, but why does it happen for the avatar in the tooltip and not with avatars elsewhere?
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 avatars get avatar URL with the below function.
Lines 150 to 152 in 0a471b0
function getAvatar(avatarURL, login) { | |
return isDefaultAvatar(avatarURL) ? getDefaultAvatar(login) : avatarURL; | |
} |
This function corrects this error, but it seems redundant. I think the current change doesn't affect this function
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 we use this function inside our tooltip like we are using elsewhere? This will prevent us from using true
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.
@s-alves10 Any update on above?
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
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.
Awesome. Thanks!
src/libs/actions/PersonalDetails.js
Outdated
onyxMethod: Onyx.METHOD.MERGE, | ||
key: ONYXKEYS.PERSONAL_DETAILS_LIST, | ||
value: { | ||
[personalDetails[currentUserEmail].accountID]: { |
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.
For all of these, can you please add these only if personalDetails[currentUserEmail].accountID
exists?
src/libs/actions/PersonalDetails.js
Outdated
onyxMethod: Onyx.METHOD.MERGE, | ||
key: ONYXKEYS.PERSONAL_DETAILS_LIST, | ||
value: { | ||
[personalDetails[currentUserEmail].accountID]: { |
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.
Same here.
src/libs/actions/PersonalDetails.js
Outdated
onyxMethod: Onyx.METHOD.MERGE, | ||
key: ONYXKEYS.PERSONAL_DETAILS_LIST, | ||
value: { | ||
[personalDetails[currentUserEmail].accountID]: { |
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.
Here as well.
src/libs/actions/PersonalDetails.js
Outdated
onyxMethod: Onyx.METHOD.MERGE, | ||
key: ONYXKEYS.PERSONAL_DETAILS_LIST, | ||
value: { | ||
[personalDetails[currentUserEmail].accountID]: { |
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.
Here too.
src/libs/actions/PersonalDetails.js
Outdated
onyxMethod: Onyx.METHOD.MERGE, | ||
key: ONYXKEYS.PERSONAL_DETAILS_LIST, | ||
value: { | ||
[personalDetails[currentUserEmail].accountID]: { |
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.
And here lastly.
@s-alves10 PR mostly looks good. Can you please handle comments ASAP? Thanks! |
@s-alves10 Can you also check why the uploaded image while in offline mode, does not show up in the image viewer modal? Screen.Recording.2023-06-14.at.7.46.26.AM.mov |
@s-alves10 Please confirm the above item as well and check it if it passes. |
src/libs/actions/PersonalDetails.js
Outdated
@@ -379,6 +379,7 @@ function updateAvatar(file) { | |||
}, | |||
}, | |||
]; | |||
|
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 needed.
This seems out of scope but let me check. |
It looked so to me as well but just wanted to confirm. If it's not related to your change, then we'll create a new ticket for this. |
When you upload an image in offline mode, avatar is stored as blob. blob url hasn't image extension in it and image check fails here App/src/components/AttachmentView.js Line 110 in 0a471b0
That's why it isn't displayed as image |
Do you think this is a regression? |
Verify and then check. |
Checked. |
@allroundexperts @s-alves10 can you confirm that once you go back online, the avatar will show correctly in this scenario? |
@mountiny It works once you're back online! |
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 well as well!
@pecanoro I think its good to CP this and make a follow up issue for the problem discovered by this PR. All yours 🙇 |
Awesome, doing a final test run! |
The bug #1 we found with the profile image, I think it might be working on dev and some fix might have been recently merged as it works well for me. We will see after the back-end deploy anyways, otherwise, all good! Approving! |
Congrats, that’s your 5th PR merged! 🎉 Do you know about the ContributorPlus role? It’s an opportunity to earn more in the Expensify Open Source community. Keep up the great work - thanks! |
I can work on the follow up issue. Thanks |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Oh shit, I forgot to add the CP label. |
|
fix: avatar not changed in tooltip when updating avatar (cherry picked from commit f467085)
…ing-20713 🍒 Cherry pick PR #20713 to staging 🍒
🚀 Cherry-picked to staging by https://github.com/AndrewGable in version: 1.3.27-7 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
Tested on staging, bug was fixed! |
I can verify that this is indeed fixed. |
🚀 Deployed to production by https://github.com/AndrewGable in version: 1.3.27-7 🚀
|
🚀 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 🚀
|
1 similar comment
🚀 Deployed to production by https://github.com/AndrewGable in version: 1.3.28-5 🚀
|
Details
Fixed Issues
$ #20672
PROPOSAL: #20672 (comment)
Tests
Offline tests
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
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)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
Web
20672_mac_chrome.mp4
Mobile Web - Chrome
20672_android_chrome.mp4
Mobile Web - Safari
20672_ios_safari.mp4
Desktop
20672_mac_desktop.mp4
iOS
20672_ios_native.mp4
Android
20672_android_native.mp4