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
7fd094ee
Commit
7fd094ee
authored
Oct 28, 2020
by
Gary Holtz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding a "/draft" alias to the "/wip" command
Also including a few specs
parent
1ed7e29d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
lib/gitlab/quick_actions/merge_request_actions.rb
lib/gitlab/quick_actions/merge_request_actions.rb
+1
-1
spec/services/quick_actions/interpret_service_spec.rb
spec/services/quick_actions/interpret_service_spec.rb
+10
-0
No files found.
lib/gitlab/quick_actions/merge_request_actions.rb
View file @
7fd094ee
...
@@ -80,7 +80,7 @@ module Gitlab
...
@@ -80,7 +80,7 @@ module Gitlab
# Allow it to mark as WIP on MR creation page _or_ through MR notes.
# Allow it to mark as WIP on MR creation page _or_ through MR notes.
(
quick_action_target
.
new_record?
||
current_user
.
can?
(
:"update_
#{
quick_action_target
.
to_ability_name
}
"
,
quick_action_target
))
(
quick_action_target
.
new_record?
||
current_user
.
can?
(
:"update_
#{
quick_action_target
.
to_ability_name
}
"
,
quick_action_target
))
end
end
command
:wip
do
command
:wip
,
:draft
do
@updates
[
:wip_event
]
=
quick_action_target
.
work_in_progress?
?
'unwip'
:
'wip'
@updates
[
:wip_event
]
=
quick_action_target
.
work_in_progress?
?
'unwip'
:
'wip'
end
end
...
...
spec/services/quick_actions/interpret_service_spec.rb
View file @
7fd094ee
...
@@ -1036,6 +1036,16 @@ RSpec.describe QuickActions::InterpretService do
...
@@ -1036,6 +1036,16 @@ RSpec.describe QuickActions::InterpretService do
let
(
:issuable
)
{
merge_request
}
let
(
:issuable
)
{
merge_request
}
end
end
it_behaves_like
'wip command'
do
let
(
:content
)
{
'/draft'
}
let
(
:issuable
)
{
merge_request
}
end
it_behaves_like
'unwip command'
do
let
(
:content
)
{
'/draft'
}
let
(
:issuable
)
{
merge_request
}
end
it_behaves_like
'empty command'
do
it_behaves_like
'empty command'
do
let
(
:content
)
{
'/remove_due_date'
}
let
(
:content
)
{
'/remove_due_date'
}
let
(
:issuable
)
{
merge_request
}
let
(
:issuable
)
{
merge_request
}
...
...
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