From 24346d702fe22b0d9276f0e51ec18c3b63677009 Mon Sep 17 00:00:00 2001 From: amk-dev Date: Fri, 22 Mar 2024 17:22:00 +0530 Subject: [PATCH 1/3] chore: hide personal collections from spotlight when using teams --- .../services/spotlight/searchers/collections.searcher.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/hoppscotch-common/src/services/spotlight/searchers/collections.searcher.ts b/packages/hoppscotch-common/src/services/spotlight/searchers/collections.searcher.ts index fdb532612c..5326661bc3 100644 --- a/packages/hoppscotch-common/src/services/spotlight/searchers/collections.searcher.ts +++ b/packages/hoppscotch-common/src/services/spotlight/searchers/collections.searcher.ts @@ -169,7 +169,16 @@ export class CollectionsSpotlightSearcherService } scopeHandle.run(() => { + const isPersonalWorkspace = computed( + () => this.workspaceService.currentWorkspace.value.type === "personal" + ) + watch(query, (query) => { + if (!isPersonalWorkspace.value) { + results.value = [] + return + } + if (pageCategory === "other") { results.value = [] return From 3dd0c629c8cfd390709871fdc14bafdeffbb7fd5 Mon Sep 17 00:00:00 2001 From: amk-dev Date: Fri, 22 Mar 2024 17:23:43 +0530 Subject: [PATCH 2/3] chore: teams search spotlight improvements --- .../searchers/teamRequest.searcher.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/packages/hoppscotch-common/src/services/spotlight/searchers/teamRequest.searcher.ts b/packages/hoppscotch-common/src/services/spotlight/searchers/teamRequest.searcher.ts index 8513bb83d3..891eeae0f5 100644 --- a/packages/hoppscotch-common/src/services/spotlight/searchers/teamRequest.searcher.ts +++ b/packages/hoppscotch-common/src/services/spotlight/searchers/teamRequest.searcher.ts @@ -65,6 +65,25 @@ export class TeamsSpotlightSearcherService immediate: true, } ) + + // set the search section title based on the current workspace + const teamName = computed(() => { + return ( + (this.workspaceService.currentWorkspace.value.type === "team" && + this.workspaceService.currentWorkspace.value.teamName) || + this.t("team.search_title") + ) + }) + + watch( + teamName, + (teamName) => { + this.searcherSectionTitle = teamName + }, + { + immediate: true, + } + ) }) const onSessionEnd = () => { From 6d5deed451506858253958d49543163f34121ea0 Mon Sep 17 00:00:00 2001 From: jamesgeorge007 Date: Fri, 22 Mar 2024 23:37:00 +0530 Subject: [PATCH 3/3] chore: cleanup --- .../services/spotlight/searchers/teamRequest.searcher.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/hoppscotch-common/src/services/spotlight/searchers/teamRequest.searcher.ts b/packages/hoppscotch-common/src/services/spotlight/searchers/teamRequest.searcher.ts index 891eeae0f5..2fc82b0969 100644 --- a/packages/hoppscotch-common/src/services/spotlight/searchers/teamRequest.searcher.ts +++ b/packages/hoppscotch-common/src/services/spotlight/searchers/teamRequest.searcher.ts @@ -58,7 +58,7 @@ export class TeamsSpotlightSearcherService (query) => { if (this.workspaceService.currentWorkspace.value.type === "team") { const teamID = this.workspaceService.currentWorkspace.value.teamID - debouncedSearch(query, teamID)?.catch((_) => {}) + debouncedSearch(query, teamID)?.catch(() => {}) } }, { @@ -77,8 +77,8 @@ export class TeamsSpotlightSearcherService watch( teamName, - (teamName) => { - this.searcherSectionTitle = teamName + (newTeamName) => { + this.searcherSectionTitle = newTeamName }, { immediate: true,