[PR #3786] [MERGED] HSB-358 feat: admin user management (backend) #4530

Closed
opened 2026-03-17 02:03:24 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/3786
Author: @mirarifhasan
Created: 1/30/2024
Status: Merged
Merged: 2/21/2024
Merged by: @AndrewBastin

Base: release/2024.3.0Head: feat/admin-user-management-backend


📝 Commits (10+)

  • 5368c52 feat: user invitation revoke mutation added
  • 1df2520 test: revokeUserInvite test case added
  • 3ff6cc5 feat: fetchInvitedUsers logic updated
  • 88bca20 feat: added pagination on fetchInvitedUsers
  • abaddd9 feat: fetchAllUsersV2 added with search-sort-offset pagination
  • 9ceef43 feat: change fetchAllUsersV2 to fetchAllUsers
  • a4c889e feat: update user display name mutation added
  • 2a667a7 feat: removed deprecated resolvefields
  • da606f5 feat: bulk user to admin mutation added
  • 2bde3f8 feat: removeUsersAsAdmin mutation added

📊 Changes

10 files changed (+4762 additions, -10063 deletions)

View changed files

📝 packages/hoppscotch-backend/src/admin/admin.resolver.ts (+103 -203)
📝 packages/hoppscotch-backend/src/admin/admin.service.spec.ts (+127 -3)
📝 packages/hoppscotch-backend/src/admin/admin.service.ts (+176 -3)
📝 packages/hoppscotch-backend/src/admin/infra.resolver.ts (+32 -4)
📝 packages/hoppscotch-backend/src/errors.ts (+15 -0)
📝 packages/hoppscotch-backend/src/types/input-types.args.ts (+18 -0)
📝 packages/hoppscotch-backend/src/user/user.model.ts (+19 -0)
📝 packages/hoppscotch-backend/src/user/user.service.spec.ts (+112 -1)
📝 packages/hoppscotch-backend/src/user/user.service.ts (+113 -1)
📝 pnpm-lock.yaml (+4047 -9848)

📄 Description

Closes HSB-358

Description

This PR introduces the following features (for Admin Dashboard) in the hoppscotch-backend package:

  1. Admin can update user's displayName
  2. Show only the pending users list (in the invited user tab)
  3. Pending user invite revocation
  4. The user's list will be sorted by displayName ('asc') and the Admin users will be at the top
  5. User search by their name & email
  6. Bulk: user to admin
  7. Bulk: Admin to user
  8. Bulk: User delete

Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

How to Test

The following mutation/queries are created/updated. Testing these operations will be good.

New Mutations::

  1. updateUserDisplayNameByAdmin
  2. revokeUserInvitationsByAdmin
  3. removeUsersByAdmin
  4. removeUsersAsAdmin
  5. makeUsersAdmin

Updated Queries::

  1. infra.allUsersV2 -> Input parameter changed. Response format unchanged
  2. infra.invitedUsers -> Input parameter changed. Response format unchanged

Additional Information

Nil


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/3786 **Author:** [@mirarifhasan](https://github.com/mirarifhasan) **Created:** 1/30/2024 **Status:** ✅ Merged **Merged:** 2/21/2024 **Merged by:** [@AndrewBastin](https://github.com/AndrewBastin) **Base:** `release/2024.3.0` ← **Head:** `feat/admin-user-management-backend` --- ### 📝 Commits (10+) - [`5368c52`](https://github.com/hoppscotch/hoppscotch/commit/5368c52aab9ca72b21175815b9edf7c0ae87fe43) feat: user invitation revoke mutation added - [`1df2520`](https://github.com/hoppscotch/hoppscotch/commit/1df2520bf0956a9eef00a54c50f3a21945debc4b) test: revokeUserInvite test case added - [`3ff6cc5`](https://github.com/hoppscotch/hoppscotch/commit/3ff6cc53bbf5030914f066eebb53d34fa5b7e8b1) feat: fetchInvitedUsers logic updated - [`88bca20`](https://github.com/hoppscotch/hoppscotch/commit/88bca2057abe1fffa6d777b6c4f24b0ff4ff21a6) feat: added pagination on fetchInvitedUsers - [`abaddd9`](https://github.com/hoppscotch/hoppscotch/commit/abaddd94a51236dc3615763e57a92a489fb66025) feat: fetchAllUsersV2 added with search-sort-offset pagination - [`9ceef43`](https://github.com/hoppscotch/hoppscotch/commit/9ceef43c7425e44fcdfc591d459b22e79c7ff0df) feat: change fetchAllUsersV2 to fetchAllUsers - [`a4c889e`](https://github.com/hoppscotch/hoppscotch/commit/a4c889e38d0ce236f99175e5fa487fc6d0878056) feat: update user display name mutation added - [`2a667a7`](https://github.com/hoppscotch/hoppscotch/commit/2a667a74f0b36a75ba6b8cce78798ac4d9ae9581) feat: removed deprecated resolvefields - [`da606f5`](https://github.com/hoppscotch/hoppscotch/commit/da606f5a9620104c3583777c472201fe68503d2d) feat: bulk user to admin mutation added - [`2bde3f8`](https://github.com/hoppscotch/hoppscotch/commit/2bde3f8b02320c0b1d4238329ea520c89c6a293b) feat: removeUsersAsAdmin mutation added ### 📊 Changes **10 files changed** (+4762 additions, -10063 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-backend/src/admin/admin.resolver.ts` (+103 -203) 📝 `packages/hoppscotch-backend/src/admin/admin.service.spec.ts` (+127 -3) 📝 `packages/hoppscotch-backend/src/admin/admin.service.ts` (+176 -3) 📝 `packages/hoppscotch-backend/src/admin/infra.resolver.ts` (+32 -4) 📝 `packages/hoppscotch-backend/src/errors.ts` (+15 -0) 📝 `packages/hoppscotch-backend/src/types/input-types.args.ts` (+18 -0) 📝 `packages/hoppscotch-backend/src/user/user.model.ts` (+19 -0) 📝 `packages/hoppscotch-backend/src/user/user.service.spec.ts` (+112 -1) 📝 `packages/hoppscotch-backend/src/user/user.service.ts` (+113 -1) 📝 `pnpm-lock.yaml` (+4047 -9848) </details> ### 📄 Description <!-- Thanks for creating this pull request 🤗 Please make sure that the pull request is limited to one type (docs, feature, etc.) and keep it as small as possible. You can open multiple prs instead of opening a huge one. --> <!-- If this pull request closes an issue, please mention the issue number below --> <!-- Issue # here --> Closes HSB-358 ### Description <!-- Add a brief description of the pull request --> This PR introduces the following features (for Admin Dashboard) in the `hoppscotch-backend` package: 1. Admin can update user's displayName 2. Show only the pending users list (in the invited user tab) 3. Pending user invite revocation 4. The user's list will be sorted by displayName ('asc') and the Admin users will be at the top 5. User search by their name & email 6. Bulk: user to admin 7. Bulk: Admin to user 8. Bulk: User delete <!-- You can also choose to add a list of changes and if they have been completed or not by using the markdown to-do list syntax - [ ] Not Completed - [x] Completed --> ### Checks <!-- Make sure your pull request passes the CI checks and do check the following fields as needed - --> - [x] My pull request adheres to the code style of this project - [ ] My code requires changes to the documentation - [ ] I have updated the documentation as required - [ ] All the tests have passed ### How to Test The following mutation/queries are created/updated. Testing these operations will be good. New Mutations:: 1. updateUserDisplayNameByAdmin 2. revokeUserInvitationsByAdmin 3. removeUsersByAdmin 4. removeUsersAsAdmin 5. makeUsersAdmin Updated Queries:: 1. infra.allUsersV2 -> Input parameter changed. Response format unchanged 2. infra.invitedUsers -> Input parameter changed. Response format unchanged ### Additional Information <!-- Any additional information like breaking changes, dependencies added, screenshots, comparisons between new and old behaviour, etc. --> Nil --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:03:24 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#4530
No description provided.