Skip to content

Commit fe30164

Browse files
committed
Rename component
Thanks to @lukemelia for this suggestion on handling component name overlaps: emberjs/ember.js#17997 (comment)
1 parent a28e9de commit fe30164

File tree

7 files changed

+11
-10
lines changed

7 files changed

+11
-10
lines changed
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from 'ember-cli-clipboard/components/copy-button';

ui/app/components/x-copy-button.js ui/app/components/copy-button.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Component from '@ember/component';
22
import { run } from '@ember/runloop';
33

44
export default Component.extend({
5-
classNames: ['x-copy-button'],
5+
classNames: ['copy-button'],
66

77
state: null,
88

ui/app/styles/core/buttons.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ $button-box-shadow-standard: 0 2px 0 0 rgba($grey, 0.2);
134134
}
135135
}
136136

137-
.x-copy-button {
137+
.copy-button {
138138
padding-left: 0.5rem;
139139
margin-bottom: 2px;
140140

ui/app/templates/allocations/allocation/index.hbs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<span class="bumper-left tag {{model.statusClass}}">{{model.clientStatus}}</span>
1919
<span class="tag is-hollow is-small no-text-transform">
2020
{{model.id}}
21-
{{x-copy-button clipboardText=model.id}}
21+
{{copy-button clipboardText=model.id}}
2222
</span>
2323
{{#if model.isRunning}}
2424
{{two-step-button

ui/app/templates/clients/client.hbs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{{or model.name model.shortId}}
55
<span class="tag is-hollow is-small no-text-transform">
66
{{model.id}}
7-
{{x-copy-button clipboardText=model.id}}
7+
{{copy-button clipboardText=model.id}}
88
</span>
99
</h1>
1010

ui/app/templates/components/x-copy-button.hbs ui/app/templates/components/copy-button.hbs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
</span>
1313
</div>
1414
{{else}}
15-
{{#copy-button
15+
{{#addon-copy-button
1616
class='button is-borderless is-small'
1717
clipboardText=clipboardText
1818
success=(action 'success')
1919
error=(action (mut state) 'error')
2020
}}
2121
{{x-icon 'copy-action'}}
22-
{{/copy-button}}
22+
{{/addon-copy-button}}
2323
{{/if}}

ui/tests/integration/components/x-copy-button-test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ import sinon from 'sinon';
77

88
import { triggerCopyError, triggerCopySuccess } from 'ember-cli-clipboard/test-support';
99

10-
module('Integration | Component | x-copy-button', function(hooks) {
10+
module('Integration | Component | copy-button', function(hooks) {
1111
setupRenderingTest(hooks);
1212

1313
test('it shows the copy icon by default', async function(assert) {
14-
await render(hbs`{{x-copy-button class='copy-button'}}`);
14+
await render(hbs`{{copy-button class='copy-button'}}`);
1515

1616
assert.dom('.copy-button .icon-is-copy-action').exists();
1717
});
1818

1919
test('it shows the success icon on success and resets afterward', async function(assert) {
2020
const clock = sinon.useFakeTimers();
2121

22-
await render(hbs`{{x-copy-button class='copy-button'}}`);
22+
await render(hbs`{{copy-button class='copy-button'}}`);
2323

2424
await click('.copy-button button');
2525
await triggerCopySuccess('.copy-button button');
@@ -35,7 +35,7 @@ module('Integration | Component | x-copy-button', function(hooks) {
3535
});
3636

3737
test('it shows the error icon on error', async function(assert) {
38-
await render(hbs`{{x-copy-button class='copy-button'}}`);
38+
await render(hbs`{{copy-button class='copy-button'}}`);
3939

4040
await click('.copy-button button');
4141
await triggerCopyError('.copy-button button');

0 commit comments

Comments
 (0)