open-vault/ui/lib/pki/addon/components/pki-key-parameters.hbs
claire bontempo 1a40d33c0b
UI: refactor pki role form to reuse PkiKeyParameters component (#18069)
* abstract pki-key-parameters from pki-role-form

* finish refactor, update tests
2022-11-21 14:58:34 -08:00

27 lines
900 B
Handlebars

{{#each @fields as |attr|}}
{{#if (eq attr.name "keyBits")}}
<div class="field">
<FormFieldLabel for={{attr.name}} @label={{attr.options.label}} />
<div class="control is-expanded">
<div class="select is-fullwidth">
<select name={{attr.name}} id={{attr.name}} onchange={{this.onKeyBitsChange}} data-test-input={{attr.name}}>
{{#each this.keyBitOptions as |val|}}
<option selected={{eq (get @model this.valuePath) (or val.value val)}} value={{val}}>
{{val}}
</option>
{{/each}}
</select>
</div>
</div>
</div>
{{else}}
<FormField
data-test-field={{attr}}
@attr={{attr}}
@model={{@model}}
@modelValidations={{@modelValidations}}
@showHelpText={{false}}
@onChange={{this.onSignatureBitsOrKeyTypeChange}}
/>
{{/if}}
{{/each}}