admin user: Remove obsolete data-email markup.

We mostly needed this for Casper tests, and that
usage was eliminated in the prior commit.

There was also some strange defensive code from
ecc42bc9f8 that
is really ancient and which I am eliminating:

    const email = row.attr("data-email");

    if ($("#deactivation_user_modal .email").html() !== email) {
        blueslip.error("User deactivation canceled due to non-matching fields.");
        ui_report.message(i18n.t("Deactivation encountered an error. Please reload and try again."),
                          $("#home-error"), 'alert-error');
    }

If the code was there to protect against live
updates for email changes, then we no longer
have to worry about that, since we use user_ids
now as keys.

Or it might have to do with some ancient bug
where you could pop open two modals at once
or something.  You can actually change users while
the modal is open (which is kinda strange, but ok),
and it works fine.

When testing this, I ran into the glitch that we
don't open redraw the Deactivated Users panel after
going into the User panel and deactivating a user.
This commit is contained in:
Steve Howell 2020-01-29 01:07:09 +00:00 committed by Tim Abbott
parent dac0f04328
commit ca79648dd7
2 changed files with 1 additions and 7 deletions

View File

@ -341,13 +341,7 @@ exports.on_load_success = function (realm_people_data) {
modal_elem.find('.do_deactivate_button').click(function () {
const user_id = modal_elem.data('user-id');
const row = get_user_info_row(user_id);
const email = row.attr("data-email");
if ($("#deactivation_user_modal .email").html() !== email) {
blueslip.error("User deactivation canceled due to non-matching fields.");
ui_report.message(i18n.t("Deactivation encountered an error. Please reload and try again."),
$("#home-error"), 'alert-error');
}
modal_elem.modal("hide");
const row_deactivate_button = row.find("button.deactivate");
row_deactivate_button.prop("disabled", true).text(i18n.t("Working…"));

View File

@ -1,5 +1,5 @@
{{#with user}}
<tr class="user_row{{#unless is_active}} deactivated_user{{/unless}}" data-user-id="{{user_id}}" data-email="{{email}}">
<tr class="user_row{{#unless is_active}} deactivated_user{{/unless}}" data-user-id="{{user_id}}">
<td>
<span class="user_name">{{full_name}}</span>
<i class="fa fa-ban deactivated-user-icon" title="{{t 'User is deactivated' }}" {{#if is_active}}style="display: none;"{{/if}}></i>