Updates clipboard button with gitlab-ui
Updates clipboard button component to use the new glTooltipDirective and the new glButton component from gitlab-ui
This commit is contained in:
parent
ab61bee378
commit
9d45332fd2
2 changed files with 6 additions and 14 deletions
|
@ -12,20 +12,18 @@
|
||||||
* css-class="btn-transparent"
|
* css-class="btn-transparent"
|
||||||
* />
|
* />
|
||||||
*/
|
*/
|
||||||
import tooltip from '../directives/tooltip';
|
import { GlButton, GlTooltipDirective } from '@gitlab-org/gitlab-ui';
|
||||||
import Icon from '../components/icon.vue';
|
import Icon from '../components/icon.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ClipboardButton',
|
name: 'ClipboardButton',
|
||||||
|
|
||||||
directives: {
|
directives: {
|
||||||
tooltip,
|
GlTooltip: GlTooltipDirective,
|
||||||
},
|
},
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
|
GlButton,
|
||||||
Icon,
|
Icon,
|
||||||
},
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
text: {
|
text: {
|
||||||
type: String,
|
type: String,
|
||||||
|
@ -68,16 +66,12 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<button
|
<gl-button
|
||||||
v-tooltip
|
v-gl-tooltip="{ placement: tooltipPlacement, container: tooltipContainer }"
|
||||||
:class="cssClass"
|
:class="cssClass"
|
||||||
:title="title"
|
:title="title"
|
||||||
:data-clipboard-text="clipboardText"
|
:data-clipboard-text="clipboardText"
|
||||||
:data-container="tooltipContainer"
|
|
||||||
:data-placement="tooltipPlacement"
|
|
||||||
type="button"
|
|
||||||
class="btn"
|
|
||||||
>
|
>
|
||||||
<icon name="duplicate" />
|
<icon name="duplicate" />
|
||||||
</button>
|
</gl-button>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -27,8 +27,6 @@ describe('clipboard button', () => {
|
||||||
|
|
||||||
it('should have a tooltip with default values', () => {
|
it('should have a tooltip with default values', () => {
|
||||||
expect(vm.$el.getAttribute('data-original-title')).toEqual('Copy this value into Clipboard!');
|
expect(vm.$el.getAttribute('data-original-title')).toEqual('Copy this value into Clipboard!');
|
||||||
expect(vm.$el.getAttribute('data-placement')).toEqual('top');
|
|
||||||
expect(vm.$el.getAttribute('data-container')).toEqual(null);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render provided classname', () => {
|
it('should render provided classname', () => {
|
||||||
|
|
Loading…
Reference in a new issue