diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-22 15:07:28 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-22 15:07:28 +0300 |
commit | 4220cf46a314ac1c4d88be13608752bc07bb28fb (patch) | |
tree | 169db13fd06c7622bbcf59b707d57d516f44e299 /app/assets/javascripts/issuable | |
parent | 4c7e34071eceb05a9ce271354c21de7487e4ff84 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/issuable')
-rw-r--r-- | app/assets/javascripts/issuable/issuable_form.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/assets/javascripts/issuable/issuable_form.js b/app/assets/javascripts/issuable/issuable_form.js index 88c1748db0b..018cadad50f 100644 --- a/app/assets/javascripts/issuable/issuable_form.js +++ b/app/assets/javascripts/issuable/issuable_form.js @@ -12,6 +12,7 @@ import ZenMode from '~/zen_mode'; const MR_SOURCE_BRANCH = 'merge_request[source_branch]'; const MR_TARGET_BRANCH = 'merge_request[target_branch]'; +const DATA_ISSUES_NEW_PATH = 'data-new-issue-path'; function organizeQuery(obj, isFallbackKey = false) { if (!obj[MR_SOURCE_BRANCH] && !obj[MR_TARGET_BRANCH]) { @@ -68,6 +69,7 @@ export default class IssuableForm { this.reviewersSelect = new UsersSelect(undefined, '.js-reviewer-search'); this.zenMode = new ZenMode(); + this.newIssuePath = form[0].getAttribute(DATA_ISSUES_NEW_PATH); this.titleField = this.form.find('input[name*="[title]"]'); this.descriptionField = this.form.find('textarea[name*="[description]"]'); if (!(this.titleField.length && this.descriptionField.length)) { @@ -104,8 +106,8 @@ export default class IssuableForm { } initAutosave() { - const { search } = document.location; - const searchTerm = format(search); + const { search, pathname } = document.location; + const searchTerm = this.newIssuePath === pathname ? '' : format(search); const fallbackKey = getFallbackKey(); this.autosave = new Autosave( |