From 3b349304fbdcc4cfb8772ebd342f665b635f41c5 Mon Sep 17 00:00:00 2001 From: Zachary Wasserman Date: Tue, 23 Apr 2019 15:58:32 -0700 Subject: [PATCH] Disable editing of logged in user email in admin panel (#2031) Doing so has long resulted in an error when submitting the form. This disables the input field when editing the logged in users details in the admin panel. The logged in user can still change their own email using the "Account Settings" page accessed in the top left of the sidebar. --- frontend/components/UserBlock/UserBlock.jsx | 3 ++- frontend/components/forms/admin/EditUserForm/EditUserForm.jsx | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/components/UserBlock/UserBlock.jsx b/frontend/components/UserBlock/UserBlock.jsx index 6d904e6f45..05eeef9771 100644 --- a/frontend/components/UserBlock/UserBlock.jsx +++ b/frontend/components/UserBlock/UserBlock.jsx @@ -65,7 +65,7 @@ class UserBlock extends Component { } render () { - const { isEditing, isInvite, user, userErrors } = this.props; + const { isEditing, isInvite, user, userErrors, isCurrentUser } = this.props; const { admin, email, @@ -131,6 +131,7 @@ class UserBlock extends Component { return (
@@ -52,6 +53,7 @@ class EditUserForm extends Component { {...fields.email} inputWrapperClass={`${baseClass}__input-wrap`} label="Email" + disabled={isCurrentUser} labelClassName={`${baseClass}__label`} inputClassName={`${baseClass}__input ${baseClass}__input--email`} />