-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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 behavior when editing bot avatar. #24427
Comments
Hello @zulip/server-settings members, this issue was labeled with the "area: settings (user)", "area: settings (admin/org)", "area: settings UI" labels, so you may want to check it out! |
@SahilSingh177 FYI. |
@sahil839 thanks for picking up this issue, I tried the steps myself and faced the same problems as seen in your video reference.I would like to work on this issue and also want to invite you to collaborate on this |
@zulipbot claim |
Hello @arijitghosal03! Thanks for your interest in Zulip! You have attempted to claim an issue without the label "help wanted". You can only claim and submit pull requests for issues with the help wanted label. If this is your first time here, we recommend reading our guide for new contributors before getting started. |
@arijitghosal03 To be clear, I have not claimed the issue, I just opened it. I do not intend to work on this as I am occupied with other work. I have not added "help wanted" label as I first wanted to get the feedback from Alya about the correct expected behavior. |
@zulipbot claim. |
Hello @Ujjawal3! Thanks for your interest in Zulip! You have attempted to claim an issue without the label "help wanted". You can only claim and submit pull requests for issues with the help wanted label. If this is your first time here, we recommend reading our guide for new contributors before getting started. |
I am sorry for the delayed response. I found that this bug was not present at the time when I implemented the changes. It is possible that subsequent modifications may have had an impact on the code, I will investigate further to identify the root cause. |
@zulipbot claim |
Hello @Ddharmani3! Thanks for your interest in Zulip! You have attempted to claim an issue without the label "help wanted". You can only claim and submit pull requests for issues with the help wanted label. If this is your first time here, we recommend reading our guide for new contributors before getting started. |
@sahil839, I discovered that One potential solution is to check if |
@SahilSingh177 @sahil839, I am currently working on this issue and have completed about 70% of the work. Building upon Sahil Singh's observation, I have noticed that Additionally, I have found that when a new bot is added without any user-uploaded avatar and the edit form is immediately opened, the Gravatar image is displayed and does not return
In my solution, I used I tried to locate the part of the code that is causing avatar_url to be null when the page is reloaded, but I haven't been able to find it yet. @sahil839, could you please guide me on what part of the code could be causing this issue? Also, if you have any suggestions on how I can improve my current approach, please let me know. |
Thanks for the digging around the code. So, the issue is that The And in long-term we probably would want to fix the |
Fixed gravatar not visible in edit bot form by making bot_avatar_url equal to bot.avatar_url || people.medium_avatar_url_for_person(bot) which solves the case when avatar_url is returned null. Added new feature for completely removing user uploaded avatar by adding a delete button which shows on hovering on current avatar. Added a onclick event listener for the delete button in avatar.js which change the current avatar image to bot gravatar and changed value of a temporary variable bot_details.avatar_source to "G". The temporary avatar_source is passed to backend only when dialog_submit_button in edit bot form is clicked. Updated format_user_row function in lib/users.py to also return avatar_source field in realm_user. Updated zulip.yaml and 4 other tests to incorporate the new field avatar_source. Fixes zulip#24427
Fixed gravatar not visible in edit bot form by making bot_avatar_url equal to bot.avatar_url || people.medium_avatar_url_for_person(bot) which solves the case when avatar_url is returned null. Added new feature for completely removing user uploaded avatar by adding a delete button which shows on hovering on current avatar. Added a onclick event listener for the delete button in avatar.js which change the current avatar image to bot gravatar and changed value of a temporary variable bot_details.avatar_source to "G". The temporary avatar_source is passed to backend only when dialog_submit_button in edit bot form is clicked. Updated format_user_row function in lib/users.py to also return avatar_source field in realm_user. Updated zulip.yaml and 4 other tests to incorporate the new field avatar_source i realm_user. Fixes zulip#24427
Fixed gravatar not visible in edit bot form by making bot_avatar_url equal to bot.avatar_url || people.medium_avatar_url_for_person(bot) which solves the case when avatar_url is returned null. Added new feature for completely removing user uploaded avatar by adding a delete button which shows on hovering on current avatar. Added a onclick event listener for the delete button in avatar.js which change the current avatar image to bot gravatar and changed value of a temporary variable bot_details.avatar_source to "G". The temporary avatar_source is passed to backend only when dialog_submit_button in edit bot form is clicked. Updated format_user_row function in lib/users.py to also return avatar_source field in realm_user. Updated zulip.yaml and 4 other tests to incorporate the new field avatar_source i realm_user. Fixes zulip#24427
Fixed gravatar not visible in edit bot form by making bot_avatar_url equal to bot.avatar_url || people.medium_avatar_url_for_person(bot) which solves the case when avatar_url is returned null. Fixes zulip#24427
Added new feature for completely removing user uploaded avatar by adding a delete button which shows on hovering on current avatar only if its not gravtar. Added a onclick event listener for the delete button in avatar.js which change the current avatar image to bot gravatar and changed value of a temporary variable bot_details.avatar_source(passed to build_bot_edit_widget function from settings_bots.js) to "G". The temporary avatar_source is passed to backend only when dialog_submit_button in edit bot form is clicked. Updated format_user_row function in lib/users.py to also return avatar_source field in realm_user. Updated zulip.yaml and 4 other tests to incorporate the new field avatar_source i realm_user. Fixes zulip#24427
Added new feature for completely removing user uploaded avatar by adding a delete button which shows on hovering on current avatar only if its not a gravtar. Added a onclick event listener for the delete button in avatar.js which change the current avatar image to bot gravatar and changed value of a temporary variable bot_details.avatar_source(passed to build_bot_edit_widget function from settings_bots.js) to "G". The temporary avatar_source is passed to backend only when dialog_submit_button in edit bot form is clicked. Updated format_user_row function in lib/users.py to also return avatar_source field in realm_user. Updated zulip.yaml and 4 other tests to incorporate the new field avatar_source i realm_user. Fixes zulip#24427
Added new feature for completely removing user uploaded avatar by adding a delete button which shows on hovering on current avatar only if its not a gravtar. Added a onclick event listener for the delete button in avatar.js which change the current avatar image to bot gravatar and changed value of a `#current_bot_avatar_source` which is an input of type hidden to "G". Thevalue of a `#current_bot_avatar_source` is passed to backend only when dialog_submit_button in edit bot form is clicked. Updated format_user_row function in lib/users.py to also return avatar_source field in realm_user. Updated zulip.yaml and 4 other tests to incorporate the new field avatar_source i realm_user. Fixes zulip#24427
Added new feature for completely removing user uploaded avatar by adding a delete button which shows on hovering on current avatar only if its not a gravtar. Added a onclick event listener for the delete button in avatar.js which change the current avatar image to bot gravatar and changed value of a `#current_bot_avatar_source` which is an input of type hidden to "G". Thevalue of a `#current_bot_avatar_source` is passed to backend only when dialog_submit_button in edit bot form is clicked. Updated format_user_row function in lib/users.py to also return avatar_source field in realm_user. Updated zulip.yaml and 4 other tests to incorporate the new field avatar_source i realm_user. Fixes zulip#24427
Fixed gravatar not visible in edit bot form by making bot_avatar_url equal to bot.avatar_url || people.medium_avatar_url_for_person(bot) which solves the case when avatar_url is returned null. Fixes zulip#24427
Added new feature for completely removing user uploaded avatar by adding a delete button which shows on hovering on current avatar only if its not a gravtar. Added a onclick event listener for the delete button in avatar.js which change the current avatar image to bot gravatar and change value of a `#current_bot_avatar_source` which is an input of type hidden to "G". The value of a `#current_bot_avatar_source` is passed to backend only when dialog_submit_button in edit bot form is clicked. Updated format_user_row function in lib/users.py to also return avatar_source field in realm_user. Updated zulip.yaml and 4 other tests to incorporate the new field avatar_source in realm_user. Fixes zulip#24427
Added new feature for completely removing user uploaded avatar by adding a delete button which shows on hovering on current avatar only if its not a gravtar. Added a onclick event listener for the delete button in avatar.js which change the current avatar image to bot gravatar and change value of a `#current_bot_avatar_source` which is an input of type hidden to "G". The value of a `#current_bot_avatar_source` is passed to backend only when dialog_submit_button in edit bot form is clicked. Updated format_user_row function in lib/users.py to also return avatar_source field in realm_user. Updated zulip.yaml and 4 other tests to incorporate the new field avatar_source in realm_user. Fixes zulip#24427
Fixed gravatar not visible in edit bot form by making bot_avatar_url equal to bot.avatar_url || people.medium_avatar_url_for_person(bot) which solves the case when avatar_url is returned null. Fixes zulip#24427
This is a prep commit to include avatar_source field in realm_user to enable delete bot avatar in bot edit modal. Updated format_user_row function in lib/users.py to also return avatar_source field in realm_user. Fixes zulip#24427
Added new feature for completely removing user uploaded avatar by adding a delete button which shows on hovering on current avatar only if its not a gravtar. Added a onclick event listener for the delete button in avatar.js which change the current avatar image to bot gravatar and change value of a `#current_bot_avatar_source` which is an input of type hidden to "G". The value of a `#current_bot_avatar_source` is passed to backend only when dialog_submit_button in edit bot form is clicked. Fixes zulip#24427
This is a prep commit to include avatar_source field in realm_user to enable delete bot avatar in bot edit modal. Updated format_user_row function in lib/users.py to also return avatar_source field in realm_user. Fixes zulip#24427
Added new feature for completely removing user uploaded avatar by adding a delete button which shows on hovering on current avatar only if its not a gravtar. Added a onclick event listener for the delete button in avatar.js which change the current avatar image to bot gravatar and change value of a `#current_bot_avatar_source` which is an input of type hidden to "G". The value of a `#current_bot_avatar_source` is passed to backend only when dialog_submit_button in edit bot form is clicked. Fixes zulip#24427
There are two issues in the UI for updating bot avatar.
Current behavior
The current avatar is not shown when the bot has a default gravatar set. I can see that it was visible in the GIF shared in first comment of settings: show current avatar in bot editing form #23965, but the behavior might have changed when updating the PR.
There is no
Clear avatar
orClear profile picture
button in edit form if bot already had a profile picture set. It is only shown once I update the existing avatar and then clicking on it it changes it to the old avatar and does not completely remove it.Expected behavior
Clear profile picture
button when avatar is set to something other than the default gravatar. I am not sure what should theClear profile picture
button do when user changes the avatar one time after opening the edit modal. Should it be changed it to the previous avatar or to the default gravatar. @alya thoughts?The text was updated successfully, but these errors were encountered: