Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
0ba36a02
Commit
0ba36a02
authored
Oct 17, 2021
by
Paul Slaughter
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '343189-fix-toggle-draft' into 'master'
Fix MR draft RegEx See merge request gitlab-org/gitlab!72454
parents
c056010c
04cee581
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
app/assets/javascripts/issuable_form.js
app/assets/javascripts/issuable_form.js
+1
-1
spec/frontend/issuable_form_spec.js
spec/frontend/issuable_form_spec.js
+14
-0
No files found.
app/assets/javascripts/issuable_form.js
View file @
0ba36a02
...
...
@@ -53,7 +53,7 @@ export default class IssuableForm {
// prettier-ignore
this
.
draftRegex
=
new
RegExp
(
'
^
\\
s*(
'
+
// Line start, then any amount of leading whitespace
'
|
\\
[draft
\\
]
\\
s*
'
+
// [Draft] and any following whitespace
'
\\
[draft
\\
]
\\
s*
'
+
// [Draft] and any following whitespace
'
|draft:
\\
s*
'
+
// Draft: and any following whitespace
'
|
\\
(draft
\\
)
\\
s*
'
+
// (Draft) and any following whitespace
'
)+
'
+
// At least one repeated match of the preceding parenthetical
...
...
spec/frontend/issuable_form_spec.js
View file @
0ba36a02
...
...
@@ -45,4 +45,18 @@ describe('IssuableForm', () => {
expect
(
instance
.
titleField
.
val
()).
toBe
(
"
Draft: The Issuable's Title Value
"
);
});
});
describe
(
'
workInProgress
'
,
()
=>
{
it
.
each
`
title | expected
${
'
draFT: something is happening
'
}
|
${
true
}
${
'
draft something is happening
'
}
|
${
false
}
${
'
something is happening to drafts
'
}
|
${
false
}
${
'
something is happening
'
}
|
${
false
}
`
(
'
returns $expected with "$title"
'
,
({
title
,
expected
})
=>
{
instance
.
titleField
.
val
(
title
);
expect
(
instance
.
workInProgress
()).
toBe
(
expected
);
});
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment