mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-03 03:58:01 +00:00
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
This commit is contained in:
@@ -41,7 +41,6 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
height: 3rem;
|
height: 3rem;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
overflow-x: auto;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
@include from($mobile) {
|
@include from($mobile) {
|
||||||
|
|||||||
@@ -4,7 +4,14 @@
|
|||||||
~}}
|
~}}
|
||||||
|
|
||||||
{{! @onWrap is recommend to be a concurrency task! see <Page::Secret::Details> in KV addon for example }}
|
{{! @onWrap is recommend to be a concurrency task! see <Page::Secret::Details> in KV addon for example }}
|
||||||
<BasicDropdown @class="popup-menu" @horizontalPosition="auto-right" @verticalPosition="below" @onClose={{@onClose}} as |D|>
|
<BasicDropdown
|
||||||
|
@class="popup-menu"
|
||||||
|
@horizontalPosition="auto-right"
|
||||||
|
@verticalPosition="below"
|
||||||
|
@onClose={{@onClose}}
|
||||||
|
@renderInPlace={{true}}
|
||||||
|
as |D|
|
||||||
|
>
|
||||||
<D.Trigger data-test-copy-menu-trigger class="toolbar-link {{if D.isOpen 'is-active'}}" @htmlTag="button">
|
<D.Trigger data-test-copy-menu-trigger class="toolbar-link {{if D.isOpen 'is-active'}}" @htmlTag="button">
|
||||||
Copy
|
Copy
|
||||||
<Chevron @direction={{if D.isOpen "up" "down"}} @isButton={{true}} />
|
<Chevron @direction={{if D.isOpen "up" "down"}} @isButton={{true}} />
|
||||||
|
|||||||
@@ -46,6 +46,7 @@
|
|||||||
@renderInPlace={{@renderInPlace}}
|
@renderInPlace={{@renderInPlace}}
|
||||||
@verticalPosition="below"
|
@verticalPosition="below"
|
||||||
@disabled={{@disabled}}
|
@disabled={{@disabled}}
|
||||||
|
@ariaLabel={{or @ariaLabel @label (humanize @id)}}
|
||||||
as |option|
|
as |option|
|
||||||
>
|
>
|
||||||
{{#if this.shouldRenderName}}
|
{{#if this.shouldRenderName}}
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ import { addToArray } from 'vault/helpers/add-to-array';
|
|||||||
* @param {string} id - The name of the form field
|
* @param {string} id - The name of the form field
|
||||||
* @param {string} [label] - Label for this form field
|
* @param {string} [label] - Label for this form field
|
||||||
* @param {string} [labelClass] - overwrite default label size (14px) from class="is-label"
|
* @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} [subText] - Text to be displayed below the label
|
||||||
* @param {string} fallbackComponent - name of component to be rendered if the API call 403s
|
* @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
|
* @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.models) {
|
||||||
if (this.args.options) {
|
if (Array.isArray(this.args.options)) {
|
||||||
const { options } = this.args;
|
const { options } = this.args;
|
||||||
// if options are nested, let parent handle formatting - see path-filter-config-list.js
|
// if options are nested, let parent handle formatting - see path-filter-config-list.js
|
||||||
this.dropdownOptions = options.some((e) => Object.keys(e).includes('groupName'))
|
this.dropdownOptions = options.some((e) => Object.keys(e).includes('groupName'))
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
@selectLimit="1"
|
@selectLimit="1"
|
||||||
@fallbackComponent="input-search"
|
@fallbackComponent="input-search"
|
||||||
@onChange={{this.selectRole}}
|
@onChange={{this.selectRole}}
|
||||||
|
@renderInPlace={{true}}
|
||||||
/>
|
/>
|
||||||
<Hds::Button
|
<Hds::Button
|
||||||
@text="Generate"
|
@text="Generate"
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
SPDX-License-Identifier: BUSL-1.1
|
SPDX-License-Identifier: BUSL-1.1
|
||||||
~}}
|
~}}
|
||||||
|
|
||||||
<BasicDropdown @class="popup-menu" @horizontalPosition="auto-right" @verticalPosition="below" as |D|>
|
<BasicDropdown @class="popup-menu" @horizontalPosition="auto-right" @verticalPosition="below" @renderInPlace={{true}} as |D|>
|
||||||
<D.Trigger data-test-version-dropdown class="toolbar-link {{if D.isOpen ' is-active'}}">
|
<D.Trigger data-test-version-dropdown class="toolbar-link {{if D.isOpen ' is-active'}}">
|
||||||
Version
|
Version
|
||||||
{{or @displayVersion "current"}}
|
{{or @displayVersion "current"}}
|
||||||
|
|||||||
@@ -57,7 +57,9 @@
|
|||||||
@selectLimit="1"
|
@selectLimit="1"
|
||||||
@fallbackComponent="input-search"
|
@fallbackComponent="input-search"
|
||||||
@onChange={{this.selectRole}}
|
@onChange={{this.selectRole}}
|
||||||
|
@renderInPlace={{true}}
|
||||||
/>
|
/>
|
||||||
|
<div>
|
||||||
<Hds::Button
|
<Hds::Button
|
||||||
@text="Get credentials"
|
@text="Get credentials"
|
||||||
@color="secondary"
|
@color="secondary"
|
||||||
@@ -67,6 +69,7 @@
|
|||||||
data-test-generate-credential-button
|
data-test-generate-credential-button
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</OverviewCard>
|
</OverviewCard>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -35,15 +35,21 @@
|
|||||||
Sign Intermediate
|
Sign Intermediate
|
||||||
</ToolbarLink>
|
</ToolbarLink>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<BasicDropdown @class="popup-menu" @horizontalPosition="auto-right" @verticalPosition="below" as |D|>
|
<BasicDropdown
|
||||||
|
@class="popup-menu"
|
||||||
|
@horizontalPosition="auto-right"
|
||||||
|
@verticalPosition="below"
|
||||||
|
@renderInPlace={{true}}
|
||||||
|
as |D|
|
||||||
|
>
|
||||||
<D.Trigger
|
<D.Trigger
|
||||||
data-test-popup-menu-trigger="true"
|
|
||||||
class={{concat "toolbar-link" (if D.isOpen " is-active")}}
|
class={{concat "toolbar-link" (if D.isOpen " is-active")}}
|
||||||
@htmlTag="button"
|
@htmlTag="button"
|
||||||
data-test-issuer-download
|
data-test-issuer-download
|
||||||
|
data-test-popup-menu-trigger
|
||||||
>
|
>
|
||||||
Download
|
Download
|
||||||
<Chevron @direction="down" @isButton={{true}} />
|
<Chevron @direction={{if D.isOpen "up" "down"}} @isButton={{true}} />
|
||||||
</D.Trigger>
|
</D.Trigger>
|
||||||
<D.Content @defaultClass="popup-menu-content">
|
<D.Content @defaultClass="popup-menu-content">
|
||||||
<nav class="box menu" aria-label="snapshots actions">
|
<nav class="box menu" aria-label="snapshots actions">
|
||||||
|
|||||||
@@ -8,7 +8,13 @@
|
|||||||
<ToolbarLink @route="issuers.import" @model={{@backend}} data-test-generate-issuer="import">
|
<ToolbarLink @route="issuers.import" @model={{@backend}} data-test-generate-issuer="import">
|
||||||
Import
|
Import
|
||||||
</ToolbarLink>
|
</ToolbarLink>
|
||||||
<BasicDropdown @class="popup-menu" @horizontalPosition="auto-right" @verticalPosition="below" as |D|>
|
<BasicDropdown
|
||||||
|
@class="popup-menu"
|
||||||
|
@horizontalPosition="auto-right"
|
||||||
|
@verticalPosition="below"
|
||||||
|
@renderInPlace={{true}}
|
||||||
|
as |D|
|
||||||
|
>
|
||||||
<D.Trigger
|
<D.Trigger
|
||||||
class={{concat "toolbar-link" (if D.isOpen " is-active")}}
|
class={{concat "toolbar-link" (if D.isOpen " is-active")}}
|
||||||
@htmlTag="button"
|
@htmlTag="button"
|
||||||
|
|||||||
@@ -33,7 +33,13 @@
|
|||||||
>
|
>
|
||||||
Sign Intermediate
|
Sign Intermediate
|
||||||
</ToolbarLink>
|
</ToolbarLink>
|
||||||
<BasicDropdown @class="popup-menu" @horizontalPosition="auto-right" @verticalPosition="below" as |D|>
|
<BasicDropdown
|
||||||
|
@class="popup-menu"
|
||||||
|
@horizontalPosition="auto-right"
|
||||||
|
@verticalPosition="below"
|
||||||
|
@renderInPlace={{true}}
|
||||||
|
as |D|
|
||||||
|
>
|
||||||
<D.Trigger
|
<D.Trigger
|
||||||
data-test-popup-menu-trigger
|
data-test-popup-menu-trigger
|
||||||
class={{concat "toolbar-link" (if D.isOpen " is-active")}}
|
class={{concat "toolbar-link" (if D.isOpen " is-active")}}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
@disallowNewItems={{true}}
|
@disallowNewItems={{true}}
|
||||||
@onChange={{this.handleRolesInput}}
|
@onChange={{this.handleRolesInput}}
|
||||||
@fallbackComponent="input-search"
|
@fallbackComponent="input-search"
|
||||||
|
@renderInPlace={{true}}
|
||||||
data-test-issue-certificate-input
|
data-test-issue-certificate-input
|
||||||
/>
|
/>
|
||||||
<Hds::Button
|
<Hds::Button
|
||||||
@@ -64,6 +65,7 @@
|
|||||||
@disallowNewItems={{true}}
|
@disallowNewItems={{true}}
|
||||||
@onChange={{this.handleCertificateInput}}
|
@onChange={{this.handleCertificateInput}}
|
||||||
@fallbackComponent="input-search"
|
@fallbackComponent="input-search"
|
||||||
|
@renderInPlace={{true}}
|
||||||
data-test-view-certificate-input
|
data-test-view-certificate-input
|
||||||
/>
|
/>
|
||||||
<Hds::Button
|
<Hds::Button
|
||||||
@@ -89,7 +91,8 @@
|
|||||||
@onChange={{this.handleIssuerSearch}}
|
@onChange={{this.handleIssuerSearch}}
|
||||||
@fallbackComponent="input-search"
|
@fallbackComponent="input-search"
|
||||||
@shouldRenderName={{true}}
|
@shouldRenderName={{true}}
|
||||||
@nameKey={{"issuerName"}}
|
@nameKey="issuerName"
|
||||||
|
@renderInPlace={{true}}
|
||||||
data-test-issue-issuer-input
|
data-test-issue-issuer-input
|
||||||
/>
|
/>
|
||||||
<Hds::Button
|
<Hds::Button
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ import type PkiIssuerModel from 'vault/models/pki/issuer';
|
|||||||
import type PkiRoleModel from 'vault/models/pki/role';
|
import type PkiRoleModel from 'vault/models/pki/role';
|
||||||
|
|
||||||
interface Args {
|
interface Args {
|
||||||
issuers: PkiIssuerModel | number;
|
issuers: PkiIssuerModel[] | number;
|
||||||
roles: PkiRoleModel | number;
|
roles: PkiRoleModel[] | number;
|
||||||
engine: string;
|
engine: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"date-fns": "*",
|
"date-fns": "*",
|
||||||
|
"ember-basic-dropdown": "*",
|
||||||
"ember-cli-babel": "*",
|
"ember-cli-babel": "*",
|
||||||
"ember-cli-htmlbars": "*",
|
"ember-cli-htmlbars": "*",
|
||||||
"ember-cli-typescript": "*",
|
"ember-cli-typescript": "*",
|
||||||
|
|||||||
@@ -89,6 +89,7 @@
|
|||||||
@label="Paths in this {{this.config.mode}}"
|
@label="Paths in this {{this.config.mode}}"
|
||||||
@options={{this.autoCompleteOptions}}
|
@options={{this.autoCompleteOptions}}
|
||||||
@search={{perform this.setAutoCompleteOptions}}
|
@search={{perform this.setAutoCompleteOptions}}
|
||||||
|
@renderInPlace={{true}}
|
||||||
/>
|
/>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if (and (not this.config.mode) this.startedWithMode)}}
|
{{#if (and (not this.config.mode) this.startedWithMode)}}
|
||||||
|
|||||||
@@ -5,10 +5,11 @@
|
|||||||
"ember-engine"
|
"ember-engine"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"ember-auto-import": "*",
|
||||||
"ember-cli-htmlbars": "*",
|
"ember-cli-htmlbars": "*",
|
||||||
"ember-cli-babel": "*",
|
"ember-cli-babel": "*",
|
||||||
"@hashicorp/design-system-components": "*",
|
"ember-concurrency": "*",
|
||||||
"ember-auto-import": "*"
|
"@hashicorp/design-system-components": "*"
|
||||||
},
|
},
|
||||||
"ember-addon": {
|
"ember-addon": {
|
||||||
"paths": [
|
"paths": [
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
@placeholder="Filter by type"
|
@placeholder="Filter by type"
|
||||||
@inputValue={{if this.typeFilterName (array this.typeFilterName)}}
|
@inputValue={{if this.typeFilterName (array this.typeFilterName)}}
|
||||||
@onChange={{fn this.onFilterChange "type"}}
|
@onChange={{fn this.onFilterChange "type"}}
|
||||||
|
@renderInPlace={{true}}
|
||||||
class="is-marginless"
|
class="is-marginless"
|
||||||
data-test-filter="type"
|
data-test-filter="type"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -53,6 +53,7 @@
|
|||||||
@selectLimit={{1}}
|
@selectLimit={{1}}
|
||||||
@disallowNewItems={{true}}
|
@disallowNewItems={{true}}
|
||||||
@onChange={{this.setMount}}
|
@onChange={{this.setMount}}
|
||||||
|
@renderInPlace={{true}}
|
||||||
data-test-sync-mount-select
|
data-test-sync-mount-select
|
||||||
/>
|
/>
|
||||||
{{else}}
|
{{else}}
|
||||||
|
|||||||
Reference in New Issue
Block a user