Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

organization_settings: Convert name to pills.

sujal shahb5e215824b12
diff --git a/web/src/settings_users.js b/web/src/settings_users.js
index aaf5a3110f9..27d9f1439dd 100644
--- a/web/src/settings_users.js
+++ b/web/src/settings_users.js
@@ -229,6 +229,7 @@ function bot_info(bot_user_id) {
info.full_name = bot_user.full_name;
info.bot_owner_id = owner_id;
info.user_role_text = people.get_user_type(bot_user_id);
+ info.img_src = people.small_avatar_url_for_person(bot_user);
// Convert bot type id to string for viewing to the users.
info.bot_type = settings_data.bot_type_id_to_string(bot_user.bot_type);
@@ -248,6 +249,11 @@ function bot_info(bot_user_id) {
// It's always safe to show the real email addresses for bot users
info.display_email = bot_user.email;
+ if (owner_id) {
+ info.is_bot_owner_active = people.is_person_active(owner_id);
+ info.owner_img_src = people.small_avatar_url_for_person(people.get_by_user_id(owner_id));
+ }
+
return info;
}
@@ -274,6 +280,7 @@ function human_info(person) {
info.is_current_user = people.is_my_user_id(person.user_id);
info.cannot_deactivate = info.is_current_user || (person.is_owner && !current_user.is_owner);
info.display_email = person.delivery_email;
+ info.img_src = people.small_avatar_url_for_person(person);
// TODO: This is not shown in deactivated users table and it is
// controlled by `display_last_active_column` We might just want
@@ -414,7 +421,7 @@ export function update_user_data(user_id, new_data) {
if (new_data.full_name !== undefined) {
// Update the full name in the table
- $user_row.find(".user_name .view_user_profile").text(new_data.full_name);
+ $user_row.find(".pill-container .view_user_profile .pill-value").text(new_data.full_name);
}
if (new_data.role !== undefined) {
diff --git a/web/styles/right_sidebar.css b/web/styles/right_sidebar.css
index b39f824fc46..e028c6214a8 100644
--- a/web/styles/right_sidebar.css
+++ b/web/styles/right_sidebar.css
@@ -206,6 +206,7 @@ $user_status_emoji_width: 24px;
.my_user_status {
opacity: 0.5;
+ white-space: nowrap;
}
.selectable_sidebar_block {
diff --git a/web/templates/settings/admin_user_list.hbs b/web/templates/settings/admin_user_list.hbs
index 6f2c2f5cdb0..d50fbf03749 100644
--- a/web/templates/settings/admin_user_list.hbs
+++ b/web/templates/settings/admin_user_list.hbs
@@ -1,13 +1,6 @@
<tr class="user_row{{#if is_active}} active-user{{else}} deactivated_user{{/if}}" data-user-id="{{user_id}}">
- <td class="user_name">
- <span class="user_name" >
- <a data-user-id="{{user_id}}" class="view_user_profile" tabindex="0">{{full_name}}</a>
- {{#if is_current_user}}<span class="my_user_status">{{t '(you)' }}</span>{{/if}}</span>
- {{#if is_bot}}
- <i class="fa fa-ban deactivated-user-icon tippy-zulip-delayed-tooltip" data-tippy-content="{{t 'Bot is deactivated' }}" {{#if is_active}}style="display: none;"{{/if}}></i>
- {{else}}
- <i class="fa fa-ban deactivated-user-icon tippy-zulip-delayed-tooltip" data-tippy-content="{{t 'User is deactivated' }}" {{#if is_active}}style="display: none;"{{/if}}></i>
- {{/if}}
+ <td class="user_name panel_user_list">
+ {{> ../user_display_only_pill display_value=full_name user_id=user_id img_src=img_src}}
</td>
{{#if display_email}}
<td class="email">
@@ -23,11 +16,11 @@
</td>
{{#if is_bot}}
<td>
- <span class="owner">
+ <span class="owner panel_user_list">
{{#if no_owner }}
{{bot_owner_full_name}}
{{else}}
- <a data-user-id="{{bot_owner_id}}" class="view_user_profile" tabindex="0">{{bot_owner_full_name}}</a>
+ {{> ../user_display_only_pill display_value=bot_owner_full_name user_id=bot_owner_id img_src=owner_img_src is_active=is_bot_owner_active}}
{{/if}}
</span>
</td>