Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] feat: add endpoints groups.membersOrderedByRole channels.membersOrderedByRole #34153

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

abhinavkrin
Copy link
Member

@abhinavkrin abhinavkrin commented Dec 10, 2024

Proposed changes (including videos or screenshots)

Adds groups.membersOrderedByRole and channels.membersOrderedByRole endpoints to retrieve members of groups and channels sorted according to their respective role in the room.
This will help in grouping of users according to their roles in the room like below.
image

The endpoint works similar as groups.members and channels.members, but accepts an optional rolesOrder[] param which can be used for defining roles order while sorting. The index of the role will signify its priority. By default, owner > moderator > rest of members.

A sample request

curl --location --globoff 'http://localhost:3000/api/v1/channels.membersOrderedByRole?roomId=GENERAL&sort={%22username%22%3A%201}&offset=0&rolesOrder[]=leader&rolesOrder[]=owner' \
--header 'X-Auth-Token: Ce_2eOJ19mnW59wVO5IfSv4s650MF1w7mqY6i52uPG5' \
--header 'X-User-Id: u29m4aQNjZujdE4r5' \
--data ''

Issue(s)

Steps to test or reproduce

Further comments

CORE-846

Copy link
Contributor

dionisio-bot bot commented Dec 10, 2024

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

Copy link

changeset-bot bot commented Dec 10, 2024

🦋 Changeset detected

Latest commit: 7c92475

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 35 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/rest-typings Patch
@rocket.chat/api-client Patch
@rocket.chat/core-services Patch
@rocket.chat/ddp-client Patch
@rocket.chat/ui-contexts Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/network-broker Patch
@rocket.chat/livechat Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/fuselage-ui-kit Patch
@rocket.chat/gazzodown Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/ui-voip Patch
@rocket.chat/web-ui-registration Patch
@rocket.chat/core-typings Patch
@rocket.chat/apps Patch
@rocket.chat/cron Patch
@rocket.chat/freeswitch Patch
@rocket.chat/model-typings Patch
@rocket.chat/license Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/models Patch
@rocket.chat/instance-status Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@abhinavkrin abhinavkrin added this to the 7.2.0 milestone Dec 10, 2024
@abhinavkrin abhinavkrin force-pushed the feat/add-endpoints-groups.membersOrderedByRole-channels.membersOrderedByRole branch from 4a3be37 to aa02c7a Compare December 10, 2024 12:55
Copy link
Contributor

github-actions bot commented Dec 10, 2024

PR Preview Action v1.4.8
🚀 Deployed preview to https://RocketChat.github.io/Rocket.Chat/pr-preview/pr-34153/
on branch gh-pages at 2024-12-13 18:05 UTC

Copy link

codecov bot commented Dec 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.79%. Comparing base (75643e1) to head (df876a0).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #34153   +/-   ##
========================================
  Coverage    75.79%   75.79%           
========================================
  Files          511      511           
  Lines        22132    22132           
  Branches      5394     5394           
========================================
  Hits         16775    16775           
  Misses        4709     4709           
  Partials       648      648           
Flag Coverage Δ
unit 75.79% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Signed-off-by: Abhinav Kumar <[email protected]>
Signed-off-by: Abhinav Kumar <[email protected]>
@abhinavkrin abhinavkrin force-pushed the feat/add-endpoints-groups.membersOrderedByRole-channels.membersOrderedByRole branch from 7c92475 to df876a0 Compare December 13, 2024 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant