[PR #4334] [MERGED] feat: duplicate global environment under team workspaces #4758

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

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/4334
Author: @jamesgeorge007
Created: 9/9/2024
Status: Merged
Merged: 9/25/2024
Merged by: @jamesgeorge007

Base: nextHead: feat/duplicate-global-environment-team-workspace


📝 Commits (7)

  • e1d759f feat: duplicate global environment under team workspaces
  • 5e66642 refactor: helper function abstracting error messages
  • 1cfc6e5 chore: cleanup
  • e39469e chore: hide tippy after clicking duplicate
  • baea5e6 feat: add loading state for environment context menu actions
  • b93899b chore: add - Duplicate suffix for duplicated environment entries
  • a2e51df chore: cleanup

📊 Changes

9 files changed (+135 additions, -111 deletions)

View changed files

📝 packages/hoppscotch-backend/src/team-environments/team-environments.service.ts (+1 -1)
📝 packages/hoppscotch-common/src/components/environments/Add.vue (+6 -19)
📝 packages/hoppscotch-common/src/components/environments/Selector.vue (+6 -18)
📝 packages/hoppscotch-common/src/components/environments/index.vue (+50 -4)
📝 packages/hoppscotch-common/src/components/environments/my/Environment.vue (+29 -15)
📝 packages/hoppscotch-common/src/components/environments/teams/Details.vue (+3 -16)
📝 packages/hoppscotch-common/src/components/environments/teams/Environment.vue (+20 -25)
📝 packages/hoppscotch-common/src/components/environments/teams/index.vue (+2 -13)
packages/hoppscotch-common/src/helpers/error-messages/index.ts (+18 -0)

📄 Description

The duplicate global environment action was specific to the personal workspace, where the entries were added and hidden while at a team workspace with #4245. This PR re-enables the action under team workspaces and extends support. Also, the following changes are added alongside applicable to team workspaces:

  • Loading states addition for duplicate regular & global environment actions via the context menu.
  • Adds a - Duplicate suffix for duplicated environment entries.

Closes HFE-575.

Preview

https://github.com/user-attachments/assets/c406ff47-b191-4857-a1ea-06ca4bd6b567

What's changed

  • Adds new props duplicateGlobalEnvironmentLoading (keeps track of the n/w call status and dismisses the context menu) & showContextMenuLoadingState (Indicates the context menu is to be displayed during the n/w call in a team workspace) and defines a new event duplicate-global-environment under the EnvironmentsMyEnvironment component.
  • Relevant additions under the root Environments component to trigger the createTeamEnvironment GQL mutation with the global environment variables in scope.
  • Adds a new helper function getEnvActionErrrorMessage abstracting the error messages reused for environment-related actions.
  • Add - Duplicate suffix to duplicated environment names under team workspaces.

Notes to reviewers

Please ensure to cross-check the error message updates once with the newly added helper function.


🔄 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/4334 **Author:** [@jamesgeorge007](https://github.com/jamesgeorge007) **Created:** 9/9/2024 **Status:** ✅ Merged **Merged:** 9/25/2024 **Merged by:** [@jamesgeorge007](https://github.com/jamesgeorge007) **Base:** `next` ← **Head:** `feat/duplicate-global-environment-team-workspace` --- ### 📝 Commits (7) - [`e1d759f`](https://github.com/hoppscotch/hoppscotch/commit/e1d759fad63b3ebe2035ef371a95e912dfe93a3e) feat: duplicate global environment under team workspaces - [`5e66642`](https://github.com/hoppscotch/hoppscotch/commit/5e66642c876c0300fd2cdbdcab4a8fd6d43549df) refactor: helper function abstracting error messages - [`1cfc6e5`](https://github.com/hoppscotch/hoppscotch/commit/1cfc6e513fc4d41b72c9940ff89f99c74ba8cd08) chore: cleanup - [`e39469e`](https://github.com/hoppscotch/hoppscotch/commit/e39469eb92c19e3070ae472e770d12bb9a0af7a0) chore: hide tippy after clicking duplicate - [`baea5e6`](https://github.com/hoppscotch/hoppscotch/commit/baea5e6f57f673c242199e91e631f5a061693465) feat: add loading state for environment context menu actions - [`b93899b`](https://github.com/hoppscotch/hoppscotch/commit/b93899b50cf0bcb16cf4e6c7b50ef22d5e75d5c6) chore: add ` - Duplicate` suffix for duplicated environment entries - [`a2e51df`](https://github.com/hoppscotch/hoppscotch/commit/a2e51df36abbe9f08dac18ec6b4d3ffd2d4e5fdb) chore: cleanup ### 📊 Changes **9 files changed** (+135 additions, -111 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-backend/src/team-environments/team-environments.service.ts` (+1 -1) 📝 `packages/hoppscotch-common/src/components/environments/Add.vue` (+6 -19) 📝 `packages/hoppscotch-common/src/components/environments/Selector.vue` (+6 -18) 📝 `packages/hoppscotch-common/src/components/environments/index.vue` (+50 -4) 📝 `packages/hoppscotch-common/src/components/environments/my/Environment.vue` (+29 -15) 📝 `packages/hoppscotch-common/src/components/environments/teams/Details.vue` (+3 -16) 📝 `packages/hoppscotch-common/src/components/environments/teams/Environment.vue` (+20 -25) 📝 `packages/hoppscotch-common/src/components/environments/teams/index.vue` (+2 -13) ➕ `packages/hoppscotch-common/src/helpers/error-messages/index.ts` (+18 -0) </details> ### 📄 Description The duplicate global environment action was specific to the personal workspace, where the entries were added and hidden while at a team workspace with #4245. This PR re-enables the action under team workspaces and extends support. Also, the following changes are added alongside applicable to team workspaces: - Loading states addition for duplicate regular & global environment actions via the context menu. - Adds a `- Duplicate` suffix for duplicated environment entries. Closes HFE-575. ### Preview https://github.com/user-attachments/assets/c406ff47-b191-4857-a1ea-06ca4bd6b567 ### What's changed - Adds new props `duplicateGlobalEnvironmentLoading` (keeps track of the n/w call status and dismisses the context menu) & `showContextMenuLoadingState` (Indicates the context menu is to be displayed during the n/w call in a team workspace) and defines a new event `duplicate-global-environment` under the `EnvironmentsMyEnvironment` component. - Relevant additions under the root `Environments` component to trigger the `createTeamEnvironment` GQL mutation with the global environment variables in scope. - Adds a new helper function `getEnvActionErrrorMessage` abstracting the error messages reused for environment-related actions. - Add `- Duplicate` suffix to duplicated environment names under team workspaces. ### Notes to reviewers Please ensure to cross-check the error message updates once with the newly added helper function. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:15:56 +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#4758
No description provided.