2018-12-03 14:22:13 +00:00
|
|
|
{{#if (and (or @model.isNew @canEditV2Secret) @isV2 (not @model.isStub))}}
|
|
|
|
<div data-test-metadata-fields class="form-section box is-shadowless is-fullwidth">
|
2018-10-16 21:08:31 +00:00
|
|
|
<label class="title is-5">
|
|
|
|
Secret Metadata
|
|
|
|
</label>
|
|
|
|
{{#each @model.fields as |attr|}}
|
|
|
|
<FormField data-test-field @attr={{attr}} @model={{this.model}} />
|
|
|
|
{{/each}}
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
|
2018-10-09 04:22:29 +00:00
|
|
|
{{#if @showAdvancedMode}}
|
2018-10-17 21:49:11 +00:00
|
|
|
<div class="form-section">
|
|
|
|
<label class="title is-5">
|
|
|
|
{{#if isV2}}
|
|
|
|
Version Data
|
|
|
|
{{else}}
|
|
|
|
Secret Data
|
|
|
|
{{/if}}
|
|
|
|
</label>
|
|
|
|
<JsonEditor
|
|
|
|
@value={{@codemirrorString}}
|
|
|
|
@valueUpdated={{@editActions.codemirrorUpdated}}
|
|
|
|
@onFocusOut={{@editActions.formatJSON}}
|
|
|
|
/>
|
|
|
|
</div>
|
2018-10-09 04:22:29 +00:00
|
|
|
{{else}}
|
2018-10-15 14:40:54 +00:00
|
|
|
<div class="form-section">
|
|
|
|
<label class="title is-5">
|
|
|
|
{{#if isV2}}
|
|
|
|
Version Data
|
|
|
|
{{else}}
|
|
|
|
Secret Data
|
|
|
|
{{/if}}
|
|
|
|
</label>
|
2018-10-09 04:22:29 +00:00
|
|
|
{{#each @secretData as |secret index|}}
|
|
|
|
<div class="info-table-row">
|
|
|
|
<div class="column is-one-quarter info-table-row-edit">
|
|
|
|
{{input
|
|
|
|
data-test-secret-key=true
|
|
|
|
value=secret.name
|
|
|
|
placeholder="key"
|
2018-10-15 14:40:18 +00:00
|
|
|
change=(action @editActions.handleChange)
|
2018-10-09 04:22:29 +00:00
|
|
|
class="input"
|
2018-10-17 02:42:29 +00:00
|
|
|
autocomplete="off"
|
2018-10-09 04:22:29 +00:00
|
|
|
}}
|
|
|
|
</div>
|
|
|
|
<div class="column info-table-row-edit">
|
|
|
|
<MaskedInput
|
|
|
|
@name={{secret.name}}
|
|
|
|
@onKeyDown={{@editActions.handleKeyDown}}
|
|
|
|
@onChange={{@editActions.handleChange}}
|
|
|
|
@value={{secret.value}}
|
|
|
|
data-test-secret-value="true"
|
2018-10-31 17:13:57 +00:00
|
|
|
/>
|
2018-10-09 04:22:29 +00:00
|
|
|
</div>
|
|
|
|
<div class="column is-narrow info-table-row-edit">
|
|
|
|
{{#if (eq @secretData.length (inc index))}}
|
|
|
|
<button type="button" {{action @editActions.addRow}} class="button is-outlined is-primary" data-test-secret-add-row="true">
|
|
|
|
Add
|
|
|
|
</button>
|
|
|
|
{{else}}
|
|
|
|
<button
|
|
|
|
class="button has-text-grey is-expanded is-icon"
|
|
|
|
type="button"
|
|
|
|
{{action @editActions.deleteRow secret.name}}
|
|
|
|
aria-label="Delete row"
|
|
|
|
>
|
2018-10-31 17:13:57 +00:00
|
|
|
<ICon
|
2018-10-09 04:22:29 +00:00
|
|
|
@size="22"
|
|
|
|
@glyph="trash-a"
|
|
|
|
@excludeIconClass={{true}}
|
|
|
|
class="is-large has-text-grey-light"
|
|
|
|
/>
|
|
|
|
</button>
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{/each}}
|
2018-10-15 14:40:54 +00:00
|
|
|
</div>
|
2018-10-31 17:13:57 +00:00
|
|
|
{{/if}}
|