open-vault/ui/lib/pki/addon/components/page/pki-key-details.hbs
claire bontempo 04396e5f9c
UI/pki key workflow tests (#18496)
* wip tests

* fix links

* Revert "wip tests"

This reverts commit aed9bb9b8fffb1b4d52d9c27644033ff3d983fff.

* wip tests

* add policy generator

* add workflow tests for key

* change apostrophe -___-

* fix workflow tests

* add update to key form tests

* fix capability check for read

* finish tests

* fix flash messages;

* rename policy generator file, update tests
2023-01-03 18:00:29 -08:00

55 lines
1.6 KiB
Handlebars

<Toolbar>
<ToolbarActions>
{{#if @canDelete}}
<ConfirmAction
@buttonClasses="toolbar-link"
@onConfirmAction={{this.deleteKey}}
@confirmTitle="Delete key?"
@confirmButtonText="Delete"
data-test-pki-key-delete
>
Delete
</ConfirmAction>
<div class="toolbar-separator"></div>
{{/if}}
{{#if @key.privateKey}}
<DownloadButton
class="toolbar-link"
@filename="{{@key.backend}}-{{or @key.keyName 'private-key'}}"
@data={{@key.privateKey}}
@extension="pem"
>
Download private key
<Chevron @isButton={{true}} />
</DownloadButton>
{{/if}}
{{#if @canEdit}}
<ToolbarLink @route="keys.key.edit" @model={{@key.keyId}} data-test-pki-key-edit>
Edit key
</ToolbarLink>
{{/if}}
</ToolbarActions>
</Toolbar>
<div class="box is-fullwidth is-sideless is-paddingless is-marginless">
{{#if @key.privateKey}}
<div class="has-top-margin-m">
<AlertBanner
@title="Next steps"
@type="warning"
@message="This private key material will only be available once. Copy or download it now."
/>
</div>
{{/if}}
{{#each @key.formFields as |attr|}}
<InfoTableRow
@label={{capitalize (or attr.options.detailsLabel attr.options.label (humanize (dasherize attr.name)))}}
@value={{get @key attr.name}}
/>
{{/each}}
{{#if @key.privateKey}}
<InfoTableRow @label="Private key">
<MaskedInput @value={{@key.privateKey}} @name="Private key" @displayOnly={{true}} @allowCopy={{true}} />
</InfoTableRow>
{{/if}}
</div>