Commit 6fef9375 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'ph/fixCreateMRDropdownBranchNames' into 'master'

Fixes branch names in create MR dropdown being incorrect

See merge request gitlab-org/gitlab!80607
parents 7e3945be ec973653
......@@ -10,6 +10,7 @@ import ISetter from '~/filtered_search/droplab/plugins/input_setter';
import createFlash from '~/flash';
import axios from '~/lib/utils/axios_utils';
import { __, sprintf } from '~/locale';
import { mergeUrlParams } from '~/lib/utils/url_utility';
// Todo: Remove this when fixing issue in input_setter plugin
const InputSetter = { ...ISetter };
......@@ -171,12 +172,21 @@ export default class CreateMergeRequestDropdown {
this.isCreatingMergeRequest = true;
return this.createBranch().then(() => {
window.location.href = canCreateConfidentialMergeRequest()
let path = canCreateConfidentialMergeRequest()
? this.createMrPath.replace(
this.projectPath,
confidentialMergeRequestState.selectedProject.pathWithNamespace,
)
: this.createMrPath;
path = mergeUrlParams(
{
'merge_request[target_branch]': this.refInput.value,
'merge_request[source_branch]': this.branchInput.value,
},
path,
);
window.location.href = path;
});
});
}
......
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