Files
vault/ui/lib/core/addon/components/code-snippet.hbs
claire bontempo 42a337410f UI: add copyable paths for CLI and API commands to kv v2 (#22551)
* add paths route

* WIP copy secret path component

* wip component

* ad v1

* use each-in to iterate over info table row

* update copy

* add commands to kv paths page

* add comments

* WIP tests

* finish tests

* remove version, address comments and use path arg directly remove secret

* update copy

* fix typo for perms

* remove destructuring, that was confusing

* add changelog

* add secure protocal
2023-08-25 09:03:46 -07:00

20 lines
532 B
Handlebars

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: BUSL-1.1
~}}
<div data-test-code-snippet class="code-snippet-container" ...attributes>
<code class="text-grey-lightest">
{{@codeBlock}}
</code>
{{! replace with Hds::Copy::Button }}
<CopyButton
class="code-snippet-copy-button"
@clipboardText={{or @clipboardCode @codeBlock}}
@buttonType="button"
@success={{action (set-flash-message "Code copied!")}}
>
Copy
<Icon @name="clipboard-copy" aria-label="Copy" />
</CopyButton>
</div>