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_users: Do not allow sorting by email if emails are hidden.

Sahil Batracb15e0265d44
diff --git a/static/js/admin.js b/static/js/admin.js
index 8045918f3f9..a507a65e326 100644
--- a/static/js/admin.js
+++ b/static/js/admin.js
@@ -160,6 +160,7 @@ export function build_page() {
create_web_public_stream_policy_values:
settings_config.create_web_public_stream_policy_values,
disable_enable_spectator_access_setting: !page_params.server_web_public_streams_enabled,
+ can_sort_by_email: settings_data.show_email(),
};
if (options.realm_logo_source !== "D" && options.realm_night_logo_source === "D") {
diff --git a/static/templates/settings/deactivated_users_admin.hbs b/static/templates/settings/deactivated_users_admin.hbs
index ca77f926c3f..a8b6e117154 100644
--- a/static/templates/settings/deactivated_users_admin.hbs
+++ b/static/templates/settings/deactivated_users_admin.hbs
@@ -13,7 +13,7 @@
<table class="table table-condensed table-striped wrapped-table">
<thead class="table-sticky-headers">
<th class="active" data-sort="alphabetic" data-sort-prop="full_name">{{t "Name" }}</th>
- <th data-sort="email">{{t "Email" }}</th>
+ <th {{#if can_sort_by_email}}data-sort="email"{{/if}}>{{t "Email" }}</th>
<th class="user_id" data-sort="id">{{t "User ID" }}</th>
<th class="user_role" data-sort="role">{{t "Role" }}</th>
{{#if is_admin}}
diff --git a/static/templates/settings/user_list_admin.hbs b/static/templates/settings/user_list_admin.hbs
index 3375fe632f3..cf9799bc50e 100644
--- a/static/templates/settings/user_list_admin.hbs
+++ b/static/templates/settings/user_list_admin.hbs
@@ -12,7 +12,7 @@
<table class="table table-condensed table-striped wrapped-table">
<thead class="table-sticky-headers">
<th class="active" data-sort="alphabetic" data-sort-prop="full_name">{{t "Name" }}</th>
- <th data-sort="email">{{t "Email" }}</th>
+ <th {{#if can_sort_by_email}}data-sort="email"{{/if}}>{{t "Email" }}</th>
<th class="user_id" data-sort="id">{{t "User ID" }}</th>
<th class="user_role" data-sort="role">{{t "Role" }}</th>
<th class="last_active" data-sort="last_active">{{t "Last active" }}</th>