New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(workspaces): provider additions for collections under personal workspace #3859
Draft
jamesgeorge007
wants to merge
48
commits into
refactor/workspaces
Choose a base branch
from
refactor/workspaces-collection-provider-additions
base: refactor/workspaces
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
refactor(workspaces): provider additions for collections under personal workspace #3859
jamesgeorge007
wants to merge
48
commits into
refactor/workspaces
from
refactor/workspaces-collection-provider-additions
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collection ID can be inferred from request ID by removing last index from the path.
…ewRequest` type Collection ID serves the purpose.
…ns performed over it
Ensure the entire collection tree is rendered if the search query matches a collection name.
jamesgeorge007
force-pushed
the
refactor/workspaces-collection-provider-additions
branch
from
February 27, 2024 17:35
54706e3
to
845db07
Compare
Only the IDs (workspace, provider & request IDs) to restore the handle are stored under `localStorage` and the handle is restored back at runtime.
jamesgeorge007
force-pushed
the
refactor/workspaces-collection-provider-additions
branch
3 times, most recently
from
April 24, 2024 11:16
3c0af78
to
ee1e98e
Compare
…time Remove provider, workspace and request IDs.
jamesgeorge007
force-pushed
the
refactor/workspaces-collection-provider-additions
branch
from
May 1, 2024 13:15
09c1221
to
9136d13
Compare
Mark the tab (saved request under a collection) as not dirty if the request contents are reset to the value since previous save.
jamesgeorge007
force-pushed
the
refactor/workspaces-collection-provider-additions
branch
from
May 1, 2024 13:19
9136d13
to
4b49ecf
Compare
- Filter out duplicate issued handle entries. - Move from `getAffectedIndexes` helper function to a custom implementation for updating affected request indices.
jamesgeorge007
force-pushed
the
refactor/workspaces-collection-provider-additions
branch
7 times, most recently
from
May 7, 2024 07:56
cabe27e
to
e1e3fb1
Compare
jamesgeorge007
force-pushed
the
refactor/workspaces-collection-provider-additions
branch
from
May 7, 2024 14:26
e1e3fb1
to
bc976af
Compare
jamesgeorge007
force-pushed
the
refactor/workspaces-collection-provider-additions
branch
from
May 9, 2024 08:04
b714b01
to
f086a96
Compare
jamesgeorge007
force-pushed
the
refactor/workspaces-collection-provider-additions
branch
5 times, most recently
from
May 10, 2024 05:35
2e3d9ff
to
5875eed
Compare
jamesgeorge007
force-pushed
the
refactor/workspaces-collection-provider-additions
branch
from
May 10, 2024 10:42
5875eed
to
4926b7d
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR ports the existing implementation for import/export, move/reorder, and search corresponding to collections under personal workspace to the provider-based new architecture. It also adds support for searching collections at any depth.
Closes HFE-437.
Changes
Adds the following methods under the personal workspace provider corresponding to the features mentioned above.
Additions to the
NewCollectionsRest
component accounting for the ported features mentioned above. The business logic associated with updates to the store for each action resides in the provider definition for each workspace invoked from the component level via the new workspace service implementation.Move the markup and associated logic wrt showing the active workspace and search from the parent level
NewCollections
component to `NewCollectionsRest.Port the collection/request move/reorder logic (markup, events, handlers, etc) into the
NewCollectionsRestCollection
andNewCollectionsRestRequest
components.Introduce a new tree adapter to render the tree with search results. This was required since the existing adapter for rendering the default collection tree operates based on the supplied workspace handle. While, for search, is to be based on the initial data provided to be filtered based on.
The
getChildren
method to be implemented by the tree adapter now takes an additional argument signifying the type of the incoming node (collection/request
). This acts as a safeguard to prevent errors with operations specific to a collection node.Remove
collectionID
from information persisted under the REST tabsaveContext
sincerequestID
accounts for it.initializeDownloadCollection
helper under~/packages/hoppscotch-common/src/helpers/import-export/export
is given an agnosic nameinitializeDownloadFile
since it gets consumed in different contexts. The definition is updated to point to the platform definition to ensure the underlying platform defines the behavior.New helper functions under ~/packages/hoppscotch-common/src/services/new-workspace/helpers.ts to abstract common logic consumed in the provider method definitions.
Formalise a system for creating a persistable handle reference that can be loaded back again - Persist request handles at runtime, write only the unique IDs (provider, workspace & request IDs) required to restore the handle to
localStorage
. Load the request handle back via the IDs at runtime.Introduce writable handles to signify updates to other handle references when an action is performed. For instance, a request from the collection tree is deleted and at the same time the handle issued is updated thereby the request handle persisted under tab
saveContext
is aware of the update (handle type is set toinvalid
) and toggles the dirty state in this case.Checks