diff options
author | Natalia Tepluhina <tarya.se@gmail.com> | 2019-04-25 17:40:07 +0300 |
---|---|---|
committer | Natalia Tepluhina <tarya.se@gmail.com> | 2019-04-25 17:40:07 +0300 |
commit | c93ec8926d6d3be23797e36f32cba9f065283127 (patch) | |
tree | eeb80259ae580eae3ff7af370222ef7766381be1 /app | |
parent | 6015b521751ba1f272fbc7160cd138fe4411c8ee (diff) |
Created a CE mixin for MrWidgetOptions10100-ee-diff-mr-widget-options
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/vue_merge_request_widget/mixins/mr_widget_options.js | 17 | ||||
-rw-r--r-- | app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue | 15 |
2 files changed, 19 insertions, 13 deletions
diff --git a/app/assets/javascripts/vue_merge_request_widget/mixins/mr_widget_options.js b/app/assets/javascripts/vue_merge_request_widget/mixins/mr_widget_options.js new file mode 100644 index 00000000000..eece3e418ec --- /dev/null +++ b/app/assets/javascripts/vue_merge_request_widget/mixins/mr_widget_options.js @@ -0,0 +1,17 @@ +export default { + methods: { + getServiceEndpoints(store) { + return { + mergePath: store.mergePath, + mergeCheckPath: store.mergeCheckPath, + cancelAutoMergePath: store.cancelAutoMergePath, + removeWIPPath: store.removeWIPPath, + sourceBranchPath: store.sourceBranchPath, + ciEnvironmentsStatusPath: store.ciEnvironmentsStatusPath, + statusPath: store.statusPath, + mergeActionsContentPath: store.mergeActionsContentPath, + rebasePath: store.rebasePath, + }; + }, + }, +}; diff --git a/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue b/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue index aa4ecb0aac3..f3a7093cd37 100644 --- a/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue +++ b/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue @@ -6,6 +6,7 @@ import SmartInterval from '~/smart_interval'; import MRWidgetStore from 'ee_else_ce/vue_merge_request_widget/stores/mr_widget_store'; import MRWidgetService from 'ee_else_ce/vue_merge_request_widget/services/mr_widget_service'; import stateMaps from 'ee_else_ce/vue_merge_request_widget/stores/state_maps'; +import mrWidgetsOptionsMixin from 'ee_else_ce/vue_merge_request_widget/mixins/mr_widget_options'; import createFlash from '../flash'; import WidgetHeader from './components/mr_widget_header.vue'; import WidgetMergeHelp from './components/mr_widget_merge_help.vue'; @@ -41,6 +42,7 @@ import { setFaviconOverlay } from '../lib/utils/common_utils'; export default { el: '#js-vue-mr-widget', name: 'MRWidget', + mixins: [mrWidgetsOptionsMixin], components: { 'mr-widget-header': WidgetHeader, 'mr-widget-merge-help': WidgetMergeHelp, @@ -156,19 +158,6 @@ export default { } }, methods: { - getServiceEndpoints(store) { - return { - mergePath: store.mergePath, - mergeCheckPath: store.mergeCheckPath, - cancelAutoMergePath: store.cancelAutoMergePath, - removeWIPPath: store.removeWIPPath, - sourceBranchPath: store.sourceBranchPath, - ciEnvironmentsStatusPath: store.ciEnvironmentsStatusPath, - statusPath: store.statusPath, - mergeActionsContentPath: store.mergeActionsContentPath, - rebasePath: store.rebasePath, - }; - }, createService(store) { return new MRWidgetService(this.getServiceEndpoints(store)); }, |