mirror of https://github.com/zulip/zulip.git
settings_users: Fix the sorting of owner and admin in users list.
We were not considering the owner role in `sort_role` function which was leading to improper sorting when sorting the users list according to role. This commit fixes this bug by considering role in `sort_role` function.
This commit is contained in:
parent
f86ed57255
commit
357e3c7135
|
@ -57,16 +57,19 @@ function sort_bot_email(a, b) {
|
|||
|
||||
function sort_role(a, b) {
|
||||
function role(user) {
|
||||
if (user.is_admin) {
|
||||
if (user.is_owner) {
|
||||
return 0;
|
||||
}
|
||||
if (user.is_moderator) {
|
||||
if (user.is_admin) {
|
||||
return 1;
|
||||
}
|
||||
if (user.is_guest) {
|
||||
return 3;
|
||||
if (user.is_moderator) {
|
||||
return 2;
|
||||
}
|
||||
return 2; // member
|
||||
if (user.is_guest) {
|
||||
return 4;
|
||||
}
|
||||
return 3; // member
|
||||
}
|
||||
return compare_a_b(role(a), role(b));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue