mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
API: Migrate POST /ui_settings/change to PATCH /settings/ui
This commit is contained in:
@@ -769,8 +769,8 @@ function _setup_page() {
|
|||||||
labs_updates[setting] = $("#" + setting).is(":checked");
|
labs_updates[setting] = $("#" + setting).is(":checked");
|
||||||
});
|
});
|
||||||
|
|
||||||
channel.post({
|
channel.patch({
|
||||||
url: '/json/ui_settings/change',
|
url: '/json/settings/ui',
|
||||||
data: labs_updates,
|
data: labs_updates,
|
||||||
success: function (resp, statusText, xhr) {
|
success: function (resp, statusText, xhr) {
|
||||||
var message = i18n.t("Updated __product_name__ Labs settings! You will need to reload for these changes to take effect.", page_params);
|
var message = i18n.t("Updated __product_name__ Labs settings! You will need to reload for these changes to take effect.", page_params);
|
||||||
|
|||||||
@@ -1633,8 +1633,8 @@ class ChangeSettingsTest(ZulipTestCase):
|
|||||||
|
|
||||||
def test_ui_settings(self):
|
def test_ui_settings(self):
|
||||||
# type: () -> None
|
# type: () -> None
|
||||||
self.check_for_toggle_param("/json/ui_settings/change", "autoscroll_forever")
|
self.check_for_toggle_param_patch("/json/settings/ui", "autoscroll_forever")
|
||||||
self.check_for_toggle_param("/json/ui_settings/change", "default_desktop_notifications")
|
self.check_for_toggle_param_patch("/json/settings/ui", "default_desktop_notifications")
|
||||||
|
|
||||||
def test_toggling_left_side_userlist(self):
|
def test_toggling_left_side_userlist(self):
|
||||||
# type: () -> None
|
# type: () -> None
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ from zerver.lib.validator import check_bool, check_string
|
|||||||
from zerver.lib.request import JsonableError
|
from zerver.lib.request import JsonableError
|
||||||
from zerver.models import UserProfile, Realm, name_changes_disabled
|
from zerver.models import UserProfile, Realm, name_changes_disabled
|
||||||
|
|
||||||
@authenticated_json_post_view
|
|
||||||
@has_request_variables
|
@has_request_variables
|
||||||
def json_change_ui_settings(request, user_profile,
|
def json_change_ui_settings(request, user_profile,
|
||||||
autoscroll_forever=REQ(validator=check_bool,
|
autoscroll_forever=REQ(validator=check_bool,
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ legacy_urls = [
|
|||||||
url(r'^json/bulk_invite_users$', zerver.views.invite.json_bulk_invite_users),
|
url(r'^json/bulk_invite_users$', zerver.views.invite.json_bulk_invite_users),
|
||||||
url(r'^json/refer_friend$', zerver.views.invite.json_refer_friend),
|
url(r'^json/refer_friend$', zerver.views.invite.json_refer_friend),
|
||||||
url(r'^json/settings/change$', zerver.views.user_settings.json_change_settings),
|
url(r'^json/settings/change$', zerver.views.user_settings.json_change_settings),
|
||||||
url(r'^json/ui_settings/change$', zerver.views.user_settings.json_change_ui_settings),
|
|
||||||
|
|
||||||
# We should remove this endpoint and all code related to it.
|
# We should remove this endpoint and all code related to it.
|
||||||
# It returns a 404 if the stream doesn't exist, which is confusing
|
# It returns a 404 if the stream doesn't exist, which is confusing
|
||||||
|
|||||||
@@ -253,6 +253,8 @@ v1_api_and_json_patterns = [
|
|||||||
{'PATCH': 'zerver.views.user_settings.update_display_settings_backend'}),
|
{'PATCH': 'zerver.views.user_settings.update_display_settings_backend'}),
|
||||||
url(r'^settings/notifications$', rest_dispatch,
|
url(r'^settings/notifications$', rest_dispatch,
|
||||||
{'PATCH': 'zerver.views.user_settings.json_change_notify_settings'}),
|
{'PATCH': 'zerver.views.user_settings.json_change_notify_settings'}),
|
||||||
|
url(r'^settings/ui$', rest_dispatch,
|
||||||
|
{'PATCH': 'zerver.views.user_settings.json_change_ui_settings'}),
|
||||||
|
|
||||||
# users/me/alert_words -> zerver.views.alert_words
|
# users/me/alert_words -> zerver.views.alert_words
|
||||||
url(r'^users/me/alert_words$', rest_dispatch,
|
url(r'^users/me/alert_words$', rest_dispatch,
|
||||||
|
|||||||
Reference in New Issue
Block a user