From 3fd84e92e95c2dd21d33afbd7329669ccdec6a39 Mon Sep 17 00:00:00 2001 From: amk-dev Date: Fri, 15 Mar 2024 05:35:44 +0530 Subject: [PATCH] feat: team search in workspace search and spotlight --- packages/hoppscotch-common/locales/en.json | 5 +- .../hoppscotch-common/src/components.d.ts | 3 + .../spotlight/entry/RESTTeamRequestEntry.vue | 32 ++ .../src/components/app/spotlight/index.vue | 2 + .../collections/TeamCollections.vue | 15 +- .../src/components/collections/index.vue | 59 ++- .../src/helpers/teams/TeamsSearch.service.ts | 469 ++++++++++++++++++ .../searchers/teamRequest.searcher.ts | 140 ++++++ 8 files changed, 711 insertions(+), 14 deletions(-) create mode 100644 packages/hoppscotch-common/src/components/app/spotlight/entry/RESTTeamRequestEntry.vue create mode 100644 packages/hoppscotch-common/src/helpers/teams/TeamsSearch.service.ts create mode 100644 packages/hoppscotch-common/src/services/spotlight/searchers/teamRequest.searcher.ts diff --git a/packages/hoppscotch-common/locales/en.json b/packages/hoppscotch-common/locales/en.json index 905844c33f6..60d5619e54c 100644 --- a/packages/hoppscotch-common/locales/en.json +++ b/packages/hoppscotch-common/locales/en.json @@ -281,7 +281,7 @@ "updated": "Environment updated", "value": "Value", "variable": "Variable", - "variables":"Variables", + "variables": "Variables", "variable_list": "Variable List" }, "error": { @@ -961,7 +961,8 @@ "success_invites": "Success invites", "title": "Workspaces", "we_sent_invite_link": "We sent an invite link to all invitees!", - "we_sent_invite_link_description": "Ask all invitees to check their inbox. Click on the link to join the workspace." + "we_sent_invite_link_description": "Ask all invitees to check their inbox. Click on the link to join the workspace.", + "search_title": "Team Requests" }, "team_environment": { "deleted": "Environment Deleted", diff --git a/packages/hoppscotch-common/src/components.d.ts b/packages/hoppscotch-common/src/components.d.ts index df8e8a8fa78..52d1e50f389 100644 --- a/packages/hoppscotch-common/src/components.d.ts +++ b/packages/hoppscotch-common/src/components.d.ts @@ -31,6 +31,7 @@ declare module 'vue' { AppSpotlightEntryIconSelected: typeof import('./components/app/spotlight/entry/IconSelected.vue')['default'] AppSpotlightEntryRESTHistory: typeof import('./components/app/spotlight/entry/RESTHistory.vue')['default'] AppSpotlightEntryRESTRequest: typeof import('./components/app/spotlight/entry/RESTRequest.vue')['default'] + AppSpotlightEntryRESTTeamRequestEntry: typeof import('./components/app/spotlight/entry/RESTTeamRequestEntry.vue')['default'] AppSupport: typeof import('./components/app/Support.vue')['default'] Collections: typeof import('./components/collections/index.vue')['default'] CollectionsAdd: typeof import('./components/collections/Add.vue')['default'] @@ -57,6 +58,7 @@ declare module 'vue' { CollectionsRequest: typeof import('./components/collections/Request.vue')['default'] CollectionsSaveRequest: typeof import('./components/collections/SaveRequest.vue')['default'] CollectionsTeamCollections: typeof import('./components/collections/TeamCollections.vue')['default'] + CollectionsTeamSearchResults: typeof import('./components/collections/TeamSearchResults.vue')['default'] CookiesAllModal: typeof import('./components/cookies/AllModal.vue')['default'] CookiesEditCookie: typeof import('./components/cookies/EditCookie.vue')['default'] Embeds: typeof import('./components/embeds/index.vue')['default'] @@ -131,6 +133,7 @@ declare module 'vue' { HttpRequest: typeof import('./components/http/Request.vue')['default'] HttpRequestOptions: typeof import('./components/http/RequestOptions.vue')['default'] HttpRequestTab: typeof import('./components/http/RequestTab.vue')['default'] + HttpRequestVariables: typeof import('./components/http/RequestVariables.vue')['default'] HttpResponse: typeof import('./components/http/Response.vue')['default'] HttpResponseMeta: typeof import('./components/http/ResponseMeta.vue')['default'] HttpSidebar: typeof import('./components/http/Sidebar.vue')['default'] diff --git a/packages/hoppscotch-common/src/components/app/spotlight/entry/RESTTeamRequestEntry.vue b/packages/hoppscotch-common/src/components/app/spotlight/entry/RESTTeamRequestEntry.vue new file mode 100644 index 00000000000..109367c6df4 --- /dev/null +++ b/packages/hoppscotch-common/src/components/app/spotlight/entry/RESTTeamRequestEntry.vue @@ -0,0 +1,32 @@ + + + diff --git a/packages/hoppscotch-common/src/components/app/spotlight/index.vue b/packages/hoppscotch-common/src/components/app/spotlight/index.vue index 5081bfad13e..7da96ea7834 100644 --- a/packages/hoppscotch-common/src/components/app/spotlight/index.vue +++ b/packages/hoppscotch-common/src/components/app/spotlight/index.vue @@ -111,6 +111,7 @@ import { RequestSpotlightSearcherService } from "~/services/spotlight/searchers/ import { ResponseSpotlightSearcherService } from "~/services/spotlight/searchers/response.searcher" import { SettingsSpotlightSearcherService } from "~/services/spotlight/searchers/settings.searcher" import { TabSpotlightSearcherService } from "~/services/spotlight/searchers/tab.searcher" +import { TeamsSpotlightSearcherService } from "~/services/spotlight/searchers/teamRequest.searcher" import { UserSpotlightSearcherService } from "~/services/spotlight/searchers/user.searcher" import { SwitchWorkspaceSpotlightSearcherService, @@ -144,6 +145,7 @@ useService(SwitchEnvSpotlightSearcherService) useService(WorkspaceSpotlightSearcherService) useService(SwitchWorkspaceSpotlightSearcherService) useService(InterceptorSpotlightSearcherService) +useService(TeamsSpotlightSearcherService) platform.spotlight?.additionalSearchers?.forEach((searcher) => useService(searcher) diff --git a/packages/hoppscotch-common/src/components/collections/TeamCollections.vue b/packages/hoppscotch-common/src/components/collections/TeamCollections.vue index fa8f71cb4ee..0a99acad73e 100644 --- a/packages/hoppscotch-common/src/components/collections/TeamCollections.vue +++ b/packages/hoppscotch-common/src/components/collections/TeamCollections.vue @@ -283,7 +283,15 @@