From 1412e65bbd351e554c64fb2f082e9b5dc1f8f0b1 Mon Sep 17 00:00:00 2001 From: Phil Renaud Date: Wed, 29 May 2024 21:01:57 -0400 Subject: [PATCH] [ui] Dropdowns on the jobs index page get a max-height and filtering (#20626) * Adds a max-height to dropdowns lest they get any funny ideas * Filter filtering --- .changelog/20626.txt | 3 ++ ui/app/controllers/jobs/index.js | 16 +++++++ ui/app/templates/jobs/index.hbs | 16 +++++-- ui/tests/acceptance/jobs-list-test.js | 63 +++++++++++++++++++++++++++ 4 files changed, 95 insertions(+), 3 deletions(-) create mode 100644 .changelog/20626.txt diff --git a/.changelog/20626.txt b/.changelog/20626.txt new file mode 100644 index 000000000000..09451912634b --- /dev/null +++ b/.changelog/20626.txt @@ -0,0 +1,3 @@ +```release-note:improvement +ui: namespace dropdown gets a search field and supports many namespaces +``` diff --git a/ui/app/controllers/jobs/index.js b/ui/app/controllers/jobs/index.js index a2d612472b59..733eb89ce164 100644 --- a/ui/app/controllers/jobs/index.js +++ b/ui/app/controllers/jobs/index.js @@ -392,6 +392,22 @@ export default class JobsIndexController extends Controller { }; } + @tracked namespaceFilter = ''; + + get shownNamespaces() { + return this.namespaceFacet.options.filter((option) => + option.label.toLowerCase().includes(this.namespaceFilter) + ); + } + + /** + * Pares down the list of namespaces + * @param {InputEvent & { target: HTMLInputElement }} event - The input event + */ + @action filterNamespaces(event) { + this.namespaceFilter = event.target.value.toLowerCase(); + } + get filterFacets() { let facets = [this.statusFacet, this.typeFacet]; if (this.system.shouldShowNodepools) { diff --git a/ui/app/templates/jobs/index.hbs b/ui/app/templates/jobs/index.hbs index edcd8ff89ee7..3a953ebad66b 100644 --- a/ui/app/templates/jobs/index.hbs +++ b/ui/app/templates/jobs/index.hbs @@ -20,7 +20,7 @@ /> {{#each this.filterFacets as |group|}} - + + - {{#each this.namespaceFacet.options as |option|}} + + + + {{#each this.shownNamespaces as |option|}}