diff options
author | Fatih Acet <acetfatih@gmail.com> | 2017-05-19 04:06:08 +0300 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2017-05-19 04:06:08 +0300 |
commit | 0aa5e98a59346feb4ec7debfc015174236a3ccf4 (patch) | |
tree | 0759c123116021de5ca8838cd5493bb884e5d188 /app | |
parent | bcc504d3c3ed0436935ca076d6be5db5ca10a664 (diff) | |
download | gitlab-ce-0aa5e98a59346feb4ec7debfc015174236a3ccf4.tar.gz |
MRWidget: Add refresh button into MR widget failed state.
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_auto_merge_failed.js | 26 |
1 files changed, 26 insertions, 0 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..9fb89a99175 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 @@ -16,6 +31,17 @@ export default { </span> <div class="merge-error-text"> {{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> `, |