settings: Hide email address if not available in user-edit form.

This commit is contained in:
Sahil Batra
2022-03-01 13:30:14 +05:30
committed by Tim Abbott
parent bf562f8fff
commit aab82d1f16
2 changed files with 3 additions and 9 deletions

View File

@@ -542,15 +542,7 @@ export function show_edit_user_info_modal(user_id, from_user_info_popover, $stat
return; return;
} }
let user_email = settings_data.email_for_user_settings(person); const user_email = settings_data.email_for_user_settings(person);
if (!user_email) {
// When email_address_visibility is "Nobody", we still
// want to show the fake email address in the edit form.
//
// We may in the future want to just hide the form field
// for this situation, once we display user IDs.
user_email = person.email;
}
const html_body = render_admin_human_form({ const html_body = render_admin_human_form({
user_id, user_id,

View File

@@ -5,10 +5,12 @@
<label for="full_name">{{t "Full name" }}</label> <label for="full_name">{{t "Full name" }}</label>
<input type="text" autocomplete="off" name="full_name" value="{{ full_name }}" /> <input type="text" autocomplete="off" name="full_name" value="{{ full_name }}" />
</div> </div>
{{#if email}}
<div class="input-group email_change_container"> <div class="input-group email_change_container">
<label for="email">{{t "Email" }}</label> <label for="email">{{t "Email" }}</label>
<input type="text" autocomplete="off" name="email" value="{{ email }}" readonly/> <input type="text" autocomplete="off" name="email" value="{{ email }}" readonly/>
</div> </div>
{{/if}}
<div class="input-group user_id_container"> <div class="input-group user_id_container">
<label for="user_id">{{t "User ID" }}</label> <label for="user_id">{{t "User ID" }}</label>
<input type="text" autocomplete="off" name="user_id" value="{{ user_id }}" readonly/> <input type="text" autocomplete="off" name="user_id" value="{{ user_id }}" readonly/>