mirror of https://github.com/zulip/zulip.git
settings_users: Directly use role value in sort_role.
There is no need to write a custom function for sorting the users table by role since role values are according to hierarchy of roles already.
This commit is contained in:
parent
10e9789179
commit
c09e3fd845
|
@ -56,22 +56,7 @@ function sort_bot_email(a, b) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function sort_role(a, b) {
|
function sort_role(a, b) {
|
||||||
function role(user) {
|
return compare_a_b(a.role, b.role);
|
||||||
if (user.is_owner) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (user.is_admin) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
if (user.is_moderator) {
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
if (user.is_guest) {
|
|
||||||
return 4;
|
|
||||||
}
|
|
||||||
return 3; // member
|
|
||||||
}
|
|
||||||
return compare_a_b(role(a), role(b));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function sort_bot_owner(a, b) {
|
function sort_bot_owner(a, b) {
|
||||||
|
|
Loading…
Reference in New Issue