bug fix: Allow admins to filter users in settings.

It appears c28c3015 caused a regression where we
set `email` to undefined if a user does not have
`delivery_email` set, and this causes filtering
of users to fail for admins doing user settings.

This fixes only one of the issues reported in
issue #13554.

There's probably no easy fix to scrolling taking
long, but I think fixing search will mostly
address that complaint.

The Rust folks seem to agree with me that the
search results are too noisy.  If I search for
"s" I get:

    * names like Steve (good)
    * names like Jesse (noisy)
    * anybody with s in their email (super noisy)

Here is the relevant code:

    return (
        item.full_name.toLowerCase().indexOf(value) >= 0 ||
        email.toLowerCase().indexOf(value) >= 0
    );
This commit is contained in:
Steve Howell
2019-12-28 15:12:59 +00:00
committed by Tim Abbott
parent 1df7a7280a
commit 5e0fc25f74

View File

@@ -222,7 +222,7 @@ function populate_users(realm_people_data) {
element: $users_table.closest(".settings-section").find(".search"),
callback: function (item, value) {
let email = item.email;
if (page_params.is_admin) {
if (page_params.is_admin && item.delivery_email) {
email = item.delivery_email;
}
@@ -266,7 +266,7 @@ function populate_users(realm_people_data) {
element: $deactivated_users_table.closest(".settings-section").find(".search"),
callback: function (item, value) {
let email = item.email;
if (page_params.is_admin) {
if (page_params.is_admin && item.delivery_email) {
email = item.delivery_email;
}