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
0
Merge Requests
0
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
Tatuya Kamada
gitlab-ce
Commits
b2b1b4a4
Commit
b2b1b4a4
authored
Aug 12, 2016
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prefer `/reopen` over `/open`, remove `/reassign`
parent
d9715266
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
24 deletions
+24
-24
app/services/slash_commands/interpret_service.rb
app/services/slash_commands/interpret_service.rb
+21
-21
doc/workflow/slash_commands.md
doc/workflow/slash_commands.md
+3
-3
No files found.
app/services/slash_commands/interpret_service.rb
View file @
b2b1b4a4
...
@@ -53,7 +53,7 @@ module SlashCommands
...
@@ -53,7 +53,7 @@ module SlashCommands
noteable
.
closed?
&&
noteable
.
closed?
&&
current_user
.
can?
(
:"update_
#{
noteable
.
to_ability_name
}
"
,
noteable
)
current_user
.
can?
(
:"update_
#{
noteable
.
to_ability_name
}
"
,
noteable
)
end
end
command
:
open
,
:re
open
do
command
:
reopen
,
:
open
do
@updates
[
:state_event
]
=
'reopen'
@updates
[
:state_event
]
=
'reopen'
end
end
...
@@ -72,7 +72,7 @@ module SlashCommands
...
@@ -72,7 +72,7 @@ module SlashCommands
condition
do
condition
do
current_user
.
can?
(
:"admin_
#{
noteable
.
to_ability_name
}
"
,
project
)
current_user
.
can?
(
:"admin_
#{
noteable
.
to_ability_name
}
"
,
project
)
end
end
command
:assign
,
:reassign
do
|
assignee_param
|
command
:assign
do
|
assignee_param
|
user
=
extract_references
(
assignee_param
,
:user
).
first
user
=
extract_references
(
assignee_param
,
:user
).
first
user
||=
User
.
find_by
(
username:
assignee_param
)
user
||=
User
.
find_by
(
username:
assignee_param
)
user
||=
User
.
find_by
(
name:
assignee_param
)
user
||=
User
.
find_by
(
name:
assignee_param
)
...
@@ -180,7 +180,7 @@ module SlashCommands
...
@@ -180,7 +180,7 @@ module SlashCommands
end
end
desc
'Set due date'
desc
'Set due date'
params
'<in 2 days
| this Friday |
December 31st>'
params
'<in 2 days
; this Friday;
December 31st>'
condition
do
condition
do
noteable
.
respond_to?
(
:due_date
)
&&
noteable
.
respond_to?
(
:due_date
)
&&
current_user
.
can?
(
:"update_
#{
noteable
.
to_ability_name
}
"
,
noteable
)
current_user
.
can?
(
:"update_
#{
noteable
.
to_ability_name
}
"
,
noteable
)
...
@@ -204,7 +204,7 @@ module SlashCommands
...
@@ -204,7 +204,7 @@ module SlashCommands
# This is a dummy command, so that it appears in the autocomplete commands
# This is a dummy command, so that it appears in the autocomplete commands
desc
'CC'
desc
'CC'
params
'@user'
params
'@user'
command
:cc
,
noop:
true
command
:cc
def
find_label_ids
(
labels_param
)
def
find_label_ids
(
labels_param
)
label_ids_by_reference
=
extract_references
(
labels_param
,
:label
).
map
(
&
:id
)
label_ids_by_reference
=
extract_references
(
labels_param
,
:label
).
map
(
&
:id
)
...
...
doc/workflow/slash_commands.md
View file @
b2b1b4a4
...
@@ -12,9 +12,9 @@ do.
...
@@ -12,9 +12,9 @@ do.
| Command | Aliases | Action |
| Command | Aliases | Action |
|:---------------------------|:--------------------|:-------------|
|:---------------------------|:--------------------|:-------------|
|
`/close`
| None | Close the issue or merge request |
|
`/close`
| None | Close the issue or merge request |
|
`/
open`
|
`/reopen`
| Reopen the issue or merge request |
|
`/
reopen`
|
`/open`
| Reopen the issue or merge request |
|
`/title <New title>`
| None | Change title |
|
`/title <New title>`
| None | Change title |
|
`/assign @username`
|
`/reassign`
| Assign |
|
`/assign @username`
|
None
| Assign |
|
`/unassign`
|
`/remove_assignee`
| Remove assignee |
|
`/unassign`
|
`/remove_assignee`
| Remove assignee |
|
`/milestone %milestone`
| None | Set milestone |
|
`/milestone %milestone`
| None | Set milestone |
|
`/clear_milestone`
|
`/remove_milestone`
| Remove milestone |
|
`/clear_milestone`
|
`/remove_milestone`
| Remove milestone |
...
@@ -25,5 +25,5 @@ do.
...
@@ -25,5 +25,5 @@ do.
|
`/done`
| None | Mark todo as done |
|
`/done`
| None | Mark todo as done |
|
`/subscribe`
| None | Subscribe |
|
`/subscribe`
| None | Subscribe |
|
`/unsubscribe`
| None | Unsubscribe |
|
`/unsubscribe`
| None | Unsubscribe |
|
`/due <in 2 days
| this Friday |
December 31st>`
|
`/due_date`
| Set due date |
|
`/due <in 2 days
; this Friday;
December 31st>`
|
`/due_date`
| Set due date |
|
`/clear_due_date`
| None | Remove due date |
|
`/clear_due_date`
| None | Remove due date |
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