From ca79648dd7363994eee581f2250124ec00d58269 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Wed, 29 Jan 2020 01:07:09 +0000 Subject: [PATCH] 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 ecc42bc9f80373f82c1853d0a3902f0a713e935c 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. --- static/js/settings_users.js | 6 ------ static/templates/admin_user_list.hbs | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/static/js/settings_users.js b/static/js/settings_users.js index f7ec099478..75809d2126 100644 --- a/static/js/settings_users.js +++ b/static/js/settings_users.js @@ -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…")); diff --git a/static/templates/admin_user_list.hbs b/static/templates/admin_user_list.hbs index ce97f07e69..c726c32f8b 100644 --- a/static/templates/admin_user_list.hbs +++ b/static/templates/admin_user_list.hbs @@ -1,5 +1,5 @@ {{#with user}} - + {{full_name}}