open-vault/ui/lib/pki/addon/components/pki-role-form.hbs

110 lines
4.2 KiB
Handlebars
Raw Normal View History

<form {{on "submit" (perform this.save)}}>
<div class="box is-sideless is-fullwidth is-marginless">
<MessageError @errorMessage={{this.errorBanner}} class="has-top-margin-s" />
{{! ARG TODO write a test for namespace reminder }}
<NamespaceReminder @mode={{if @model.isNew "create" "update"}} @noun="PKI role" />
2022-12-06 20:34:43 +00:00
{{#each @model.formFieldGroups as |fieldGroup|}}
PKI role non-default options (#17393) * dynamically render the secretlistheader in the parent route. * start getting form setup even without openAPi working * add in create and cancel * making openAPI work * add default openAPI params * wip for new component with two radio options a ttl and input * handle createRecord on pki-roles-form * remove tooltips and cleanup * move formfieldgroupsloop back to non addon * cleanup * move secretListHeader * broadcast from radioSelectTtlOrString to parent * cleanup * hide tooltips * pass through sub text to stringArray * Add conditional for keybits and keyType * set defaults for keyBits ... 🤮 * fix some small issues * more info form field typ * show only label and subText * wip context switch 🤮 * fix dontShowLabel * getting css grid setup * more on flex groups * adding the second chunk to key usage * serialize the post for key_usage * finish for ext_key_usage * clean up * fix snack_case issue * commit for working state, next trying to remove form-field-group-loops because it's causing issues. * remove usage of formfieldgroupsloop because of issues with css grid and conditionals * clean up * remove string-list helpText changes for tooltip removal because that should be it's own pr. * clarification from design and backend. * small cleanup * pull key_usage and ext_key_usage out of the model and into a component * clean up * clean up * restructure css grid: * clean up * broke some things * fix error when roles list returned 404 * claires feedback * cleanup * clean up
2022-10-12 18:56:05 +00:00
{{#each-in fieldGroup as |group fields|}}
{{! DEFAULT VIEW }}
{{#if (eq group "default")}}
{{#each fields as |attr|}}
<FormField
data-test-field={{attr}}
PKI role non-default options (#17393) * dynamically render the secretlistheader in the parent route. * start getting form setup even without openAPi working * add in create and cancel * making openAPI work * add default openAPI params * wip for new component with two radio options a ttl and input * handle createRecord on pki-roles-form * remove tooltips and cleanup * move formfieldgroupsloop back to non addon * cleanup * move secretListHeader * broadcast from radioSelectTtlOrString to parent * cleanup * hide tooltips * pass through sub text to stringArray * Add conditional for keybits and keyType * set defaults for keyBits ... 🤮 * fix some small issues * more info form field typ * show only label and subText * wip context switch 🤮 * fix dontShowLabel * getting css grid setup * more on flex groups * adding the second chunk to key usage * serialize the post for key_usage * finish for ext_key_usage * clean up * fix snack_case issue * commit for working state, next trying to remove form-field-group-loops because it's causing issues. * remove usage of formfieldgroupsloop because of issues with css grid and conditionals * clean up * remove string-list helpText changes for tooltip removal because that should be it's own pr. * clarification from design and backend. * small cleanup * pull key_usage and ext_key_usage out of the model and into a component * clean up * clean up * restructure css grid: * clean up * broke some things * fix error when roles list returned 404 * claires feedback * cleanup * clean up
2022-10-12 18:56:05 +00:00
@attr={{attr}}
@model={{@model}}
@modelValidations={{this.modelValidations}}
@showHelpText={{false}}
>
2022-12-02 16:42:14 +00:00
<PkiNotValidAfterForm @attr={{attr}} @model={{@model}} />
PKI role non-default options (#17393) * dynamically render the secretlistheader in the parent route. * start getting form setup even without openAPi working * add in create and cancel * making openAPI work * add default openAPI params * wip for new component with two radio options a ttl and input * handle createRecord on pki-roles-form * remove tooltips and cleanup * move formfieldgroupsloop back to non addon * cleanup * move secretListHeader * broadcast from radioSelectTtlOrString to parent * cleanup * hide tooltips * pass through sub text to stringArray * Add conditional for keybits and keyType * set defaults for keyBits ... 🤮 * fix some small issues * more info form field typ * show only label and subText * wip context switch 🤮 * fix dontShowLabel * getting css grid setup * more on flex groups * adding the second chunk to key usage * serialize the post for key_usage * finish for ext_key_usage * clean up * fix snack_case issue * commit for working state, next trying to remove form-field-group-loops because it's causing issues. * remove usage of formfieldgroupsloop because of issues with css grid and conditionals * clean up * remove string-list helpText changes for tooltip removal because that should be it's own pr. * clarification from design and backend. * small cleanup * pull key_usage and ext_key_usage out of the model and into a component * clean up * clean up * restructure css grid: * clean up * broke some things * fix error when roles list returned 404 * claires feedback * cleanup * clean up
2022-10-12 18:56:05 +00:00
</FormField>
{{/each}}
{{else}}
{{#let (camelize (concat "show" group)) as |prop|}}
<ToggleButton
@isOpen={{get @model prop}}
@openLabel={{concat "Hide " group}}
@closedLabel={{group}}
@onClick={{fn (mut (get @model prop))}}
class="is-block"
data-test-toggle-group={{group}}
/>
{{#if (get @model prop)}}
<div class="box is-tall is-marginless" data-test-toggle-div={{group}}>
{{#let (get @model.fieldGroupsInfo group) as |toggleGroup|}}
{{! HEADER }}
{{#if toggleGroup.header}}
PKI role non-default options (#17393) * dynamically render the secretlistheader in the parent route. * start getting form setup even without openAPi working * add in create and cancel * making openAPI work * add default openAPI params * wip for new component with two radio options a ttl and input * handle createRecord on pki-roles-form * remove tooltips and cleanup * move formfieldgroupsloop back to non addon * cleanup * move secretListHeader * broadcast from radioSelectTtlOrString to parent * cleanup * hide tooltips * pass through sub text to stringArray * Add conditional for keybits and keyType * set defaults for keyBits ... 🤮 * fix some small issues * more info form field typ * show only label and subText * wip context switch 🤮 * fix dontShowLabel * getting css grid setup * more on flex groups * adding the second chunk to key usage * serialize the post for key_usage * finish for ext_key_usage * clean up * fix snack_case issue * commit for working state, next trying to remove form-field-group-loops because it's causing issues. * remove usage of formfieldgroupsloop because of issues with css grid and conditionals * clean up * remove string-list helpText changes for tooltip removal because that should be it's own pr. * clarification from design and backend. * small cleanup * pull key_usage and ext_key_usage out of the model and into a component * clean up * clean up * restructure css grid: * clean up * broke some things * fix error when roles list returned 404 * claires feedback * cleanup * clean up
2022-10-12 18:56:05 +00:00
<div class="has-bottom-margin-s">
<FormFieldLabel
for={{toggleGroup.header.name}}
@label={{toggleGroup.header.label}}
@subText={{toggleGroup.header.text}}
@docLink={{toggleGroup.header.docLink}}
PKI role non-default options (#17393) * dynamically render the secretlistheader in the parent route. * start getting form setup even without openAPi working * add in create and cancel * making openAPI work * add default openAPI params * wip for new component with two radio options a ttl and input * handle createRecord on pki-roles-form * remove tooltips and cleanup * move formfieldgroupsloop back to non addon * cleanup * move secretListHeader * broadcast from radioSelectTtlOrString to parent * cleanup * hide tooltips * pass through sub text to stringArray * Add conditional for keybits and keyType * set defaults for keyBits ... 🤮 * fix some small issues * more info form field typ * show only label and subText * wip context switch 🤮 * fix dontShowLabel * getting css grid setup * more on flex groups * adding the second chunk to key usage * serialize the post for key_usage * finish for ext_key_usage * clean up * fix snack_case issue * commit for working state, next trying to remove form-field-group-loops because it's causing issues. * remove usage of formfieldgroupsloop because of issues with css grid and conditionals * clean up * remove string-list helpText changes for tooltip removal because that should be it's own pr. * clarification from design and backend. * small cleanup * pull key_usage and ext_key_usage out of the model and into a component * clean up * clean up * restructure css grid: * clean up * broke some things * fix error when roles list returned 404 * claires feedback * cleanup * clean up
2022-10-12 18:56:05 +00:00
/>
</div>
{{/if}}
{{! FIELDS }}
{{#if (eq group "Key usage")}}
<PkiKeyUsage @model={{@model}} />
{{else if (eq group "Key parameters")}}
<PkiKeyParameters @model={{@model}} @fields={{fields}} />
{{else}}
{{#each fields as |attr|}}
<FormField
data-test-field={{true}}
@attr={{attr}}
@model={{@model}}
@modelValidations={{@modelValidations}}
@showHelpText={{false}}
>
{{yield attr}}
</FormField>
{{/each}}
{{/if}}
{{! FOOTER }}
{{#if toggleGroup.footer}}
PKI role non-default options (#17393) * dynamically render the secretlistheader in the parent route. * start getting form setup even without openAPi working * add in create and cancel * making openAPI work * add default openAPI params * wip for new component with two radio options a ttl and input * handle createRecord on pki-roles-form * remove tooltips and cleanup * move formfieldgroupsloop back to non addon * cleanup * move secretListHeader * broadcast from radioSelectTtlOrString to parent * cleanup * hide tooltips * pass through sub text to stringArray * Add conditional for keybits and keyType * set defaults for keyBits ... 🤮 * fix some small issues * more info form field typ * show only label and subText * wip context switch 🤮 * fix dontShowLabel * getting css grid setup * more on flex groups * adding the second chunk to key usage * serialize the post for key_usage * finish for ext_key_usage * clean up * fix snack_case issue * commit for working state, next trying to remove form-field-group-loops because it's causing issues. * remove usage of formfieldgroupsloop because of issues with css grid and conditionals * clean up * remove string-list helpText changes for tooltip removal because that should be it's own pr. * clarification from design and backend. * small cleanup * pull key_usage and ext_key_usage out of the model and into a component * clean up * clean up * restructure css grid: * clean up * broke some things * fix error when roles list returned 404 * claires feedback * cleanup * clean up
2022-10-12 18:56:05 +00:00
<p class="sub-text">
<Icon @name="info" />
{{toggleGroup.footer.text}}
{{#if toggleGroup.footer.docLink}}
<DocLink @path={{toggleGroup.footer.docLink}}>
{{toggleGroup.footer.docText}}
PKI role non-default options (#17393) * dynamically render the secretlistheader in the parent route. * start getting form setup even without openAPi working * add in create and cancel * making openAPI work * add default openAPI params * wip for new component with two radio options a ttl and input * handle createRecord on pki-roles-form * remove tooltips and cleanup * move formfieldgroupsloop back to non addon * cleanup * move secretListHeader * broadcast from radioSelectTtlOrString to parent * cleanup * hide tooltips * pass through sub text to stringArray * Add conditional for keybits and keyType * set defaults for keyBits ... 🤮 * fix some small issues * more info form field typ * show only label and subText * wip context switch 🤮 * fix dontShowLabel * getting css grid setup * more on flex groups * adding the second chunk to key usage * serialize the post for key_usage * finish for ext_key_usage * clean up * fix snack_case issue * commit for working state, next trying to remove form-field-group-loops because it's causing issues. * remove usage of formfieldgroupsloop because of issues with css grid and conditionals * clean up * remove string-list helpText changes for tooltip removal because that should be it's own pr. * clarification from design and backend. * small cleanup * pull key_usage and ext_key_usage out of the model and into a component * clean up * clean up * restructure css grid: * clean up * broke some things * fix error when roles list returned 404 * claires feedback * cleanup * clean up
2022-10-12 18:56:05 +00:00
</DocLink>
{{/if}}
</p>
{{/if}}
{{/let}}
</div>
{{/if}}
{{/let}}
{{/if}}
{{/each-in}}
{{/each}}
</div>
<div class="has-top-padding-s">
<button
type="submit"
class="button is-primary {{if this.save.isRunning 'is-loading'}}"
disabled={{this.save.isRunning}}
data-test-pki-role-save
>
{{if @model.isNew "Create" "Update"}}
</button>
<button
type="button"
class="button has-left-margin-s"
disabled={{this.save.isRunning}}
{{on "click" this.cancel}}
data-test-pki-role-cancel
>
Cancel
</button>
{{#if this.modelValidations.targets.errors}}
<AlertInline @type="danger" @message={{join ", " this.modelValidations.targets.errors}} @paddingTop={{true}} />
{{/if}}
{{#if this.invalidFormAlert}}
<div class="control">
<AlertInline @type="danger" @paddingTop={{true}} @message={{this.invalidFormAlert}} @mimicRefresh={{true}} />
</div>
{{/if}}
</div>
</form>