Skip to content
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

[User Settings] Allow users to modify avatar photo #2131

Merged
merged 8 commits into from
Apr 1, 2021

Conversation

Maftalion
Copy link
Contributor

Details

Fixed Issues

Fixes #2053

Tests

  1. Go to Settings -> Profile by clicking your avatar
  2. Click Edit Photo, and upload a new photo
  3. If you remove or have a default photo, the remove photo option should not appear

QA Steps

same as above

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Video Walkthrough

Screen.Recording.2021-03-28.at.3.52.42.PM.mov

Screenshots

Web

Screen Shot 2021-03-28 at 3 46 25 PM

Mobile Web

Screen Shot 2021-03-28 at 3 50 00 PM

Desktop

Screen Shot 2021-03-28 at 3 48 16 PM

iOS

Screen Shot 2021-03-28 at 3 46 58 PM
Screen Shot 2021-03-28 at 3 47 16 PM

Android

Screen Shot 2021-03-28 at 3 52 09 PM

@Maftalion Maftalion requested a review from a team as a code owner March 28, 2021 23:05
@botify botify requested review from deetergp and removed request for a team March 28, 2021 23:06
@shawnborton
Copy link
Contributor

Here is the upload icon you need: upload.svg.zip

Copy link
Contributor

@deetergp deetergp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good to me, but I cannot seem to get the actual upload functionality to work. When I attempt to upload, I end up seeing the following in my logs:

2021-03-29T21:55:53.273159+00:00 expensidev php-fpm: cLiamR /api.php scott@expensify.com !https://expensify.cash/! ?user? [info] [push] Push_Service - Push_Service sending event ~~ channel: '[0: 'public-debugserverid5e068a4783949']' eventName: 'debug' eventData: '{"level":"warn","message":"UserAPI - Empty string provided as image when uploading avatar."}'

I'm seeing this same behavior on both the platforms I tested: Web & iOS.

@NikkiWines
Copy link
Contributor

NikkiWines commented Mar 29, 2021

@deetergp are you to date on master on web? We merged a Web-Expensify change for this functionality. Just tested myself on web and it's working well 👍 gonna leave a full review as well.

@deetergp
Copy link
Contributor

@NikkiWines That was it, @NikkiWines, thanks! Was able to verify that it works on Web, iOS, & Desktop, but could not get it to work on Mobile Web, where it failed to open a picker:
https://user-images.githubusercontent.com/766197/112908048-a78c7080-90a3-11eb-8884-feefbdc4118a.mp4

Copy link
Contributor

@NikkiWines NikkiWines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small comments, this is looking great! I find CreateMenu much more intuitive now that we're not maintaining that list inside of it.

One thing on the design, I personally quite like having the create menu follow the style we have currently for web/desktop (i.e. sliding out from the bottom left) but @michelle-thompson do you want it to pop up below the Edit Photo button like we have it in the mockups?

src/libs/actions/PersonalDetails.js Outdated Show resolved Hide resolved
src/pages/home/report/ReportActionCompose.js Outdated Show resolved Hide resolved
src/components/CreateMenu.js Outdated Show resolved Hide resolved
src/libs/actions/PersonalDetails.js Outdated Show resolved Hide resolved
@NikkiWines
Copy link
Contributor

Also was able to reproduce the issue @deetergp experienced with mWeb not opening a picker.

@michelle-thompson
Copy link
Contributor

I see your point about all other menu appearing in the bottom left, but let's position the menu underneath Edit Photo so it's clear what the menu actions would be affecting.

@Maftalion
Copy link
Contributor Author

@NikkiWines @michelle-thompson the popover location seemed to be an existing bug - #2090

I was waiting on that issue to be solved to see how to set it up here as well

@Maftalion
Copy link
Contributor Author

mWeb file attachment seems to be broken on current master as well

@shawnborton
Copy link
Contributor

I agree with @michelle-thompson, we should launch this menu in relation to the button that is tapped. In terms of animating the popover, I had a comment in a different PR that Rory addressed in terms of making the popover appear to animate downwards from the button location. Maybe this is helpful: #1878 (comment)

@NikkiWines
Copy link
Contributor

Since both the attachment picker mWeb issue and the popover issue exist on production at the moment I don't think we should block this PR on those being resolved (especially since I don't think either issue has a PR out yet).

I can make a follow-up issue to move the popover location to underneath the Edit Photo button if we agree that moving ahead for now is the right call.

Copy link
Contributor

@NikkiWines NikkiWines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor comment, otherwise looking great

src/libs/actions/PersonalDetails.js Outdated Show resolved Hide resolved
Copy link
Contributor

@NikkiWines NikkiWines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking great and code looks good to me. A comment on one thing I've noticed.

Uploading a photo - or removing a photo - updates some of the avatars (profile page, sidebar) but doesn't immediately update the avatars in the chats.

  • On mobile: It's pretty delayed, even when navigated to-and-away from reports. Not sure how much of this is due to it being tested on a sim.

    Screen.Recording.2021-03-31.at.12.05.40.PM.mov
  • On web/desktop: You can get the photo to update by navigating away and back to a report

    Screen.Recording.2021-03-31.at.11.36.50.AM.mov

Copy link
Contributor

@NikkiWines NikkiWines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok looks like the delayed avatar issue is related to an existing issue: https://github.com/Expensify/Expensify/issues/155256 - so let's not hold on that.

I think we should merge this and I'll create a separate issue to move the CreateMenu location to underneath the Edit Photo button once the underlying issue for that has been resolved.

How does that sound to you all?

PropTypes.oneOf(Object.values(CONST.MENU_ITEM_KEYS)),
menuItems: PropTypes.arrayOf(
PropTypes.shape({
icon: PropTypes.func.isRequired,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NAB: Just curious why this prop type is func. Isn't it a PNG?

Copy link
Contributor

@deetergp deetergp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

@deetergp deetergp merged commit 5794592 into Expensify:master Apr 1, 2021
@OSBotify
Copy link
Contributor

OSBotify commented Apr 1, 2021

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@Maftalion Maftalion mentioned this pull request Apr 7, 2021
5 tasks
@mallenexpensify
Copy link
Contributor

Got here from https://expensify.slack.com/archives/C01GTK53T8Q/p1617743567403300
Curious if we need a new issue for "Add Attachment" or if it will be addressed here

@Maftalion
Copy link
Contributor Author

@mallenexpensify Opened a pr here to fix that - #2254

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[User Settings] Allow users to modify avatar photo
7 participants