From a686de0414d8ef666d861db0dd647c5f13d5d71e Mon Sep 17 00:00:00 2001 From: John Cowen Date: Tue, 11 Aug 2020 18:02:51 +0100 Subject: [PATCH] ui: Add Optgroups and selectedItems to multiple select dropdown and use (#8476) * ui: Switch selects to use more HTML-like approach for optgroups * Add KV comparator * Use new option/optgroup approach for sort/select * Fix up tests for new order of menu items --- .../popover-menu/menu-item/index.hbs | 7 +- ui-v2/app/components/popover-select/index.hbs | 49 ++--- ui-v2/app/components/popover-select/index.js | 43 +++- .../popover-select/optgroup/index.hbs | 8 + .../popover-select/optgroup/index.js | 5 + .../popover-select/option/index.hbs | 11 + .../components/popover-select/option/index.js | 20 ++ ui-v2/app/components/search-bar/index.hbs | 29 ++- .../controllers/dc/services/show/instances.js | 1 + .../dc/services/show/intentions/index.js | 4 +- ui-v2/app/initializers/sort.js | 2 + ui-v2/app/services/dom.js | 18 ++ ui-v2/app/sort/comparators/kv.js | 3 + .../app/styles/components/app-view/skin.scss | 4 +- ui-v2/app/styles/components/buttons.scss | 1 - .../app/templates/dc/acls/policies/index.hbs | 47 +++-- ui-v2/app/templates/dc/acls/roles/index.hbs | 55 +++-- ui-v2/app/templates/dc/acls/tokens/index.hbs | 53 +++-- ui-v2/app/templates/dc/intentions/index.hbs | 73 +++++-- ui-v2/app/templates/dc/kv/index.hbs | 191 +++++++++++------- ui-v2/app/templates/dc/nspaces/index.hbs | 52 +++-- ui-v2/app/templates/dc/services/index.hbs | 54 +++-- .../dc/services/show/intentions/index.hbs | 82 +++++--- .../acceptance/dc/acls/roles/sorting.feature | 114 +++++------ .../dc/services/show/intentions.feature | 4 +- .../acceptance/dc/services/sorting.feature | 26 +-- 26 files changed, 636 insertions(+), 320 deletions(-) create mode 100644 ui-v2/app/components/popover-select/optgroup/index.hbs create mode 100644 ui-v2/app/components/popover-select/optgroup/index.js create mode 100644 ui-v2/app/components/popover-select/option/index.hbs create mode 100644 ui-v2/app/components/popover-select/option/index.js create mode 100644 ui-v2/app/sort/comparators/kv.js diff --git a/ui-v2/app/components/popover-menu/menu-item/index.hbs b/ui-v2/app/components/popover-menu/menu-item/index.hbs index 598bb92774..7cce6c7cf3 100644 --- a/ui-v2/app/components/popover-menu/menu-item/index.hbs +++ b/ui-v2/app/components/popover-menu/menu-item/index.hbs @@ -27,7 +27,12 @@ {{/let}} {{else}} -