Files
threshold-ui/ui/desktop/app/components/credentials-panel/index.hbs
T
Kristin BradleyandDharini Jeeva 77f8235ebf Replace Rose::CodeEditor with Hds::CodeBlock within Desktop client (HDS-2827) (#2020)
* HDS-2827 Replace Rose::CodeEditor with Hds::CodeBlock on Create New Worker page

* HDS-2827 Replace Rose::CodeEditor with Hds::CodeBlock in credentials panel

* HDS-2827 Remove un-needed getters, fix formatting errors

* HDS-2827 Revert instances of Hds::CodeBlock added to create workers page

* HDS-2827 Fix failing test

* Apply suggestions from code review

* HDS-2827 Delete old unused css

* HDS-2827 Delete old css

---------

Co-authored-by: Dharini Jeeva <dharini@hashicorp.com>
2023-12-08 12:03:47 -05:00

74 lines
2.0 KiB
Handlebars

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
}}
<div class='credential-panel-header'>
<div class='title hds-typography-display-400'>
{{t 'resources.session.credential.title_plural'}}
</div>
<Hds::Form::Toggle::Field
data-test-toggle-credentials
@value={{this.isRawApiVisible}}
{{on 'change' this.toggleCredentials}}
as |F|
>
<F.Label>
{{t 'resources.session.credential.actions.raw-api.show'}}
</F.Label>
</Hds::Form::Toggle::Field>
</div>
<div class='hds-typography-body-200'>
{{t 'resources.session.credential.description'}}
</div>
{{#each @credentials as |credential|}}
{{#if this.isRawApiVisible}}
<div class='raw-credential-panel-body'>
<Hds::CodeBlock
@language='json'
@value={{raw-json credential.rawCredential}}
@hasLineNumbers={{false}}
@hasCopyButton={{true}}
data-test-raw-secret
as |CB|
>
<CB.Title>
{{#if credential.source.name}}
{{credential.source.name}}
{{else}}
{{credential.source.id}}
{{/if}}
</CB.Title>
<CB.Description>
{{credential.source.description}}
</CB.Description>
</Hds::CodeBlock>
</div>
{{else}}
<div class='credential-panel-body'>
<div class='credential-header'>
<div class='credential-name hds-typography-display-200'>
{{#if credential.source.name}}
{{credential.source.name}}
{{else}}
{{credential.source.id}}
{{/if}}
</div>
<div class='hds-typography-body-100'>
{{credential.source.description}}
</div>
</div>
<ul class='credential-secret'>
{{#if credential.secrets}}
{{#each credential.secrets as |secret|}}
<li class='secret-container'>
<span class='secret-key'>{{secret.key}}</span>
<HiddenSecret @secret={{secret.value}} />
</li>
{{/each}}
{{/if}}
</ul>
</div>
{{/if}}
{{/each}}