open-vault/ui/app/templates/components/mount-backend-form.hbs
Jordan Reimer 5c2a08de6d
Ember Upgrade to 3.24 (#13443)
* Update browserslist

* Add browserslistrc

* ember-cli-update --to 3.26, fix conflicts

* Run codemodes that start with ember-*

* More codemods - before cp*

* More codemods (curly data-test-*)

* WIP ember-basic-dropdown template errors

* updates ember-basic-dropdown and related deps to fix build issues

* updates basic dropdown instances to new version API

* updates more deps -- ember-template-lint is working again

* runs no-implicit-this codemod

* creates and runs no-quoteless-attributes codemod

* runs angle brackets codemod

* updates lint:hbs globs to only touch hbs files

* removes yield only templates

* creates and runs deprecated args transform

* supresses lint error for invokeAction on LinkTo component

* resolves remaining ambiguous path lint errors

* resolves simple-unless lint errors

* adds warnings for deprecated tagName arg on LinkTo components

* adds warnings for remaining curly component invocation

* updates global template lint rules

* resolves remaining template lint errors

* disables some ember specfic lint rules that target pre octane patterns

* js lint fix run

* resolves remaining js lint errors

* fixes test run

* adds npm-run-all dep

* fixes test attribute issues

* fixes console acceptance tests

* fixes tests

* adds yield only wizard/tutorial-active template

* fixes more tests

* attempts to fix more flaky tests

* removes commented out settled in transit test

* updates deprecations workflow and adds initializer to filter by version

* updates flaky policies acl old test

* updates to flaky transit test

* bumps ember deps down to LTS version

* runs linters after main merge

* fixes client count tests after bad merge conflict fixes

* fixes client count history test

* more updates to lint config

* another round of hbs lint fixes after extending stylistic rule

* updates lint-staged commands

* removes indent eslint rule since it seems to break things

* fixes bad attribute in transform-edit-form template

* test fixes

* fixes enterprise tests

* adds changelog

* removes deprecated ember-concurrency-test-waiters dep and adds @ember/test-waiters

* flaky test fix

Co-authored-by: hashishaw <cshaw@hashicorp.com>
2021-12-16 20:44:29 -07:00

97 lines
3.5 KiB
Handlebars

<PageHeader as |p|>
<p.levelLeft>
<h1 class="title is-3" data-test-mount-form-header="true">
{{#if this.showEnable}}
{{#with (find-by "type" this.mountModel.type this.mountTypes) as |typeInfo|}}
<Icon @name={{or typeInfo.glyph typeInfo.type}} class="has-text-grey-light" />
{{#if (eq this.mountType "auth")}}
{{concat "Enable " typeInfo.displayName " Authentication Method"}}
{{else}}
{{concat "Enable " typeInfo.displayName " Secrets Engine"}}
{{/if}}
{{/with}}
{{else if (eq this.mountType "auth")}}
Enable an Authentication Method
{{else}}
Enable a Secrets Engine
{{/if}}
</h1>
</p.levelLeft>
</PageHeader>
<form {{action (perform this.mountBackend) on="submit"}}>
<div class="box is-sideless is-fullwidth is-marginless">
<NamespaceReminder @mode="enable" @noun={{if (eq this.mountType "auth") "Auth Method" "Secret Engine"}} />
<MessageError @model={{this.model}} @errorMessage={{this.errorMessage}} />
{{#if this.showEnable}}
<FormFieldGroups
@model={{this.mountModel}}
@onChange={{action "onTypeChange"}}
@renderGroup="default"
@validationMessages={{this.validationMessages}}
@onKeyUp={{action "onKeyUp"}}
/>
<FormFieldGroups @model={{this.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 this.mountTypes) as |type|}}
<BoxRadio
@displayName={{type.displayName}}
@type={{type.type}}
@glyph={{or type.glyph type.type}}
@groupValue={{this.mountModel.type}}
@groupName="mount-type"
@onRadioChange={{queue (action (mut this.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 this.showEnable}}
<div class="control">
<button
type="submit"
data-test-mount-submit="true"
class="button is-primary {{if this.mountBackend.isRunning "loading"}}"
disabled={{or this.mountBackend.isRunning this.isFormInvalid}}
>
{{#if (eq this.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 this.mountModel.type}}
>
Next
</button>
{{/if}}
</div>
</form>