Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

[NEW] Sort by user roles

Open gsunit opened this issue 5 years ago • 8 comments

Closes issue RocketChat/feature-requests#757. Currently, under Members' List we only have a single option to filter users (bases on their online status) and no option for sorting. This PR enables a user to sort the members of a room based on their user roles.

RC sort-by-user-roles

The sorting is based on a hierarchy, which is an array of userRoles arranged in decreasing order of "importance/responsibility".

RC sort-by-user-roles-hierarchy

Thus, the admins appear first in the sorted list, then owners, moderators and so on. Simply swap two roles in the array to change the sorting order.

This is a new PR which does the same as PR RocketChat/Rocket.Chat#13976, closed the earlier one as suggested by mentors.

gsunit avatar Apr 29 '19 22:04 gsunit

@engelgabriel Please have a look at this. I was finally able to solve the conflicts and bring it back to the working state! :)

gsunit avatar Apr 29 '19 23:04 gsunit

Maybe can order by number of permissions on a role? The more permissions present the more powerful.

Also can I suggest separating out visually? Can look at discord for an example of a great visual separation

something like:

[Admin]

  • user 1
  • user 2

[Moderator]

  • user 3
  • user 4

And only put them under the role with the highest permissions as that would be most relevant i'm guessing.

geekgonecrazy avatar May 17 '19 18:05 geekgonecrazy

@geekgonecrazy Ordering by no. of permissions seems like a better option. I will do it as soon as possible. But once the user are sorted, how can we separate them out visually (according to type of role, as you have suggested)? For sorting and separating users based on type of role (admin, moderator, etc.), shouldn't a separate filter option be used?

gsunit avatar May 18 '19 13:05 gsunit

@gsunit

But once the user are sorted, how can we separate them out visually (according to type of role, as you have suggested)?

Discord, as suggested, order according to what is predefined by the channel administrator, like this: https://www.howtogeek.com/wp-content/uploads/2018/08/img_5b85c851b0fd8.png According to this image the algorithm will organize the list of members by 'Cool Color', then 'Admin' and then '@everyone' (@everyone being the default role, that is, the role of those who do not have any other role in the channel).

I see this would be ideal for RocketChat as well, a screen for organizing role weights through a simple drag-n-drop (simple & nice user interface and experience). Another alternative, and simpler, would simply be to add a "Weight" field in the 'roles' table, allowing the creation of the role to simply define a weight (an Integer, why not?). And then it would sort the list of channel members according to that weight (and inside the role grouping, user ordered alphabetically) in the format suggested by @geekgonecrazy: [Admin] user A user B

[Moderator] user C user D

This display format could even be the default view of the member list, why not? (ie it would not be necessary to enable the filter to show the roles). Or have an editable field on the channel that would allow the channel administrator to switch between member list view with role-grouping or simple alphabetical order.

For sorting and separating users based on type of role (admin, moderator, etc.), shouldn't a separate filter option be used?

I believe a filter to search by role would be an extremely important extra for the user experience after something like the one suggested above was developed, especially for channels that have MANY users.


Finally I would like to say that this issue (https://github.com/RocketChat/feature-requests/issues/757) seems underestimated... I see it with the potential to solve one of the biggest problems for adoption in companies that are not from the software development branch and are accustomed to more traditional chat clients that have a simple list of users grouped by department (such as accounting department, board, etc.).

The biggest reason for this preference for grouping is to make it easier to see who is responsible for each department and (especially) to facilitate the adoption of RocketChat in companies that have lots of private one-to-one conversations. At the company I work with today we do not adopt RocketChat simply because that one-to-one chat part is not that intuitive.

I've even seen several Issues here in Github asking for a list of users to facilitate one-to-one conversations, and I see that a solution like the one I suggested would solve all of these problems, for example: a default channel would be created with all users and the list of members would be sorted by 'role' (in my case the 'role' would be the department to which the user belongs), which greatly enhances the user experience for people who focus more on one-to-one chat. Another benefit of this approach is that RocketChat would not distance itself from its current channel proposal at all, it would only improve another aspect (one-to-one conversations).

kevinfaveri avatar Jun 16 '19 16:06 kevinfaveri

Thanks for your contrib @gsunit , I belive there are still some checks to pass, do you think it would be possible to move forward on this ?

fcoppolani avatar Jan 03 '20 10:01 fcoppolani

@tassoevan Can I redo this pull request? I will:

  • keep all the important changes in this pr in mind
  • add necessary fixes where required
  • resolve the conflict as soon as possible Thank you

aditya-mitra avatar Jan 31 '21 15:01 aditya-mitra

@tassoevan @debdutdeb @aditya-mitra hey, guys! Is there any plans to continue to work on that PR or make new one with same purpose? It's now big deal, it's already invented. Only cosmetic changes are needed. But it's a really mandatory feature for users.

ankar84 avatar Mar 02 '22 05:03 ankar84

Related feature requests https://github.com/RocketChat/feature-requests/issues/757 https://github.com/RocketChat/feature-requests/issues/508

ankar84 avatar Mar 02 '22 05:03 ankar84