mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-29 17:52:32 +00:00
* initial fix * changelog * fix * fix test and add test coverage * remove useless escape characters * pr comments add more test coverage
47 lines
1.7 KiB
Handlebars
47 lines
1.7 KiB
Handlebars
{{!
|
|
Copyright (c) HashiCorp, Inc.
|
|
SPDX-License-Identifier: BUSL-1.1
|
|
~}}
|
|
|
|
{{#let (find-by "name" "path" @secret.allFields) as |attr|}}
|
|
{{#if (eq @type "edit")}}
|
|
<ReadonlyFormField @attr={{attr}} @value={{get @secret attr.name}} />
|
|
{{else if (eq @type "create")}}
|
|
<FormField @attr={{attr}} @model={{@secret}} @modelValidations={{@modelValidations}} @onKeyUp={{@pathValidations}} />
|
|
{{/if}}
|
|
{{/let}}
|
|
|
|
<hr class="is-marginless has-background-gray-200" />
|
|
{{#if @showJson}}
|
|
<JsonEditor
|
|
@title="{{if (eq @type 'create') 'Secret' 'Version'}} data"
|
|
@value={{this.codeMirrorString}}
|
|
@valueUpdated={{this.handleJson}}
|
|
@readOnly={{eq @type "details"}}
|
|
/>
|
|
{{#if (or @modelValidations.secretData.errors this.lintingErrors)}}
|
|
<AlertInline @type={{if this.lintingErrors "warning" "danger"}} @paddingTop={{true}}>
|
|
{{#if @modelValidations.secretData.errors}}
|
|
{{@modelValidations.secretData.errors}}
|
|
{{else}}
|
|
JSON is unparsable. Fix linting errors to avoid data discrepancies.
|
|
{{/if}}
|
|
</AlertInline>
|
|
{{/if}}
|
|
{{else if (eq @type "details")}}
|
|
{{#each-in @secret.secretData as |key value|}}
|
|
<InfoTableRow @label={{key}} @value={{value}} @alwaysRender={{true}}>
|
|
<MaskedInput @name={{key}} @value={{value}} @displayOnly={{true}} @allowCopy={{true}} @allowDownload={{true}} />
|
|
</InfoTableRow>
|
|
{{else}}
|
|
<InfoTableRow @label="" @value="" @alwaysRender={{true}} />
|
|
{{/each-in}}
|
|
{{else}}
|
|
<KvObjectEditor
|
|
class="has-top-margin-m"
|
|
@label="{{if (eq @type 'create') 'Secret' 'Version'}} data"
|
|
@value={{@secret.secretData}}
|
|
@onChange={{fn (mut @secret.secretData)}}
|
|
@isMasked={{true}}
|
|
/>
|
|
{{/if}} |