[HOLD for payment 2021-09-16] Not getting any feedback when updating/removing the Avatar
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:
- Login to newDot
- Go to settings
- Select Profile
- Update or Remove your profile picture
- 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:
Triggered auto assignment to @stephanieelliott (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.
Proposal
Explaination
- It's because we're only showing the
feedbackin thisfunctionon line186which 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
GrowlinsidesetPersonalDetailsafter line219and then we can remove it fromProfilePage.json line186https://github.com/Expensify/App/blob/474a1492b5507390cf65aa177aa4e20b6f06a0a4/src/libs/actions/PersonalDetails.js#L214-L220 -
Feedback for removing the Avatar will be added after line
285https://github.com/Expensify/App/blob/474a1492b5507390cf65aa177aa4e20b6f06a0a4/src/libs/actions/PersonalDetails.js#L281-L286 -
Additionally, messages can be little different for
Updating & Removing the Avatarand that can be achieved by adding an additionalsuccessMsgparam tosetPersonalDetails
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!
Triggered auto assignment to @pecanoro (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
Triggered auto assignment to @kevinksullivan (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
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?
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.
@kevinksullivan Huh... This is 4 days overdue. Who can take care of this?
@pecanoro my assumption is the original proposal passed your review?
Posted
https://www.upwork.com/jobs/~01f18960ef855687a3
Triggered auto assignment to @johnmlee101 (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.
@Expensify/design
- Do we want the feedback/confirmation in the top screen-grab video?
- If so, is it consistent with other instances in NewDot?
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()
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));
}
setAvataris already callingsetPersonalDetailsso there's no need to add aGrowlin that function.deleteAvatarhowever will also need aGrowlas it's directly calling the API.
@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
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
Bump @Expensify/design !
Sorry for the delay - I agree that the growl feedback that is shown in the "Expected Result" video looks good to me.
Thanks @shawnborton. @johnmlee101, can you review @aman-atg 's proposal above?
ping Melvin and @johnmlee101, when ya have time