[PR #4044] [MERGED] refactor(sh-admin): improved error handling and dynamic user actions in admin dashboard #4644

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

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/4044
Author: @joeljstephen
Created: 5/7/2024
Status: Merged
Merged: 6/3/2024
Merged by: @nivedin

Base: patchHead: refactor/dashboard-improvements


📝 Commits (10+)

  • 54a4f4b feat: new helper functions for better error management
  • 5009e02 refactor: new i18n strings
  • 296d436 refactor: better error handling in invite modal and members component
  • 87aa129 refactor: better user management
  • c17be80 refactor: better error handling in config handler
  • 0c8effd refactor: updated logic of dynamic action row
  • 813e487 refactor: better naming for computed properties
  • 8698bb7 feat: new error message when an admin tries to invite himself
  • 909eb38 refactor: updated error message when user is already invited
  • b0f1692 refactor: reverted i18n string for user already invited back to the old string

📊 Changes

8 files changed (+154 additions, -73 deletions)

View changed files

📝 packages/hoppscotch-sh-admin/locales/en.json (+3 -1)
📝 packages/hoppscotch-sh-admin/src/components.d.ts (+42 -41)
📝 packages/hoppscotch-sh-admin/src/components/teams/Members.vue (+8 -1)
📝 packages/hoppscotch-sh-admin/src/components/users/InviteModal.vue (+0 -10)
📝 packages/hoppscotch-sh-admin/src/composables/useConfigHandler.ts (+7 -1)
📝 packages/hoppscotch-sh-admin/src/helpers/errors.ts (+55 -1)
📝 packages/hoppscotch-sh-admin/src/helpers/userManagement.ts (+10 -8)
📝 packages/hoppscotch-sh-admin/src/pages/users/index.vue (+29 -10)

📄 Description

Ticket

Closes HFE-514

Description

This PR focuses on improving error handling and user actions in the admin dashboard. Recurring errors returned from the backend are stored, and are paired with appropriate error messages to improve error handling in the dashboard. The action bar in the users page is made to be more dynamic where buttons appear only when the action is relevant based on the selection made by the user

Example: Make Admin button is not shown when selected users are all admins

Objectives

  • A better system to handle errors by recording the different types of errors returned from the backend.
  • Assign appropriate error messages to the errors recorded.
  • Implement a dynamic action bar in the users page which dynamically reveals and hides action buttons based on relevancy.

Recording

https://github.com/hoppscotch/hoppscotch/assets/70131076/b83e7471-7e68-48ae-a5b8-5d9a137e3681

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

🔄 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/4044 **Author:** [@joeljstephen](https://github.com/joeljstephen) **Created:** 5/7/2024 **Status:** ✅ Merged **Merged:** 6/3/2024 **Merged by:** [@nivedin](https://github.com/nivedin) **Base:** `patch` ← **Head:** `refactor/dashboard-improvements` --- ### 📝 Commits (10+) - [`54a4f4b`](https://github.com/hoppscotch/hoppscotch/commit/54a4f4b941f47e416301e40673a1f67cb9983d89) feat: new helper functions for better error management - [`5009e02`](https://github.com/hoppscotch/hoppscotch/commit/5009e02846d379bbbb478984b0fd473fc4b276cd) refactor: new i18n strings - [`296d436`](https://github.com/hoppscotch/hoppscotch/commit/296d436bec291d360e1f378ed38fb351d2dcb088) refactor: better error handling in invite modal and members component - [`87aa129`](https://github.com/hoppscotch/hoppscotch/commit/87aa12927ecc539b538d0beb6d2c227a1d42bc16) refactor: better user management - [`c17be80`](https://github.com/hoppscotch/hoppscotch/commit/c17be80e10ddf023bee352e24399a46ad4a13888) refactor: better error handling in config handler - [`0c8effd`](https://github.com/hoppscotch/hoppscotch/commit/0c8effd18c21c922a3ea9b9b6cb8a2cc71773da8) refactor: updated logic of dynamic action row - [`813e487`](https://github.com/hoppscotch/hoppscotch/commit/813e487ccf77ecd7966e86b298ebf11000a45f5f) refactor: better naming for computed properties - [`8698bb7`](https://github.com/hoppscotch/hoppscotch/commit/8698bb7c19698b737ef357ecc28bf54c67907ce9) feat: new error message when an admin tries to invite himself - [`909eb38`](https://github.com/hoppscotch/hoppscotch/commit/909eb388cd8164516cdfb58ce362a840562eff73) refactor: updated error message when user is already invited - [`b0f1692`](https://github.com/hoppscotch/hoppscotch/commit/b0f169235d39c61e3c51aa21c89e298f2d3074f7) refactor: reverted i18n string for user already invited back to the old string ### 📊 Changes **8 files changed** (+154 additions, -73 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-sh-admin/locales/en.json` (+3 -1) 📝 `packages/hoppscotch-sh-admin/src/components.d.ts` (+42 -41) 📝 `packages/hoppscotch-sh-admin/src/components/teams/Members.vue` (+8 -1) 📝 `packages/hoppscotch-sh-admin/src/components/users/InviteModal.vue` (+0 -10) 📝 `packages/hoppscotch-sh-admin/src/composables/useConfigHandler.ts` (+7 -1) 📝 `packages/hoppscotch-sh-admin/src/helpers/errors.ts` (+55 -1) 📝 `packages/hoppscotch-sh-admin/src/helpers/userManagement.ts` (+10 -8) 📝 `packages/hoppscotch-sh-admin/src/pages/users/index.vue` (+29 -10) </details> ### 📄 Description ### Ticket Closes HFE-514 ### Description This PR focuses on improving error handling and user actions in the admin dashboard. Recurring errors returned from the backend are stored, and are paired with appropriate error messages to improve error handling in the dashboard. The action bar in the users page is made to be more dynamic where buttons appear only when the action is relevant based on the selection made by the user **Example:** `Make Admin` button is not shown when selected users are all admins ### Objectives - [x] A better system to handle errors by recording the different types of errors returned from the backend. - [x] Assign appropriate error messages to the errors recorded. - [x] Implement a dynamic action bar in the users page which dynamically reveals and hides action buttons based on relevancy. ### Recording https://github.com/hoppscotch/hoppscotch/assets/70131076/b83e7471-7e68-48ae-a5b8-5d9a137e3681 ### 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 - [x] All the tests have passed --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:09:40 +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#4644
No description provided.