Commit 0aa5e98a authored by Fatih Acet's avatar Fatih Acet

MRWidget: Add refresh button into MR widget failed state.

parent bcc504d3
import eventHub from '../../event_hub';
export default { export default {
name: 'MRWidgetAutoMergeFailed', name: 'MRWidgetAutoMergeFailed',
props: { props: {
mr: { type: Object, required: true }, mr: { type: Object, required: true },
}, },
data() {
return {
isRefreshing: false,
};
},
methods: {
refreshWidget() {
this.isRefreshing = true;
eventHub.$emit('MRWidgetUpdateRequested', () => {
this.isRefreshing = false;
});
},
},
template: ` template: `
<div class="mr-widget-body"> <div class="mr-widget-body">
<button <button
...@@ -16,6 +31,17 @@ export default { ...@@ -16,6 +31,17 @@ export default {
</span> </span>
<div class="merge-error-text"> <div class="merge-error-text">
{{mr.mergeError}} {{mr.mergeError}}
<button
@click="refreshWidget"
:class="{ disabled: isRefreshing }"
type="button"
class="btn btn-xs btn-default">
<i
v-if="isRefreshing"
class="fa fa-spinner fa-spin"
aria-hidden="true" />
Refresh
</button>
</div> </div>
</div> </div>
`, `,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment