From 833e11ab0be001604bda8e115a8a96667d4e3983 Mon Sep 17 00:00:00 2001 From: Andrew Bastin Date: Tue, 4 Jul 2023 12:54:57 +0530 Subject: [PATCH] feat: general spotlight improvements and introducing user searcher --- packages/hoppscotch-common/locales/en.json | 5 + .../hoppscotch-common/src/components.d.ts | 3 +- .../src/components/app/spotlight/index.vue | 29 +- .../spotlight/__tests__/index.spec.ts | 36 +- .../src/services/spotlight/index.ts | 115 ++++- .../searchers/__tests__/user.searcher.spec.ts | 175 ++++++++ .../base/__tests__/static.searcher.spec.ts | 403 ++++++++++++++++++ .../searchers/base/static.searcher.ts | 131 ++++-- .../spotlight/searchers/history.searcher.ts | 10 +- .../spotlight/searchers/user.searcher.ts | 96 +++++ 10 files changed, 924 insertions(+), 79 deletions(-) create mode 100644 packages/hoppscotch-common/src/services/spotlight/searchers/__tests__/user.searcher.spec.ts create mode 100644 packages/hoppscotch-common/src/services/spotlight/searchers/base/__tests__/static.searcher.spec.ts create mode 100644 packages/hoppscotch-common/src/services/spotlight/searchers/user.searcher.ts diff --git a/packages/hoppscotch-common/locales/en.json b/packages/hoppscotch-common/locales/en.json index 79f7304a8..d50334309 100644 --- a/packages/hoppscotch-common/locales/en.json +++ b/packages/hoppscotch-common/locales/en.json @@ -583,6 +583,11 @@ "log": "Log", "url": "URL" }, + "spotlight": { + "section": { + "user": "User" + } + }, "sse": { "event_type": "Event type", "log": "Log", diff --git a/packages/hoppscotch-common/src/components.d.ts b/packages/hoppscotch-common/src/components.d.ts index 2f65709a4..a9d66d3d9 100644 --- a/packages/hoppscotch-common/src/components.d.ts +++ b/packages/hoppscotch-common/src/components.d.ts @@ -11,7 +11,6 @@ declare module '@vue/runtime-core' { AppAnnouncement: typeof import('./components/app/Announcement.vue')['default'] AppDeveloperOptions: typeof import('./components/app/DeveloperOptions.vue')['default'] AppFooter: typeof import('./components/app/Footer.vue')['default'] - AppFuse: typeof import('./components/app/Fuse.vue')['default'] AppGitHubStarButton: typeof import('./components/app/GitHubStarButton.vue')['default'] AppHeader: typeof import('./components/app/Header.vue')['default'] AppInterceptor: typeof import('./components/app/Interceptor.vue')['default'] @@ -132,6 +131,8 @@ declare module '@vue/runtime-core' { IconLucideLayers: typeof import('~icons/lucide/layers')['default'] IconLucideListEnd: typeof import('~icons/lucide/list-end')['default'] IconLucideMinus: typeof import('~icons/lucide/minus')['default'] + IconLucideRefreshCcw: typeof import('~icons/lucide/refresh-ccw')['default'] + IconLucideRefreshCw: typeof import('~icons/lucide/refresh-cw')['default'] IconLucideSearch: typeof import('~icons/lucide/search')['default'] IconLucideUsers: typeof import('~icons/lucide/users')['default'] LensesHeadersRenderer: typeof import('./components/lenses/HeadersRenderer.vue')['default'] diff --git a/packages/hoppscotch-common/src/components/app/spotlight/index.vue b/packages/hoppscotch-common/src/components/app/spotlight/index.vue index 7542562fb..e40b1f759 100644 --- a/packages/hoppscotch-common/src/components/app/spotlight/index.vue +++ b/packages/hoppscotch-common/src/components/app/spotlight/index.vue @@ -7,16 +7,23 @@ >