Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

settings: Move presence-enabled setting to 'Account & privacy'.

sahil8397eb183fdf75b
diff --git a/static/js/settings_account.js b/static/js/settings_account.js
index 2b15d3c7bb5..2556e15a9ca 100644
--- a/static/js/settings_account.js
+++ b/static/js/settings_account.js
@@ -681,4 +681,19 @@ export function set_up() {
$(".timezone-setting-status").expectOne(),
);
});
+
+ $("#presence_enabled").val(page_params.presence_enabled);
+
+ $("#presence_enabled").on("change", (e) => {
+ e.preventDefault();
+ e.stopPropagation();
+
+ const data = {presence_enabled: $("#presence_enabled").prop("checked")};
+ settings_ui.do_settings_change(
+ channel.patch,
+ "/json/settings/notifications",
+ data,
+ $(".privacy-setting-status").expectOne(),
+ );
+ });
}
diff --git a/static/js/settings_config.js b/static/js/settings_config.js
index c7cb591c7d9..86f8e9705e8 100644
--- a/static/js/settings_config.js
+++ b/static/js/settings_config.js
@@ -387,13 +387,10 @@ const email_notification_settings = [
"enable_marketing_emails",
];
-const presence_notification_settings = ["presence_enabled"];
-
const other_notification_settings = desktop_notification_settings.concat(
["desktop_icon_count_display"],
mobile_notification_settings,
email_notification_settings,
- presence_notification_settings,
["notification_sound"],
);
@@ -441,7 +438,6 @@ export const all_notifications = () => ({
desktop_notification_settings,
mobile_notification_settings,
email_notification_settings,
- presence_notification_settings,
},
show_push_notifications_tooltip: {
push_notifications: !page_params.realm_push_notifications_enabled,
diff --git a/static/styles/settings.css b/static/styles/settings.css
index e4807047b1e..eb06f3d651a 100644
--- a/static/styles/settings.css
+++ b/static/styles/settings.css
@@ -597,7 +597,8 @@ input[type="checkbox"] {
.alert-notification.custom-field-status,
.alert-notification.full-name-status,
- .alert-notification.timezone-setting-status {
+ .alert-notification.timezone-setting-status,
+ .alert-notification.presence-setting-status {
padding-top: 0;
padding-bottom: 0;
margin-top: 0;
diff --git a/static/templates/settings/account_settings.hbs b/static/templates/settings/account_settings.hbs
index e7b25385564..459e16d631e 100644
--- a/static/templates/settings/account_settings.hbs
+++ b/static/templates/settings/account_settings.hbs
@@ -95,6 +95,17 @@
</div>
</div>
+ <div class="form-horizontal" id="privacy_settings_box">
+ <h3 class="inline-block">{{t "Privacy" }}</h3>
+ <div class="alert-notification privacy-setting-status"></div>
+ <div class="input-group">
+ {{> settings_checkbox
+ setting_name="presence_enabled"
+ is_checked=page_params.presence_enabled
+ label=settings_label.presence_enabled}}
+ </div>
+ </div>
+
<hr class="settings_separator" />
<div class="form-horizontal" id="api_key_button_box">
diff --git a/static/templates/settings/notification_settings.hbs b/static/templates/settings/notification_settings.hbs
index c06f7549d6e..99ccebd0437 100644
--- a/static/templates/settings/notification_settings.hbs
+++ b/static/templates/settings/notification_settings.hbs
@@ -106,15 +106,6 @@
label=(lookup ../settings_label this)}}
{{/each}}
- <h5>{{t "Presence" }}</h5>
-
- {{#each notification_settings.presence_notification_settings}}
- {{> settings_checkbox
- setting_name=this
- is_checked=(lookup ../page_params this)
- label=(lookup ../settings_label this)}}
- {{/each}}
-
</div>
</form>
</div>
diff --git a/templates/zerver/help/status-and-availability.md b/templates/zerver/help/status-and-availability.md
index f4feaf45a1a..11cbe73a3dc 100644
--- a/templates/zerver/help/status-and-availability.md
+++ b/templates/zerver/help/status-and-availability.md
@@ -77,10 +77,9 @@ the UI will be frozen as the time you enabled this setting.
{start_tabs}
-{settings_tab|notifications}
+{settings_tab|account-and-privacy}
-1. Under **Other notification settings**, in the **Presence**
- subsection, toggle **Display my availability to other users**.
+1. Under **Privacy**, toggle **Display my availability to other users**.
{end_tabs}