mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
[PR #4113] [MERGED] refactor(workspaces): personal workspace provider additions for REST environments #4674
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#4674
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hoppscotch/hoppscotch/pull/4113
Author: @jamesgeorge007
Created: 6/11/2024
Status: ✅ Merged
Merged: 6/21/2024
Merged by: @jamesgeorge007
Base:
refactor/workspaces← Head:refactor/workspaces-personal-provider-additions📝 Commits (10+)
f7e5d7erefactor: port GQL related functionality to the new architecturebd6b76dfix: UI not reflecting underlying service level changes immediatelyde9fe49chore: ensure handle for the collection being updated/removed are updated straightaway75b1ca6refactor: enable GQL related functionality inSave asmodal6481d83refactor: invoke GQL provider methods viapersonalWorkspaceProviderServicee1260d8refactor: port REST environments related functionality to the new architecture65e1a81chore: cleanup98a9f0drefactor: dedicated methods for REST/GQL27bffaarefactor: eliminate redundancyb2a1ae9refactor: perform request duplication via the create request provider method📊 Changes
35 files changed (+1792 additions, -564 deletions)
View changed files
📝
packages/hoppscotch-common/locales/en.json(+3 -2)📝
packages/hoppscotch-common/src/components.d.ts(+4 -0)📝
packages/hoppscotch-common/src/components/collections/Collection.vue(+2 -2)📝
packages/hoppscotch-common/src/components/collections/ImportExport.vue(+5 -7)📝
packages/hoppscotch-common/src/components/collections/MyCollections.vue(+3 -3)📝
packages/hoppscotch-common/src/components/collections/Properties.vue(+11 -4)📝
packages/hoppscotch-common/src/components/collections/SaveRequest.vue(+92 -82)📝
packages/hoppscotch-common/src/components/collections/TeamCollections.vue(+3 -3)📝
packages/hoppscotch-common/src/components/environments/ImportExport.vue(+73 -42)📝
packages/hoppscotch-common/src/components/environments/index.vue(+226 -8)📝
packages/hoppscotch-common/src/components/environments/my/Details.vue(+29 -52)📝
packages/hoppscotch-common/src/components/environments/my/Environment.vue(+81 -27)📝
packages/hoppscotch-common/src/components/environments/my/index.vue(+25 -6)📝
packages/hoppscotch-common/src/components/environments/teams/Details.vue(+11 -0)📝
packages/hoppscotch-common/src/components/environments/teams/Environment.vue(+9 -0)📝
packages/hoppscotch-common/src/components/environments/teams/index.vue(+13 -0)📝
packages/hoppscotch-common/src/components/http/Sidebar.vue(+0 -1)📝
packages/hoppscotch-common/src/components/new-collections/index.vue(+6 -2)📝
packages/hoppscotch-common/src/components/new-collections/rest/index.vue(+77 -44)📝
packages/hoppscotch-common/src/helpers/adapters/WorkspaceRESTCollectionTreeAdapter.ts(+1 -1)...and 15 more files
📄 Description
Description
This PR ports GraphQL collections & REST environments to the new handles-based architecture.
Closes HFE-525.
Changes
Adds the following methods under the personal workspace provider corresponding to the abovementioned features.
Introduce
restEnvironmentStatemember at thePersonalWorkspaceProviderServicelevel holding the environment store state.The
getCollectionHandle&getRequestHandlemethods are renamed togetRESTCollectionHandle&getRESTRequestHandlerespectively.Environments-related component updates moving to the provider API methods. Separate components for personal/team workspaces are kept as is for now and events are emitted corresponding to the action performed (create, edit, etc) bound to the respective provider method at the base component level (
Environments).Introduce the
RESTEnvironmentsViewtype corresponding to the list of environments under a workspace (return type of thegetRESTEnvironmentsViewmethod).Perform request duplication via the provider method for creating a request.
Includes a fix for the case when the request from the collection tree and the one open under a tab dissociates when closed and reopened. The corresponding request handle is removed from the issued handles list maintained at the
PersonalWorkspaceProviderservice level via the newsetIssuedHandlesmethod when a tab is closed. A new helper functionupdateIssuedHandlesForPersonalWorkspaceis added under~/helpers/tab/index.tsabstracting the business logic for use in the REST/page (to be extended to GQL in the future). Also, while invalidating the affected request handles while removing a collection/request, the respective handles are removed fromissuedHandlesto prevent having unnecessary invalidated handle{ type: "invalid", reason: <string> }entries kept throughout.Checks
Note to reviewers
The changes aimed at porting GQL collections are reverted for the time being since a few issues were encountered while testing the flows e2e - To be revisited.
RESTprefixes are added to certain methods. Dedicated methods will be introduced once GQL collections-related functionality is ported with future-proofing in mind. Although the functionality is almost similar with the store update approach being the difference, they are kept distinct to account for the increase in scope (The current scope of workspace refactor only deals with the store/data source level) that might lead to diverging business logic.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.