mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 06:15:28 +08:00
64ead3c3a1
* FIX: Revoking admin or moderator status doesn't require refresh to delete/anonymize/merge user On the /admin/users/<id>/<username> page, there are action buttons that are either visible or hidden depending on a few fields from the AdminDetailsSerializer: `can_be_deleted`, `can_be_anonymized`, `can_be_merged`, `can_delete_all_posts`. These fields are updated when granting/revoking admin or moderator status. However, those updates were not being reflected on the page. E.g. if a user is granted moderation privileges, the 'anonymize user' and 'merge' buttons still appear on the page, which is inconsistent with the backend state of the user. It requires refreshing the page to update the state. This commit fixes that issue, by syncing the client model state with the server state when handling a successful response from the server. Now, when revoking privileges, the buttons automatically appear without refreshing the page. Similarly, when granting moderator privileges, the buttons automatically disappear without refreshing the page. * Add detailed user response to spec for changed routes. Add tests to verify that the revoke_moderation, grant_moderation, and revoke_admin routes return a response formatted according to the AdminDetailedUserSerializer. |
||
---|---|---|
.. | ||
admin_controller.rb | ||
api_controller.rb | ||
backups_controller.rb | ||
badges_controller.rb | ||
color_schemes_controller.rb | ||
dashboard_controller.rb | ||
email_controller.rb | ||
email_styles_controller.rb | ||
email_templates_controller.rb | ||
embeddable_hosts_controller.rb | ||
embedding_controller.rb | ||
emojis_controller.rb | ||
groups_controller.rb | ||
impersonate_controller.rb | ||
permalinks_controller.rb | ||
plugins_controller.rb | ||
reports_controller.rb | ||
robots_txt_controller.rb | ||
screened_emails_controller.rb | ||
screened_ip_addresses_controller.rb | ||
screened_urls_controller.rb | ||
search_logs_controller.rb | ||
site_settings_controller.rb | ||
site_texts_controller.rb | ||
staff_action_logs_controller.rb | ||
themes_controller.rb | ||
user_fields_controller.rb | ||
users_controller.rb | ||
versions_controller.rb | ||
watched_words_controller.rb | ||
web_hooks_controller.rb |