Skip to content

Commit

Permalink
rename copy-button
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-hut committed Oct 16, 2023
1 parent b692379 commit 1a1b951
Show file tree
Hide file tree
Showing 22 changed files with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ as |item index|>
{{else}}
<span>
{{item.ID}}
<CopyButton
<ConsulCopyButton
@value={{item.ID}}
@name="ID"
/>
Expand All @@ -28,7 +28,7 @@ as |item index|>
ID
</dt>
<dd>
<CopyButton
<ConsulCopyButton
@value={{item.ID}}
@name="ID"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<div
class="hds-typography-display-300 text-hds-foreground-strong hds-font-weight-semibold"
>{{address}}</div>
<CopyButton
<ConsulCopyButton
@value={{address}}
@name="Address"
class="opacity-0 group-hover:opacity-100"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ A code-editor with syntax highlighting supporting multiple languages (JSON, HCL,
| Name | Description | Behaviour if empty |
| --- | --- | --- |
| `:label` | Used to define the title that's displayed on the left inside the toolbar above the CodeEditor | Nothing is displayed |
| `:tools` | Used to define tools, buttons, widgets that will be displayed on the right inside the toolbar above the CodeEditor | By default it renders a `language selector` dropdown (if `readonly`== false and `syntax` is falsy) and a `CopyButton`
| `:tools` | Used to define tools, buttons, widgets that will be displayed on the right inside the toolbar above the CodeEditor | By default it renders a `language selector` dropdown (if `readonly`== false and `syntax` is falsy) and a `ConsulCopyButton`
| `:content` | Used to display specific content such as code templates inside the CodeEditor | if the block is defined, @value will be displayed instead |


Expand Down
2 changes: 1 addition & 1 deletion ui/packages/consul-ui/app/components/code-editor/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{{mode.name}}
</PowerSelect>
<div class="toolbar-separator"></div>
<CopyButton
<ConsulCopyButton
@value={{value}}
@name="value"
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CopyButton
# ConsulCopyButton

Button component used for copy-to-clipboard functionality so the user can easily copy specified text to their clipboard, along with tooltip-like notifications so the user has some sort of feedback to know the value has been copied.

Expand All @@ -10,7 +10,7 @@ Can be used inline to render only a small icon for the button with no other text
<figure>
<figcaption>Icon only</figcaption>
<CopyButton
<ConsulCopyButton
@value={{'stringToCopy'}}
@name="Thing"
/>
Expand All @@ -20,12 +20,12 @@ Can be used inline to render only a small icon for the button with no other text
<figure>
<figcaption>Icon and text</figcaption>
<CopyButton
<ConsulCopyButton
@value={{'stringToCopy'}}
@name="Thing"
>
Copy me!
</CopyButton>
</ConsulCopyButton>
</figure>
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
{{#let (fn dispatch 'SUCCESS') (fn dispatch 'ERROR') (fn dispatch 'RESET') as |success error reset|}}
<button
{{with-copyable @value success=success error=error}}
aria-label={{t 'components.copy-button.title' name=@name}}
aria-label={{t 'components.consul-copy-button.title' name=@name}}
type="button"
class="copy-btn"
...attributes
{{tooltip
(if (state-matches state 'success') (t 'components.copy-button.success' name=@name) (t 'components.copy-button.error'))
(if (state-matches state 'success') (t 'components.consul-copy-button.success' name=@name) (t 'components.consul-copy-button.error'))
options=(hash
trigger='manual'
showOnCreate=(not (state-matches state 'idle'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import Component from '@glimmer/component';
import chart from './chart.xstate';

export default class CopyButton extends Component {
export default class ConsulCopyButton extends Component {
constructor() {
super(...arguments);
this.chart = chart;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<span>
{{combinedAddress}}
</span>
<CopyButton
<ConsulCopyButton
@value={{combinedAddress}}
@name="Address"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<dt>Output</dt>
<dd>
<pre><code>{{item.Output}}</code></pre>
<CopyButton @value={{item.Output}} @name="output" />
<ConsulCopyButton @value={{item.Output}} @name="output" />
</dd>
</dl>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ as |item index|>
<span>Address</span>
</dt>
<dd>
<CopyButton
<ConsulCopyButton
@value={{item.Address}}
@name="Address"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ as |item|>
</BlockSlot>
<BlockSlot @name="actions" as |Actions|>
{{#if item.hasSecretID}}
<CopyButton
<ConsulCopyButton
@value={{item.SecretID}}
@name={{t "components.consul.token.secretID"}}
>
{{t "components.consul.token.secretID"}}
</CopyButton>
</ConsulCopyButton>
{{/if}}
<Actions as |Action|>
<Action data-test-edit-action @href={{href-to 'dc.acls.tokens.edit' item.AccessorID}}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
Local bind socket path
</dt>
<dd>
<CopyButton
<ConsulCopyButton
@value={{item.LocalBindSocketPath}}
@name="Local bind socket path"
/>
Expand All @@ -73,7 +73,7 @@
Address
</dt>
<dd>
<CopyButton
<ConsulCopyButton
@value={{combinedAddress}}
@name="Address"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ as |item index|>
Address
</dt>
<dd>
<CopyButton
<ConsulCopyButton
@value={{address}}
@name="Address"
/>
Expand Down
4 changes: 2 additions & 2 deletions ui/packages/consul-ui/app/components/copyable-code/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
</disclosure.Details>
</Disclosure>

<CopyButton
<ConsulCopyButton
@value={{@value}}
@name={{@name}}
/>

{{else}}
<pre><code
>{{@value}}</code></pre>
<CopyButton
<ConsulCopyButton
@value={{@value}}
@name={{@name}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ to provide a textual tooltip for the icon. Using the `{{tooltip}}` modifier
with no arguments will make it use the text/DOM content of the DOM element it
is attached to, see below for a full usage example.

`<CopyButton />` components are commonly added to the value, and can be added
`<ConsulCopyButton />` components are commonly added to the value, and can be added
to the left or right of the value.

```hbs preview-template
Expand Down Expand Up @@ -49,7 +49,7 @@ to the left or right of the value.
TTL
</dt>
<dd>
<CopyButton
<ConsulCopyButton
@value={{"1m30s10ms"}}
@name="TTL"
/>
Expand Down Expand Up @@ -96,7 +96,7 @@ to the left or right of the value.
</dt>
<dd>
1m30s10ms
<CopyButton
<ConsulCopyButton
@value={{"1m30s10ms"}}
@name="TTL"
/>
Expand Down Expand Up @@ -147,7 +147,7 @@ to the left or right of the value.
TTL
</dt>
<dd>
<CopyButton
<ConsulCopyButton
@value={{"1m30s10ms"}}
@name="TTL"
/>
Expand Down
2 changes: 1 addition & 1 deletion ui/packages/consul-ui/app/templates/dc/nodes/show.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ as |item tomography|}}
}}/>
</BlockSlot>
<BlockSlot @name="actions">
<CopyButton @value={{item.Address}} @name="Address">{{item.Address}}</CopyButton>
<ConsulCopyButton @value={{item.Address}} @name="Address">{{item.Address}}</ConsulCopyButton>
</BlockSlot>
<BlockSlot @name="content">
<Outlet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
</BlockSlot>
<BlockSlot @name='actions'>
{{#let (or item.Service.Address item.Node.Address) as |address|}}
<CopyButton @value={{address}} @name='Address'>{{address}}</CopyButton>
<ConsulCopyButton @value={{address}} @name='Address'>{{address}}</ConsulCopyButton>
{{/let}}
</BlockSlot>
<BlockSlot @name='content'>
Expand Down

0 comments on commit 1a1b951

Please sign in to comment.