open-vault/ui/app/templates/partials/secret-form-create.hbs
Matthew Irish 1429bacf60
UI - KV capabilities fix (#4343)
* fix capability lookup for kv backends

* remove list capabilities call and gating UI parts on capabilities.canCreate

* remove capabilities on create and update tests

* run dev server with no colors and use readline to log stdout stream

* fix + skip lease tests

* remove space on mounts list
2018-04-16 17:18:46 -05:00

57 lines
1.8 KiB
Handlebars

{{message-error model=key}}
<form class="{{if showAdvancedMode 'advanced-edit' 'simple-edit'}}" onsubmit={{action "createOrUpdateKey" "create"}} onchange={{action "handleChange"}}>
<div class="field box is-fullwidth is-sideless is-marginless">
<label class="label is-font-weight-normal" for="kv-key">Path for this secret</label>
<div class="field has-addons">
{{#if (not-eq key.initialParentKey '') }}
{{! need this to prevent a shift in the layout before we transition when saving }}
{{#if key.isCreating}}
<p class="control is-no-flex-grow">
<button type="button" class="button is-static has-background-grey-lighter has-text-grey has-default-border">
{{key.initialParentKey}}
</button>
</p>
{{else}}
<p class="control is-no-flex-grow">
<button type="button" class="button is-static">
{{key.parentKey}}
</button>
</p>
{{/if}}
{{/if}}
<p class="control is-expanded">
{{input data-test-secret-path=true id="kv-key" class="input" value=key.keyWithoutParent}}
</p>
</div>
{{#if key.isFolder}}
<p class="help is-danger">
The secret path may not end in <code>/</code>
</p>
{{/if}}
</div>
{{partial "partials/secret-edit-display"}}
<div class="field is-grouped box is-fullwidth is-bottomless">
<div class="control">
<button
type="submit"
disabled={{buttonDisabled}}
class="button is-primary"
data-test-secret-save=true
>
Save
</button>
</div>
<div class="control">
{{#secret-link
mode="list"
secret=key.initialParentKey
class="button"
}}
Cancel
{{/secret-link}}
</div>
</div>
</form>