Commit 37ea4897 authored by Paul Slaughter's avatar Paul Slaughter

Merge branch 'tor/maintenance/fix-comment-rot-draft-mr-title' into 'master'

Clean up rotten comments referencing WIP, and rename variable

See merge request gitlab-org/gitlab!68111
parents 5c6f8923 84a51f04
......@@ -51,15 +51,16 @@ export default class IssuableForm {
this.resetAutosave = this.resetAutosave.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
/* eslint-disable @gitlab/require-i18n-strings */
this.wipRegex = new RegExp(
// prettier-ignore
this.draftRegex = new RegExp(
'^\\s*(' + // Line start, then any amount of leading whitespace
'draft\\s-\\s' + // Draft_-_ where "_" are *exactly* 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
'|draft:\\s*' + // Draft: and any following whitespace
'|draft\\s+' + // Draft_ 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
')+' + // At least one repeated match of the preceding parenthetical
'\\s*', // Any amount of trailing whitespace
'i', // Match any case(s)
);
/* eslint-enable @gitlab/require-i18n-strings */
......@@ -144,7 +145,7 @@ export default class IssuableForm {
}
workInProgress() {
return this.wipRegex.test(this.titleField.val());
return this.draftRegex.test(this.titleField.val());
}
renderWipExplanation() {
......@@ -170,7 +171,7 @@ export default class IssuableForm {
}
removeWip() {
return this.titleField.val(this.titleField.val().replace(this.wipRegex, ''));
return this.titleField.val(this.titleField.val().replace(this.draftRegex, ''));
}
addWip() {
......
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