Commit 638fa19b authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch 'mr-widget-refresh-failed' into 'master'

Add refresh button into MR widget failed state.

Closes #32543

See merge request !11519
parents 0bce9872 1514dd35
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
...@@ -13,8 +28,19 @@ export default { ...@@ -13,8 +28,19 @@ export default {
</button> </button>
<span class="bold danger"> <span class="bold danger">
This merge request failed to be merged automatically. This merge request failed to be merged automatically.
<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>
</span> </span>
<div class="merge-error-text"> <div class="merge-error-text danger bold">
{{mr.mergeError}} {{mr.mergeError}}
</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