From 2a99b3651f7dbe65627dba6183c5c1a465818e7b Mon Sep 17 00:00:00 2001 From: Chelsea Shaw <82459713+hashishaw@users.noreply.github.com> Date: Fri, 3 May 2024 12:09:03 -0500 Subject: [PATCH] UI: Update engine dropdowns (#26806) * Update search-select component - Add aria-label arg - use label or humanized ID as fallback aria-label - protect against non-array options arg * remove overflow-x rule on toolbar-scroller so dropdowns can render in place * add renderInPlace to dropdowns in pki engine * Update replication package.json and add renderInPlace * Add renderInPlace to search-select and basic-dropdown in engines (kubernetes, kv, ldap, sync) * small cleanup --- ui/app/styles/components/toolbar.scss | 1 - .../addon/components/copy-secret-dropdown.hbs | 9 ++++++++- .../core/addon/components/search-select.hbs | 1 + ui/lib/core/addon/components/search-select.js | 3 ++- .../addon/components/page/overview.hbs | 1 + .../addon/components/kv-version-dropdown.hbs | 2 +- .../ldap/addon/components/page/overview.hbs | 19 +++++++++++-------- .../components/page/pki-issuer-details.hbs | 12 +++++++++--- .../addon/components/page/pki-issuer-list.hbs | 8 +++++++- .../page/pki-issuer-rotate-root.hbs | 8 +++++++- .../addon/components/page/pki-overview.hbs | 5 ++++- .../pki/addon/components/page/pki-overview.ts | 4 ++-- ui/lib/pki/package.json | 1 + .../components/path-filter-config-list.hbs | 1 + ui/lib/replication/package.json | 5 +++-- .../components/secrets/page/destinations.hbs | 1 + .../page/destinations/destination/sync.hbs | 1 + 17 files changed, 60 insertions(+), 22 deletions(-) diff --git a/ui/app/styles/components/toolbar.scss b/ui/app/styles/components/toolbar.scss index 19dbd3eba2..7a5a5a7f41 100644 --- a/ui/app/styles/components/toolbar.scss +++ b/ui/app/styles/components/toolbar.scss @@ -41,7 +41,6 @@ display: flex; height: 3rem; justify-content: space-between; - overflow-x: auto; width: 100%; @include from($mobile) { diff --git a/ui/lib/core/addon/components/copy-secret-dropdown.hbs b/ui/lib/core/addon/components/copy-secret-dropdown.hbs index af83f660f4..63bd2377dd 100644 --- a/ui/lib/core/addon/components/copy-secret-dropdown.hbs +++ b/ui/lib/core/addon/components/copy-secret-dropdown.hbs @@ -4,7 +4,14 @@ ~}} {{! @onWrap is recommend to be a concurrency task! see in KV addon for example }} - + Copy diff --git a/ui/lib/core/addon/components/search-select.hbs b/ui/lib/core/addon/components/search-select.hbs index e21441aa8b..1d4680c0c6 100644 --- a/ui/lib/core/addon/components/search-select.hbs +++ b/ui/lib/core/addon/components/search-select.hbs @@ -46,6 +46,7 @@ @renderInPlace={{@renderInPlace}} @verticalPosition="below" @disabled={{@disabled}} + @ariaLabel={{or @ariaLabel @label (humanize @id)}} as |option| > {{#if this.shouldRenderName}} diff --git a/ui/lib/core/addon/components/search-select.js b/ui/lib/core/addon/components/search-select.js index adb05d1b25..4ee014b206 100644 --- a/ui/lib/core/addon/components/search-select.js +++ b/ui/lib/core/addon/components/search-select.js @@ -49,6 +49,7 @@ import { addToArray } from 'vault/helpers/add-to-array'; * @param {string} id - The name of the form field * @param {string} [label] - Label for this form field * @param {string} [labelClass] - overwrite default label size (14px) from class="is-label" + * @param {string} [ariaLabel] - fallback accessible label if label is not provided * @param {string} [subText] - Text to be displayed below the label * @param {string} fallbackComponent - name of component to be rendered if the API call 403s * @param {string} [helpText] - Text to be displayed in the info tooltip for this form field @@ -142,7 +143,7 @@ export default class SearchSelect extends Component { } if (!this.args.models) { - if (this.args.options) { + if (Array.isArray(this.args.options)) { const { options } = this.args; // if options are nested, let parent handle formatting - see path-filter-config-list.js this.dropdownOptions = options.some((e) => Object.keys(e).includes('groupName')) diff --git a/ui/lib/kubernetes/addon/components/page/overview.hbs b/ui/lib/kubernetes/addon/components/page/overview.hbs index 0fb2bb0ad2..3e8b87d3e1 100644 --- a/ui/lib/kubernetes/addon/components/page/overview.hbs +++ b/ui/lib/kubernetes/addon/components/page/overview.hbs @@ -32,6 +32,7 @@ @selectLimit="1" @fallbackComponent="input-search" @onChange={{this.selectRole}} + @renderInPlace={{true}} /> + Version {{or @displayVersion "current"}} diff --git a/ui/lib/ldap/addon/components/page/overview.hbs b/ui/lib/ldap/addon/components/page/overview.hbs index 50b6fc714b..5a4adb931e 100644 --- a/ui/lib/ldap/addon/components/page/overview.hbs +++ b/ui/lib/ldap/addon/components/page/overview.hbs @@ -57,15 +57,18 @@ @selectLimit="1" @fallbackComponent="input-search" @onChange={{this.selectRole}} + @renderInPlace={{true}} /> - +
+ +
diff --git a/ui/lib/pki/addon/components/page/pki-issuer-details.hbs b/ui/lib/pki/addon/components/page/pki-issuer-details.hbs index b5aa62a335..48efd0d922 100644 --- a/ui/lib/pki/addon/components/page/pki-issuer-details.hbs +++ b/ui/lib/pki/addon/components/page/pki-issuer-details.hbs @@ -35,15 +35,21 @@ Sign Intermediate {{/if}} - + Download - +