summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-05-19 11:59:00 +0000
committerTimothy Andrew <mail@timothyandrew.net>2017-05-19 13:00:38 +0000
commite49090dc3ec472db6783655c1114918acae169c3 (patch)
tree54f0d20348b188cfc2bf7e04e2698a99517ca13d /app
parentab612235b5e3d55a59d2f7bc227eb5bfaa50ee3e (diff)
downloadgitlab-ce-e49090dc3ec472db6783655c1114918acae169c3.tar.gz
Merge branch 'mr-widget-refresh-failed' into 'master'
Add refresh button into MR widget failed state. Closes #32543 See merge request !11519
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_auto_merge_failed.js28
1 files changed, 27 insertions, 1 deletions
diff --git a/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_auto_merge_failed.js b/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_auto_merge_failed.js
index fcccb17f58d..4063859d5d0 100644
--- a/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_auto_merge_failed.js
+++ b/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_auto_merge_failed.js
@@ -1,8 +1,23 @@
+import eventHub from '../../event_hub';
+
export default {
name: 'MRWidgetAutoMergeFailed',
props: {
mr: { type: Object, required: true },
},
+ data() {
+ return {
+ isRefreshing: false,
+ };
+ },
+ methods: {
+ refreshWidget() {
+ this.isRefreshing = true;
+ eventHub.$emit('MRWidgetUpdateRequested', () => {
+ this.isRefreshing = false;
+ });
+ },
+ },
template: `
<div class="mr-widget-body">
<button
@@ -13,8 +28,19 @@ export default {
</button>
<span class="bold danger">
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>
- <div class="merge-error-text">
+ <div class="merge-error-text danger bold">
{{mr.mergeError}}
</div>
</div>