[PR #5803] [MERGED] feat(sh-admin): add search and pagination to teams list #5365

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

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/5803
Author: @Leon-Luu
Created: 1/26/2026
Status: Merged
Merged: 2/20/2026
Merged by: @jamesgeorge007

Base: nextHead: feature/search_for_workspace_in_adminpanel


📝 Commits (10+)

  • e6718ee feat: add search functionality to workspace panel in admin page
  • 62513fa Merge branch 'main' into feature/search_for_workspace_in_adminpanel
  • 3bd5e2a fix: fix no teams condition correctly
  • 9889aeb Merge branch 'feature/search_for_workspace_in_adminpanel' of github.com:Leon-Luu/hoppscotch into feature/search_for_workspace_in_adminpanel
  • 4d24384 fix: add translation for no_search_results
  • 7d30f66 Merge branch 'main' into feature/search_for_workspace_in_adminpanel
  • 4fff27d chore: co-pilot fix
  • 9253ab2 chore: add allTeamsV2 for paginated team search
  • adc52a6 Merge branch 'main' into feature/search_for_workspace_in_adminpanel
  • c714a84 feat(backend): stabilize team sort order with id tie-breaker in allTeamsV2 query

📊 Changes

9 files changed (+308 additions, -56 deletions)

View changed files

📝 packages/hoppscotch-backend/src/admin/admin.service.ts (+18 -0)
📝 packages/hoppscotch-backend/src/admin/infra.resolver.ts (+20 -0)
📝 packages/hoppscotch-backend/src/team/team.service.spec.ts (+80 -0)
📝 packages/hoppscotch-backend/src/team/team.service.ts (+28 -0)
📝 packages/hoppscotch-sh-admin/locales/en.json (+2 -0)
📝 packages/hoppscotch-sh-admin/src/components.d.ts (+4 -1)
packages/hoppscotch-sh-admin/src/helpers/backend/gql/queries/TeamList.graphql (+0 -11)
packages/hoppscotch-sh-admin/src/helpers/backend/gql/queries/TeamListV2.graphql (+11 -0)
📝 packages/hoppscotch-sh-admin/src/pages/teams/index.vue (+145 -44)

📄 Description

Add a search input field to the Workspace panel that allows administrators to filter workspaces by name or ID, similar to the existing search functionality in the Users panel.

image

Closes #
https://github.com/hoppscotch/hoppscotch/issues/5802

What's changed

Backend

  • Add fetchAllTeamsV2 to TeamService with offset pagination, case-insensitive search on name and ID, and a compound orderBy: [{ name: 'asc' }, { id: 'asc' }] for stable pagination.
  • Expose allTeamsV2(searchString, skip, take) as a new @ResolveField on InfraResolver (old allTeams marked @deprecated).

Frontend

  • Replace cursor-based "Show more" with prev/next offset pagination controls, consistent with the Users panel.
  • Switch to server-side search via allTeamsV2 with 500ms debounce.
  • Use lookahead fetch (take: teamsPerPage + 1) to accurately determine next-page availability without a total count.
  • Auto-regress to page 1 when a page loads empty (e.g. after deletion).
  • Add search_placeholder and no_search_results locale keys to en.json.
  • Remove orphaned TeamList.graphql (v1) query document.

Notes to reviewers

  • Search is server-side — allTeamsV2 is queried on every debounced keystroke with skip/take offset. There is no client-side filtering.
  • Locale keys are only added to en.json — consistent with all other teams.* keys in the project (no other locale file contains teams translations; non-English translations follow the community pipeline).
  • The allTeams v1 resolver is intentionally kept (marked deprecated) for backwards compatibility.

Summary by cubic

Added server-side search with offset pagination to the Admin Workspaces list. Debounced search by name or ID, stable A–Z sort (ID tie-breaker), next/prev with lookahead, auto-reset on empty pages, improved empty/error states, and delete-aware paging, powered by infra.allTeamsV2 (v1 deprecated).

  • Migration
    • Add teams.search_placeholder and teams.no_search_results to all locale files.

Written for commit 651c3462ee. Summary will update on new commits.


🔄 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/5803 **Author:** [@Leon-Luu](https://github.com/Leon-Luu) **Created:** 1/26/2026 **Status:** ✅ Merged **Merged:** 2/20/2026 **Merged by:** [@jamesgeorge007](https://github.com/jamesgeorge007) **Base:** `next` ← **Head:** `feature/search_for_workspace_in_adminpanel` --- ### 📝 Commits (10+) - [`e6718ee`](https://github.com/hoppscotch/hoppscotch/commit/e6718ee661deb1227ecf86458e6d6e238a80868d) feat: add search functionality to workspace panel in admin page - [`62513fa`](https://github.com/hoppscotch/hoppscotch/commit/62513fa1513d976a5dbfa41f83ea04863c101694) Merge branch 'main' into feature/search_for_workspace_in_adminpanel - [`3bd5e2a`](https://github.com/hoppscotch/hoppscotch/commit/3bd5e2a273d04e9817a8e548d245e6232b6503e2) fix: fix no teams condition correctly - [`9889aeb`](https://github.com/hoppscotch/hoppscotch/commit/9889aebe40bc2893e94edcf2c5954e768491095a) Merge branch 'feature/search_for_workspace_in_adminpanel' of github.com:Leon-Luu/hoppscotch into feature/search_for_workspace_in_adminpanel - [`4d24384`](https://github.com/hoppscotch/hoppscotch/commit/4d24384fc514367b535939e9882bbf06b7d18b6c) fix: add translation for no_search_results - [`7d30f66`](https://github.com/hoppscotch/hoppscotch/commit/7d30f66759d9da29b543c141ad68884da74b71d5) Merge branch 'main' into feature/search_for_workspace_in_adminpanel - [`4fff27d`](https://github.com/hoppscotch/hoppscotch/commit/4fff27df08c4c7eaf61541e1b6842426eb6a4aed) chore: co-pilot fix - [`9253ab2`](https://github.com/hoppscotch/hoppscotch/commit/9253ab2adc2a74611858ae4ffc6a1ea368608a98) chore: add allTeamsV2 for paginated team search - [`adc52a6`](https://github.com/hoppscotch/hoppscotch/commit/adc52a65dca16703135a2fd7963452f8848bb74f) Merge branch 'main' into feature/search_for_workspace_in_adminpanel - [`c714a84`](https://github.com/hoppscotch/hoppscotch/commit/c714a840601f62a963d6c902b4ed74c3f1132bee) feat(backend): stabilize team sort order with `id` tie-breaker in `allTeamsV2` query ### 📊 Changes **9 files changed** (+308 additions, -56 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-backend/src/admin/admin.service.ts` (+18 -0) 📝 `packages/hoppscotch-backend/src/admin/infra.resolver.ts` (+20 -0) 📝 `packages/hoppscotch-backend/src/team/team.service.spec.ts` (+80 -0) 📝 `packages/hoppscotch-backend/src/team/team.service.ts` (+28 -0) 📝 `packages/hoppscotch-sh-admin/locales/en.json` (+2 -0) 📝 `packages/hoppscotch-sh-admin/src/components.d.ts` (+4 -1) ➖ `packages/hoppscotch-sh-admin/src/helpers/backend/gql/queries/TeamList.graphql` (+0 -11) ➕ `packages/hoppscotch-sh-admin/src/helpers/backend/gql/queries/TeamListV2.graphql` (+11 -0) 📝 `packages/hoppscotch-sh-admin/src/pages/teams/index.vue` (+145 -44) </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. --> Add a search input field to the Workspace panel that allows administrators to filter workspaces by name or ID, similar to the existing search functionality in the Users panel. <img width="1075" height="462" alt="image" src="https://github.com/user-attachments/assets/0a0018f6-5d35-4ffe-8eef-43fc28b2aee1" /> <!-- If this pull request closes an issue, please mention the issue number below --> Closes # <!-- Issue # here --> https://github.com/hoppscotch/hoppscotch/issues/5802 <!-- Add an introduction into what this PR tries to solve in a couple of sentences --> ### What's changed **Backend** - Add `fetchAllTeamsV2` to `TeamService` with offset pagination, case-insensitive search on name and ID, and a compound `orderBy: [{ name: 'asc' }, { id: 'asc' }]` for stable pagination. - Expose `allTeamsV2(searchString, skip, take)` as a new `@ResolveField` on `InfraResolver` (old `allTeams` marked `@deprecated`). **Frontend** - Replace cursor-based "Show more" with prev/next offset pagination controls, consistent with the Users panel. - Switch to server-side search via `allTeamsV2` with 500ms debounce. - Use lookahead fetch (`take: teamsPerPage + 1`) to accurately determine next-page availability without a total count. - Auto-regress to page 1 when a page loads empty (e.g. after deletion). - Add `search_placeholder` and `no_search_results` locale keys to `en.json`. - Remove orphaned `TeamList.graphql` (v1) query document. ### Notes to reviewers - Search is server-side — `allTeamsV2` is queried on every debounced keystroke with `skip`/`take` offset. There is no client-side filtering. - Locale keys are only added to `en.json` — consistent with all other `teams.*` keys in the project (no other locale file contains teams translations; non-English translations follow the community pipeline). - The `allTeams` v1 resolver is intentionally kept (marked deprecated) for backwards compatibility. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Added server-side search with offset pagination to the Admin Workspaces list. Debounced search by name or ID, stable A–Z sort (ID tie-breaker), next/prev with lookahead, auto-reset on empty pages, improved empty/error states, and delete-aware paging, powered by infra.allTeamsV2 (v1 deprecated). - **Migration** - Add teams.search_placeholder and teams.no_search_results to all locale files. <sup>Written for commit 651c3462ee071f10132e5c6bd1213e6cab353d00. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:49:04 +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#5365
No description provided.