diff options
Diffstat (limited to 'app/assets/javascripts/ide/stores/modules')
5 files changed, 13 insertions, 9 deletions
diff --git a/app/assets/javascripts/ide/stores/modules/commit/actions.js b/app/assets/javascripts/ide/stores/modules/commit/actions.js index cbc6e0fe519..d490b8c5dad 100644 --- a/app/assets/javascripts/ide/stores/modules/commit/actions.js +++ b/app/assets/javascripts/ide/stores/modules/commit/actions.js @@ -183,7 +183,11 @@ export const commitChanges = ({ commit, state, getters, dispatch, rootState, roo dispatch( 'redirectToUrl', - createNewMergeRequestUrl(currentProject.web_url, branchName, targetBranch), + createNewMergeRequestUrl( + currentProject.web_url, + encodeURIComponent(branchName), + encodeURIComponent(targetBranch), + ), { root: true }, ); } diff --git a/app/assets/javascripts/ide/stores/modules/pipelines/actions.js b/app/assets/javascripts/ide/stores/modules/pipelines/actions.js index 62476b7fc63..6eb56a68429 100644 --- a/app/assets/javascripts/ide/stores/modules/pipelines/actions.js +++ b/app/assets/javascripts/ide/stores/modules/pipelines/actions.js @@ -1,6 +1,6 @@ import axios from 'axios'; import Visibility from 'visibilityjs'; -import httpStatus from '~/lib/utils/http_status'; +import { HTTP_STATUS_NOT_FOUND } from '~/lib/utils/http_status'; import Poll from '~/lib/utils/poll'; import { __ } from '~/locale'; import { rightSidebarViews } from '../../../constants'; @@ -24,7 +24,7 @@ export const forcePipelineRequest = () => { export const requestLatestPipeline = ({ commit }) => commit(types.REQUEST_LATEST_PIPELINE); export const receiveLatestPipelineError = ({ commit, dispatch }, err) => { - if (err.status !== httpStatus.NOT_FOUND) { + if (err.status !== HTTP_STATUS_NOT_FOUND) { dispatch( 'setErrorMessage', { diff --git a/app/assets/javascripts/ide/stores/modules/terminal/actions/checks.js b/app/assets/javascripts/ide/stores/modules/terminal/actions/checks.js index 91645a34a3d..c4198a7427f 100644 --- a/app/assets/javascripts/ide/stores/modules/terminal/actions/checks.js +++ b/app/assets/javascripts/ide/stores/modules/terminal/actions/checks.js @@ -1,5 +1,5 @@ import Api from '~/api'; -import httpStatus from '~/lib/utils/http_status'; +import { HTTP_STATUS_FORBIDDEN, HTTP_STATUS_NOT_FOUND } from '~/lib/utils/http_status'; import * as terminalService from '../../../../services/terminals'; import { CHECK_CONFIG, CHECK_RUNNERS, RETRY_RUNNERS_INTERVAL } from '../constants'; import * as messages from '../messages'; @@ -18,7 +18,7 @@ export const receiveConfigCheckError = ({ commit, state }, e) => { const { status } = e.response; const { paths } = state; - const isVisible = status !== httpStatus.FORBIDDEN && status !== httpStatus.NOT_FOUND; + const isVisible = status !== HTTP_STATUS_FORBIDDEN && status !== HTTP_STATUS_NOT_FOUND; commit(types.SET_VISIBLE, isVisible); const message = messages.configCheckError(status, paths.webTerminalConfigHelpPath); diff --git a/app/assets/javascripts/ide/stores/modules/terminal/actions/session_controls.js b/app/assets/javascripts/ide/stores/modules/terminal/actions/session_controls.js index a510ec0847b..874cc5094d3 100644 --- a/app/assets/javascripts/ide/stores/modules/terminal/actions/session_controls.js +++ b/app/assets/javascripts/ide/stores/modules/terminal/actions/session_controls.js @@ -1,6 +1,6 @@ import { createAlert } from '~/flash'; import axios from '~/lib/utils/axios_utils'; -import httpStatus, { HTTP_STATUS_UNPROCESSABLE_ENTITY } from '~/lib/utils/http_status'; +import { HTTP_STATUS_NOT_FOUND, HTTP_STATUS_UNPROCESSABLE_ENTITY } from '~/lib/utils/http_status'; import * as terminalService from '../../../../services/terminals'; import { STARTING, STOPPING, STOPPED } from '../constants'; import * as messages from '../messages'; @@ -107,7 +107,7 @@ export const restartSession = ({ state, dispatch, rootState }) => { const responseStatus = error.response && error.response.status; // We may have removed the build, in this case we'll just create a new session if ( - responseStatus === httpStatus.NOT_FOUND || + responseStatus === HTTP_STATUS_NOT_FOUND || responseStatus === HTTP_STATUS_UNPROCESSABLE_ENTITY ) { dispatch('startSession'); diff --git a/app/assets/javascripts/ide/stores/modules/terminal/messages.js b/app/assets/javascripts/ide/stores/modules/terminal/messages.js index fa1c7f23677..ad7ad35a98c 100644 --- a/app/assets/javascripts/ide/stores/modules/terminal/messages.js +++ b/app/assets/javascripts/ide/stores/modules/terminal/messages.js @@ -1,5 +1,5 @@ import { escape } from 'lodash'; -import httpStatus, { HTTP_STATUS_UNPROCESSABLE_ENTITY } from '~/lib/utils/http_status'; +import { HTTP_STATUS_FORBIDDEN, HTTP_STATUS_UNPROCESSABLE_ENTITY } from '~/lib/utils/http_status'; import { __, sprintf } from '~/locale'; export const UNEXPECTED_ERROR_CONFIG = __( @@ -39,7 +39,7 @@ export const configCheckError = (status, helpUrl) => { }, false, ); - } else if (status === httpStatus.FORBIDDEN) { + } else if (status === HTTP_STATUS_FORBIDDEN) { return ERROR_PERMISSION; } |