Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
org_settings: Add "Role" column in bot-list table.
somesh202b1cafb12801d
diff --git a/frontend_tests/node_tests/people.js b/frontend_tests/node_tests/people.jsindex d5960706659..ff24117586e 100644--- a/frontend_tests/node_tests/people.js+++ b/frontend_tests/node_tests/people.js@@ -127,6 +127,7 @@ const bot_botson = {full_name: "Bot Botson",is_bot: true,bot_owner_id: isaac.user_id,+ role: 300,};const moderator = {@@ -525,7 +526,7 @@ test_people("user_type", () => {assert.equal(people.get_user_type(guest.user_id), $t({defaultMessage: "Guest"}));assert.equal(people.get_user_type(realm_owner.user_id), $t({defaultMessage: "Owner"}));assert.equal(people.get_user_type(moderator.user_id), $t({defaultMessage: "Moderator"}));- assert.equal(people.get_user_type(bot_botson.user_id), $t({defaultMessage: "Bot"}));+ assert.equal(people.get_user_type(bot_botson.user_id), $t({defaultMessage: "Moderator"}));});test_people("updates", () => {diff --git a/static/js/people.js b/static/js/people.jsindex d0a309f7bb7..070e0f96378 100644--- a/static/js/people.js+++ b/static/js/people.js@@ -274,9 +274,6 @@ export function get_user_time(user_id) {export function get_user_type(user_id) {const user_profile = get_by_user_id(user_id);- if (user_profile.is_bot) {- return $t({defaultMessage: "Bot"});- }return settings_config.user_role_map.get(user_profile.role);}diff --git a/static/js/settings_users.js b/static/js/settings_users.jsindex d8d7222bab1..57089ca56f4 100644--- a/static/js/settings_users.js+++ b/static/js/settings_users.js@@ -190,10 +190,12 @@ function bot_info(bot_user_id) {const info = {};info.is_bot = true;+ info.role = people.get_by_user_id(bot_user_id).role;info.is_active = bot_user.is_active;info.user_id = bot_user.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);// Convert bot type id to string for viewing to the users.info.bot_type = settings_bots.type_id_to_string(bot_user.bot_type);@@ -279,7 +281,7 @@ section.bots.create_table = () => {sort_fields: {email: sort_bot_email,bot_owner: sort_bot_owner,- id: sort_user_id,+ role: sort_role,},$simplebar_container: $("#admin-bot-list .progressive-table-wrapper"),});diff --git a/static/templates/settings/admin_user_list.hbs b/static/templates/settings/admin_user_list.hbsindex acf07947e7e..71c4ea45663 100644--- a/static/templates/settings/admin_user_list.hbs+++ b/static/templates/settings/admin_user_list.hbs@@ -12,14 +12,14 @@<span class="hidden-email">{{t "(hidden)"}}</span></td>{{/if}}+ {{#unless is_bot}}<td><span class="user_id">{{user_id}}</span></td>- {{#unless is_bot}}+ {{/unless}}<td><span class="user_role">{{user_role_text}}</span></td>- {{/unless}}{{#if is_bot}}<td><span class="owner">diff --git a/static/templates/settings/bot_list_admin.hbs b/static/templates/settings/bot_list_admin.hbsindex c831c387f81..33dea6adb99 100644--- a/static/templates/settings/bot_list_admin.hbs+++ b/static/templates/settings/bot_list_admin.hbs@@ -13,7 +13,7 @@<thead class="table-sticky-headers"><th class="active" data-sort="alphabetic" data-sort-prop="full_name">{{t "Name" }}</th><th data-sort="email">{{t "Email" }}</th>- <th data-sort="id">{{t "User ID"}}</th>+ <th class="user_role" data-sort="role">{{t "Role" }}</th><th data-sort="bot_owner">{{t "Owner" }}</th><th data-sort="alphabetic" data-sort-prop="bot_type">{{t "Bot type" }}</th>{{#if is_admin}}