2019-04-16 20:27:23 +00:00
{{ # if ( and ( or @ model .isNew @ canEditV2Secret ) @ isV2 ( not @ model .failedServerRead ) ) }}
2018-12-03 14:22:13 +00:00
<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">
2019-03-29 23:40:12 +00:00
Secret metadata
2018-10-16 21:08:31 +00:00
</label>
{{ # each @ model .fields as | attr | }}
<FormField data-test-field @attr= {{ attr }} @model= {{ this .model }} />
{{ / each }}
</div>
{{ / if }}
2019-04-16 20:27:23 +00:00
{{ # if @ showWriteWithoutReadWarning }}
{{ # if ( and @ isV2 @ model .failedServerRead ) }}
<AlertBanner
@type="warning"
@message="Your policies prevent you from reading metadata for this secret and the current version's data. Creating a new version of the secret with this form will not be able to use the check-and-set mechanism. If this is required on the secret, then you will need access to read the secret's metadata."
@class="is-marginless"
data-test-v2-no-cas-warning
/>
{{ else if @ isV2 }}
<AlertBanner
@type="warning"
@message="Your policies prevent you from reading the current secret version. Saving this form will create a new version of the secret and will utilize the available check-and-set mechanism."
@class="is-marginless"
data-test-v2-write-without-read
/>
{{ else }}
<AlertBanner
@type="warning"
@message="Your policies prevent you from reading the current secret data. Saving using this form will overwrite the existing values."
@class="is-marginless"
data-test-v1-write-without-read
/>
{{ / if }}
{{ / 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 }}
2019-03-29 23:40:12 +00:00
Version data
2018-10-17 21:49:11 +00:00
{{ else }}
2019-03-29 23:40:12 +00:00
Secret data
2018-10-17 21:49:11 +00:00
{{ / 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 }}
2019-03-29 23:40:12 +00:00
Version data
2018-10-15 14:40:54 +00:00
{{ else }}
2019-03-29 23:40:12 +00:00
Secret data
2018-10-15 14:40:54 +00:00
{{ / if }}
</label>
2018-10-09 04:22:29 +00:00
{{ # each @ secretData as | secret in dex | }}
<div class="info-table-row">
<div class="column is-one-quarter info-table-row-edit">
{{ in put
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"
2019-05-16 14:54:11 +00:00
spellcheck="false"
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 ( in c in dex ) ) }}
<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"
>
2019-05-13 19:05:25 +00:00
<Icon
@glyph="trash"
2019-05-16 19:49:38 +00:00
@size="l"
class="has-text-grey-light"
2018-10-09 04:22:29 +00:00
/>
</button>
{{ / if }}
</div>
</div>
{{ / each }}
2018-10-15 14:40:54 +00:00
</div>
2018-10-31 17:13:57 +00:00
{{ / if }}