Commit a569d84f authored by Paul Slaughter's avatar Paul Slaughter

Merge branch '194764-fix-resolve-thread-in-new-issue' into 'master'

Avoid pre-populating form for MR resolve issues

Closes #194764

See merge request gitlab-org/gitlab!22593
parents a38b6ab6 16ffb505
...@@ -8,19 +8,23 @@ import AutoWidthDropdownSelect from './issuable/auto_width_dropdown_select'; ...@@ -8,19 +8,23 @@ import AutoWidthDropdownSelect from './issuable/auto_width_dropdown_select';
import { parsePikadayDate, pikadayToString } from './lib/utils/datetime_utility'; import { parsePikadayDate, pikadayToString } from './lib/utils/datetime_utility';
import { queryToObject, objectToQuery } from './lib/utils/url_utility'; import { queryToObject, objectToQuery } from './lib/utils/url_utility';
const MR_SOURCE_BRANCH = 'merge_request[source_branch]';
const MR_TARGET_BRANCH = 'merge_request[target_branch]';
function organizeQuery(obj, isFallbackKey = false) { function organizeQuery(obj, isFallbackKey = false) {
const sourceBranch = 'merge_request[source_branch]'; if (!obj[MR_SOURCE_BRANCH] && !obj[MR_TARGET_BRANCH]) {
const targetBranch = 'merge_request[target_branch]'; return obj;
}
if (isFallbackKey) { if (isFallbackKey) {
return { return {
[sourceBranch]: obj[sourceBranch], [MR_SOURCE_BRANCH]: obj[MR_SOURCE_BRANCH],
}; };
} }
return { return {
[sourceBranch]: obj[sourceBranch], [MR_SOURCE_BRANCH]: obj[MR_SOURCE_BRANCH],
[targetBranch]: obj[targetBranch], [MR_TARGET_BRANCH]: obj[MR_TARGET_BRANCH],
}; };
} }
...@@ -87,7 +91,8 @@ export default class IssuableForm { ...@@ -87,7 +91,8 @@ export default class IssuableForm {
} }
initAutosave() { initAutosave() {
const searchTerm = format(document.location.search); const { search } = document.location;
const searchTerm = format(search);
const fallbackKey = getFallbackKey(); const fallbackKey = getFallbackKey();
this.autosave = new Autosave( this.autosave = new Autosave(
......
---
title: Avoid pre-populating form for MR resolve issues
merge_request: 22593
author:
type: fixed
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