diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
commit | 4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch) | |
tree | 5423a1c7516cffe36384133ade12572cf709398d /app/assets/javascripts/issuable_form.js | |
parent | e570267f2f6b326480d284e0164a6464ba4081bc (diff) |
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'app/assets/javascripts/issuable_form.js')
-rw-r--r-- | app/assets/javascripts/issuable_form.js | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/app/assets/javascripts/issuable_form.js b/app/assets/javascripts/issuable_form.js index 153123a005f..9a1ab23e366 100644 --- a/app/assets/javascripts/issuable_form.js +++ b/app/assets/javascripts/issuable_form.js @@ -54,9 +54,9 @@ export default class IssuableForm { this.wipRegex = new RegExp( '^\\s*(' + // Line start, then any amount of leading whitespace 'draft\\s-\\s' + // Draft_-_ where "_" are *exactly* one whitespace - '|\\[(draft|wip)\\]\\s*' + // [Draft] or [WIP] and any following whitespace - '|(draft|wip):\\s*' + // Draft: or WIP: and any following whitespace - '|(draft|wip)\\s+' + // Draft_ or WIP_ where "_" is at least one whitespace + '|\\[draft\\]\\s*' + // [Draft] or [WIP] and any following whitespace + '|draft:\\s*' + // Draft: or WIP: and any following whitespace + '|draft\\s+' + // Draft_ or WIP_ where "_" is at least one whitespace '|\\(draft\\)\\s*' + // (Draft) and any following whitespace ')+' + // At least one repeated match of the preceding parenthetical '\\s*', // Any amount of trailing whitespace @@ -146,18 +146,12 @@ export default class IssuableForm { workInProgress() { return this.wipRegex.test(this.titleField.val()); } - titlePrefixContainsDraft() { - const prefix = this.titleField.val().match(this.wipRegex); - - return prefix && prefix[0].match(/draft/i); - } renderWipExplanation() { if (this.workInProgress()) { // These strings are not "translatable" (the code is hard-coded to look for them) - this.$wipExplanation.find('code')[0].textContent = this.titlePrefixContainsDraft() - ? 'Draft' /* eslint-disable-line @gitlab/require-i18n-strings */ - : 'WIP'; + this.$wipExplanation.find('code')[0].textContent = + 'Draft'; /* eslint-disable-line @gitlab/require-i18n-strings */ this.$wipExplanation.show(); return this.$noWipExplanation.hide(); } |