App icon indicating copy to clipboard operation
App copied to clipboard

[HOLD for payment 2021-09-16] Not getting any feedback when updating/removing the Avatar

Open aman-atg opened this issue 5 years ago • 38 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. Login to newDot
  2. Go to settings
  3. Select Profile
  4. Update or Remove your profile picture
  5. No feedback will be given.

Expected Result:

https://user-images.githubusercontent.com/28243942/128325179-690af17d-cbf5-47ba-b088-a1b7808b3c26.mp4

Actual Result:

https://user-images.githubusercontent.com/28243942/128325399-ce52e1ef-cafe-459e-8658-aa532cc8b4a9.mp4

Workaround:

Visual

Platform:

Where is this issue occurring?

  • Web
  • iOS
  • Android
  • Desktop App
  • Mobile Web

Version Number: Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation Expensify/Expensify Issue URL:

View all open jobs on Upwork

aman-atg avatar Aug 05 '21 09:08 aman-atg

Triggered auto assignment to @stephanieelliott (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

MelvinBot avatar Aug 05 '21 09:08 MelvinBot

Proposal

Explaination

  • It's because we're only showing the feedback in this function on line 186 which doesn't account for changing profile picture https://github.com/Expensify/App/blob/474a1492b5507390cf65aa177aa4e20b6f06a0a4/src/pages/settings/Profile/ProfilePage.js#L164-L187

Solution

 Growl.show(translateLocal('profilePage.growlMessageOnSave'), CONST.GROWL.SUCCESS, 3000);
  • We can solve this issue by adding Growl inside setPersonalDetails after line 219 and then we can remove it from ProfilePage.js on line 186 https://github.com/Expensify/App/blob/474a1492b5507390cf65aa177aa4e20b6f06a0a4/src/libs/actions/PersonalDetails.js#L214-L220

  • Feedback for removing the Avatar will be added after line 285 https://github.com/Expensify/App/blob/474a1492b5507390cf65aa177aa4e20b6f06a0a4/src/libs/actions/PersonalDetails.js#L281-L286

  • Additionally, messages can be little different for Updating & Removing the Avatar and that can be achieved by adding an additional successMsg param to setPersonalDetails

aman-atg avatar Aug 05 '21 09:08 aman-atg

Was able to reproduce, could not find any other reports of this, seems like something we will want to fix 👍 Moving on to Engineering review!

stephanieelliott avatar Aug 05 '21 13:08 stephanieelliott

Triggered auto assignment to @pecanoro (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

MelvinBot avatar Aug 05 '21 13:08 MelvinBot

Triggered auto assignment to @kevinksullivan (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

MelvinBot avatar Aug 05 '21 17:08 MelvinBot

Why are we giving a success feedback in the first place? Pretty sure, we're showing a success message even if the API method fails.

https://github.com/Expensify/App/blob/474a1492b5507390cf65aa177aa4e20b6f06a0a4/src/pages/settings/Profile/ProfilePage.js#L186

I think we should get rid of Growl entirely for profile page. Because the button turning from green to disabled is a good enough visual feedback when I change my name.

Similiarly, the profile picture changing is a good enough visual feedback.

Thoughts?

rushatgabhane avatar Aug 05 '21 23:08 rushatgabhane

Pretty sure, we're showing a success message even if the API method fails.

I had the same thought in mind, and that can be easily handled by showing Growl after the API call is complete. But, it's a different matter rn.

aman-atg avatar Aug 05 '21 23:08 aman-atg

@kevinksullivan Huh... This is 4 days overdue. Who can take care of this?

MelvinBot avatar Aug 10 '21 19:08 MelvinBot

@pecanoro my assumption is the original proposal passed your review?

kevinksullivan avatar Aug 10 '21 23:08 kevinksullivan

Posted

https://www.upwork.com/jobs/~01f18960ef855687a3

kevinksullivan avatar Aug 10 '21 23:08 kevinksullivan

Triggered auto assignment to @johnmlee101 (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

MelvinBot avatar Aug 10 '21 23:08 MelvinBot

@Expensify/design

  1. Do we want the feedback/confirmation in the top screen-grab video?
  2. If so, is it consistent with other instances in NewDot?

mallenexpensify avatar Aug 10 '21 23:08 mallenexpensify

The feedback should be shown after successfully uploading the Image! That can be done in the on ImageSelected and onImageRemoved methods that are in the AvatarWithImagePicker tag.

We need to add

Growl.show(this.props.translate('profilePage.growlMessageOnSave'), CONST.GROWL.SUCCESS, 3000); 

When the response code is 200 inside the methods setAvatar() and deleteAvatar()

Anass-ABEA avatar Aug 11 '21 02:08 Anass-ABEA

We should not change the working of AvatarWithImagePicker since it's being used for workspace as well. And to get the Growl after the API call is complete, setPersonalDetails will look like this :

function setPersonalDetails(details) {
    API.PersonalDetails_Update({details: JSON.stringify(details)})
        .then((response) => {
            if (response.jsonCode === 200) {
                Growl.show(translateLocal('profilePage.growlMessageOnSave'), CONST.GROWL.SUCCESS, 3000);
            }
            if (details.timezone) {
                NameValuePair.set(CONST.NVP.TIMEZONE, details.timezone);
            }
            mergeLocalPersonalDetails(details);
        }).catch(error => console.debug('Error while setting personal details', error));
}
  • setAvatar is already calling setPersonalDetails so there's no need to add a Growl in that function.
  • deleteAvatar however will also need a Growl as it's directly calling the API.

aman-atg avatar Aug 11 '21 07:08 aman-atg

@aman-atg I guess there is a possibility to apply the changes you suggested to setPersonalDetails(). But that would show the message when the time zone is changed. One more thing, the Growl inside the updatePersonalDetails() should be removed since setPersonalDetails() is called

Anass-ABEA avatar Aug 11 '21 16:08 Anass-ABEA

@Anass-ABEA

But that would show the message when the time zone is changed.

Thanks for bringing that up. I think we can fix that problem by having a 2nd parameter for setPersonalDetails() like showMessage which can take care of that.

One more thing, the Growl inside the updatePersonalDetails() should be removed since setPersonalDetails() is called

Yes, you're right. I've mentioned that in the initial proposal as well.

and then we can remove it from ProfilePage.js on line 186

aman-atg avatar Aug 13 '21 17:08 aman-atg

Bump @Expensify/design !

johnmlee101 avatar Aug 13 '21 20:08 johnmlee101

Sorry for the delay - I agree that the growl feedback that is shown in the "Expected Result" video looks good to me.

shawnborton avatar Aug 16 '21 07:08 shawnborton

Thanks @shawnborton. @johnmlee101, can you review @aman-atg 's proposal above?

mallenexpensify avatar Aug 17 '21 00:08 mallenexpensify

ping Melvin and @johnmlee101, when ya have time

mallenexpensify avatar Aug 20 '21 00:08 mallenexpensify