open-vault/ui/app/templates/components/mount-backend-form.hbs
Jordan Reimer c1df15e790
Incorporate Ember Flight Icons (#12976)
* adds ember-flight-icons dependecy

* adds inline-json-import babel plugin

* adds flight icon styling

* updates Icon component to support flight icons

* updates Icon component usages to new api and updates name values to flight icon set when available

* fixes tests

* updates icon story with flight mappings and fixes issue with flight icons not rendering in storybook

* adds changelog

* fixes typo in sign action glyph name in transit-key model

* adds comments to icon-map

* updates Icon component to use only supported flight icon sizes

* adds icon transform codemod

* updates icon transform formatting to handle edge case

* runs icon transform on templates

* updates Icon usage in toolbar-filter md and story

* updates tests
2021-12-07 10:05:14 -07:00

102 lines
3.5 KiB
Handlebars

<PageHeader as |p|>
<p.levelLeft>
<h1 class="title is-3" data-test-mount-form-header="true">
{{#if showEnable}}
{{#with (find-by "type" mountModel.type mountTypes) as |typeInfo|}}
<Icon
@name={{or typeInfo.glyph typeInfo.type}}
class="has-text-grey-light"
/>
{{#if (eq mountType "auth")}}
{{concat "Enable " typeInfo.displayName " Authentication Method"}}
{{else}}
{{concat "Enable " typeInfo.displayName " Secrets Engine"}}
{{/if}}
{{/with}}
{{else if (eq mountType "auth")}}
Enable an Authentication Method
{{else}}
Enable a Secrets Engine
{{/if}}
</h1>
</p.levelLeft>
</PageHeader>
<form {{action (perform mountBackend) on="submit"}}>
<div class="box is-sideless is-fullwidth is-marginless">
<NamespaceReminder
@mode="enable"
@noun={{if (eq mountType "auth") "Auth Method" "Secret Engine"}}
/>
<MessageError @model={{model}} @errorMessage={{this.errorMessage}} />
{{#if showEnable}}
<FormFieldGroups @model={{mountModel}} @onChange={{action "onTypeChange"}} @renderGroup="default" @validationMessages={{validationMessages}} @onKeyUp={{action "onKeyUp"}} />
<FormFieldGroups @model={{mountModel}} @onChange={{action "onTypeChange"}} @renderGroup="Method Options" />
{{else}}
{{#each (array "generic" "cloud" "infra") as |category|}}
<h3 class="title box-radio-header">
{{capitalize category}}
</h3>
<div class="box-radio-container">
{{#each (filter-by "category" category mountTypes) as |type|}}
<BoxRadio
@displayName={{type.displayName}}
@type={{type.type}}
@glyph={{or type.glyph type.type}}
@groupValue={{mountModel.type}}
@groupName="mount-type"
@onRadioChange={{queue
(action (mut mountModel.type))
(action "onTypeChange" "type")
}}
@disabled={{if type.requiredFeature (not (has-feature type.requiredFeature)) false}}
@tooltipMessage={{if (or (eq type.type 'transform') (eq type.type 'kmip'))
(concat type.displayName " is part of the Advanced Data Protection module, which is not included in your enterprise license.")
'This secret engine is not included in your license.'
}}
/>
{{/each}}
</div>
{{/each}}
{{/if}}
</div>
<div class="field is-grouped box is-fullwidth is-bottomless">
{{#if showEnable}}
<div class="control">
<button
type="submit"
data-test-mount-submit="true"
class="button is-primary {{if mountBackend.isRunning "loading"}}"
disabled={{or mountBackend.isRunning isFormInvalid}}
>
{{#if (eq mountType "auth")}}
Enable Method
{{else}}
Enable Engine
{{/if}}
</button>
</div>
<div class="control">
<button
data-test-mount-back
type="button"
class="button"
onclick={{action "toggleShowEnable" false}}
>
Back
</button>
</div>
{{else}}
<button
data-test-mount-next
type="button"
class="button is-primary"
onclick={{action "toggleShowEnable" true}}
disabled={{not mountModel.type}}
>
Next
</button>
{{/if}}
</div>
</form>