Merge branch '51259-gitlab-ui-replacement' into 'master'

Updates clipboard button with gitlab-ui

See merge request gitlab-org/gitlab-ce!22923
This commit is contained in:
Clement Ho 2018-11-09 21:06:26 +00:00
commit 65e5a79c2a
2 changed files with 6 additions and 14 deletions

View file

@ -12,20 +12,18 @@
* css-class="btn-transparent"
* />
*/
import tooltip from '../directives/tooltip';
import { GlButton, GlTooltipDirective } from '@gitlab-org/gitlab-ui';
import Icon from '../components/icon.vue';
export default {
name: 'ClipboardButton',
directives: {
tooltip,
GlTooltip: GlTooltipDirective,
},
components: {
GlButton,
Icon,
},
props: {
text: {
type: String,
@ -68,16 +66,12 @@ export default {
</script>
<template>
<button
v-tooltip
<gl-button
v-gl-tooltip="{ placement: tooltipPlacement, container: tooltipContainer }"
:class="cssClass"
:title="title"
:data-clipboard-text="clipboardText"
:data-container="tooltipContainer"
:data-placement="tooltipPlacement"
type="button"
class="btn"
>
<icon name="duplicate" />
</button>
</gl-button>
</template>

View file

@ -27,8 +27,6 @@ describe('clipboard button', () => {
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-placement')).toEqual('top');
expect(vm.$el.getAttribute('data-container')).toEqual(null);
});
it('should render provided classname', () => {