Commit dcbe7d2b authored by Kev's avatar Kev

Use constants for rebase button keys

parent e3c4c1fb
...@@ -9,9 +9,7 @@ import eventHub from '../../event_hub'; ...@@ -9,9 +9,7 @@ import eventHub from '../../event_hub';
import mergeRequestQueryVariablesMixin from '../../mixins/merge_request_query_variables'; import mergeRequestQueryVariablesMixin from '../../mixins/merge_request_query_variables';
import rebaseQuery from '../../queries/states/rebase.query.graphql'; import rebaseQuery from '../../queries/states/rebase.query.graphql';
import statusIcon from '../mr_widget_status_icon.vue'; import statusIcon from '../mr_widget_status_icon.vue';
import { REBASE_BUTTON_KEY, REBASE_WITHOUT_CI_BUTTON_KEY } from '../../constants';
const KEY_REBASE = 'rebase';
const KEY_REBASE_WITHOUT_CI = 'rebaseWithoutCi';
export default { export default {
name: 'MRWidgetRebase', name: 'MRWidgetRebase',
...@@ -48,7 +46,7 @@ export default { ...@@ -48,7 +46,7 @@ export default {
state: {}, state: {},
isMakingRequest: false, isMakingRequest: false,
rebasingError: null, rebasingError: null,
selectedRebaseAction: KEY_REBASE, selectedRebaseAction: REBASE_BUTTON_KEY,
}; };
}, },
computed: { computed: {
...@@ -96,7 +94,7 @@ export default { ...@@ -96,7 +94,7 @@ export default {
}, },
rebaseAction() { rebaseAction() {
return { return {
key: KEY_REBASE, key: REBASE_BUTTON_KEY,
text: __('Rebase'), text: __('Rebase'),
secondaryText: __('Rebases and triggers a pipeline'), secondaryText: __('Rebases and triggers a pipeline'),
attrs: { attrs: {
...@@ -107,7 +105,7 @@ export default { ...@@ -107,7 +105,7 @@ export default {
}, },
rebaseWithoutCiAction() { rebaseWithoutCiAction() {
return { return {
key: KEY_REBASE_WITHOUT_CI, key: REBASE_WITHOUT_CI_BUTTON_KEY,
text: __('Rebase without CI'), text: __('Rebase without CI'),
secondaryText: __('Performs a rebase but skips triggering a new pipeline'), secondaryText: __('Performs a rebase but skips triggering a new pipeline'),
handle: () => this.rebase({ skipCi: true }), handle: () => this.rebase({ skipCi: true }),
......
...@@ -162,3 +162,6 @@ export const EXTENSION_SUMMARY_FAILED_CLASS = 'gl-text-red-500'; ...@@ -162,3 +162,6 @@ export const EXTENSION_SUMMARY_FAILED_CLASS = 'gl-text-red-500';
export const EXTENSION_SUMMARY_NEUTRAL_CLASS = 'gl-text-gray-700'; export const EXTENSION_SUMMARY_NEUTRAL_CLASS = 'gl-text-gray-700';
export { STATE_MACHINE }; export { STATE_MACHINE };
export const REBASE_BUTTON_KEY = 'rebase';
export const REBASE_WITHOUT_CI_BUTTON_KEY = 'rebaseWithoutCi';
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