From 3a30c27c9a98a8962bda8f400f0e4e94622cdb51 Mon Sep 17 00:00:00 2001 From: Amir Raminfar Date: Thu, 30 May 2024 09:47:20 -0700 Subject: [PATCH] feat!: adds services and stacks to fuzzy search. Note labels will no longer be searchable due to a bug on sorting. (#2999) --- assets/components/FuzzySearchModal.spec.ts | 5 +- assets/components/FuzzySearchModal.vue | 96 +++++++++++++++++----- assets/components/SideMenu.vue | 9 ++ assets/models/Stack.ts | 8 ++ assets/pages/group/[name].vue | 4 + assets/pages/service/[name].vue | 4 + assets/pages/stack/[name].vue | 4 + 7 files changed, 106 insertions(+), 24 deletions(-) diff --git a/assets/components/FuzzySearchModal.spec.ts b/assets/components/FuzzySearchModal.spec.ts index 5f48eca3..388a123c 100644 --- a/assets/components/FuzzySearchModal.spec.ts +++ b/assets/components/FuzzySearchModal.spec.ts @@ -33,7 +33,7 @@ function createFuzzySearchModal() { containers: [ new Container("123", new Date(), "image", "test", "command", "host", {}, "status", "running", []), new Container("345", new Date(), "image", "foo bar", "command", "host", {}, "status", "running", []), - new Container("567", new Date(), "image", "baz", "command", "host", {}, "status", "exited", []), + new Container("567", new Date(), "image", "baz", "command", "host", {}, "status", "running", []), ], }, }, @@ -56,7 +56,8 @@ describe("", () => { beforeEach(() => { vi.mocked(useRouter().push).mockReset(); }); - test("shows all", async () => { + + test("shows running all", async () => { const wrapper = createFuzzySearchModal(); expect(wrapper.findAll("li").length).toBe(3); }); diff --git a/assets/components/FuzzySearchModal.vue b/assets/components/FuzzySearchModal.vue index a271c1a9..d6ac8c2a 100644 --- a/assets/components/FuzzySearchModal.vue +++ b/assets/components/FuzzySearchModal.vue @@ -24,14 +24,23 @@ :class="index === selectedIndex ? 'focus' : ''" >
- + + +
-