open-vault/ui/app/templates/components/secret-form-show.hbs
Jordan Reimer c1df15e790
Incorporate Ember Flight Icons (#12976)
* adds ember-flight-icons dependecy

* adds inline-json-import babel plugin

* adds flight icon styling

* updates Icon component to support flight icons

* updates Icon component usages to new api and updates name values to flight icon set when available

* fixes tests

* updates icon story with flight mappings and fixes issue with flight icons not rendering in storybook

* adds changelog

* fixes typo in sign action glyph name in transit-key model

* adds comments to icon-map

* updates Icon component to use only supported flight icon sizes

* adds icon transform codemod

* updates icon transform formatting to handle edge case

* runs icon transform on templates

* updates Icon usage in toolbar-filter md and story

* updates tests
2021-12-07 10:05:14 -07:00

82 lines
3 KiB
Handlebars

{{#if (and @isV2 @modelForData.destroyed)}}
<EmptyState
@title="Version {{@modelForData.version}} of this secret has been permanently destroyed"
@message="A version that has been permanently deleted cannot be restored. You can see other versions of this secret in the History menu."
>
<DocLink @path="/docs/secrets/kv/kv-v2.html">
Learn more
</DocLink>
</EmptyState>
{{else if (and @isV2 @modelForData.deleted)}}
<EmptyState
@title="Version {{@modelForData.version}} of this secret has been deleted"
@message="A version that has been deleted but can be undeleted using the Version {{@modelForData.version}} menu above.
You can also see other versions of this secret in the History menu."
>
<DocLink @path="/docs/secrets/kv/kv-v2.html">
Learn more
</DocLink>
</EmptyState>
{{else if @isWriteWithoutRead}}
<EmptyState
data-test-write-without-read-empty-message
@title="You do not have permission to read this secret."
@message={{if @isV2
"Your policies permit you to write a new version of this secret, but do not allow you to read its current contents."
"Your policies permit you to overwrite this secret, but do not allow you to read it."
}}
>
</EmptyState>
{{else}}
{{#if @showAdvancedMode}}
<div class="has-top-margin-s">
<JsonEditor
@title={{if @isV2 "Version Data" "Secret Data"}}
@value={{@modelForData.dataAsJSONString}}
@options={{hash
readOnly=true
}}
/>
</div>
{{else}}
<div class="table info-table-row-header">
<div class="info-table-row thead">
<div class="th column is-one-quarter">
Key
</div>
<div class="th column">
Value
</div>
<div class="th column justify-right" data-test-created-time>
<ToolTip @verticalPosition="above" @horizontalPosition="center" as |T|>
<T.trigger data-test-tooltip-trigger tabindex="-1" data-test-created-time>
Version created {{date-format @modelForData.createdTime 'MMM dd, yyyy hh:mm a'}}
</T.trigger>
<T.content @class="tool-tip smaller-font">
<div class="box" data-test-hover-copy-tooltip-text>
{{@modelForData.createdTime}}
</div>
</T.content>
</ToolTip>
</div>
</div>
</div>
{{#if @modelForData.secretKeyAndValue}}
{{#each @modelForData.secretKeyAndValue as |secret|}}
<InfoTableRow @label={{secret.key}} @value={{secret.value}} @alwaysRender={{true}}>
{{#if secret.value}}
<MaskedInput @value={{secret.value}} @displayOnly={{true}} @allowCopy={{true}}/>
{{else}}
<Icon @name="minus" />
{{/if}}
</InfoTableRow>
{{/each}}
{{else}}
{{!-- In the case of no key or value <InfoTableRow> will still render --}}
<InfoTableRow @label="" @value="" @alwaysRender={{true}}>
<Icon @name="minus" />
</InfoTableRow>
{{/if}}
{{/if}}
{{/if}}