Skip to content
Snippets Groups Projects

Copy failed spec names to clipboard from MR widget

Merged Mireya Andres requested to merge copy-failed-spec-names into master
3 files
+ 59
1
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -22,6 +22,12 @@ export default {
default: () => [],
},
},
data: () => {
return {
timeout: null,
updatingTooltip: false,
};
},
computed: {
dropdownLabel() {
return sprintf(__('%{widget} options'), { widget: this.widget });
@@ -30,9 +36,29 @@ export default {
methods: {
onClickAction(action) {
this.$emit('clickedAction', action);
if (action.onClick) {
action.onClick();
}
if (action.tooltipOnClick) {
this.updatingTooltip = true;
this.$root.$emit('bv::show::tooltip', action.id);
clearTimeout(this.timeout);
this.timeout = setTimeout(() => {
this.updatingTooltip = false;
this.$root.$emit('bv::hide::tooltip', action.id);
}, 1000);
}
},
setTooltip(btn) {
if (this.updatingTooltip && btn.tooltipOnClick) {
return btn.tooltipOnClick;
}
return btn.tooltipText;
},
},
};
@@ -67,9 +93,10 @@ export default {
<template v-if="tertiaryButtons.length">
<gl-button
v-for="(btn, index) in tertiaryButtons"
:id="btn.id"
:key="index"
v-gl-tooltip.hover
:title="btn.tooltipText"
:title="setTooltip(btn)"
:href="btn.href"
:target="btn.target"
:class="{ 'gl-mr-3': index !== tertiaryButtons.length - 1 }"
Loading