Commit b2b1b4a4 authored by Douwe Maan's avatar Douwe Maan

Prefer `/reopen` over `/open`, remove `/reassign`

parent d9715266
......@@ -53,7 +53,7 @@ module SlashCommands
noteable.closed? &&
current_user.can?(:"update_#{noteable.to_ability_name}", noteable)
end
command :open, :reopen do
command :reopen, :open do
@updates[:state_event] = 'reopen'
end
......@@ -72,7 +72,7 @@ module SlashCommands
condition do
current_user.can?(:"admin_#{noteable.to_ability_name}", project)
end
command :assign, :reassign do |assignee_param|
command :assign do |assignee_param|
user = extract_references(assignee_param, :user).first
user ||= User.find_by(username: assignee_param)
user ||= User.find_by(name: assignee_param)
......@@ -180,7 +180,7 @@ module SlashCommands
end
desc 'Set due date'
params '<in 2 days | this Friday | December 31st>'
params '<in 2 days; this Friday; December 31st>'
condition do
noteable.respond_to?(:due_date) &&
current_user.can?(:"update_#{noteable.to_ability_name}", noteable)
......@@ -204,7 +204,7 @@ module SlashCommands
# This is a dummy command, so that it appears in the autocomplete commands
desc 'CC'
params '@user'
command :cc, noop: true
command :cc
def find_label_ids(labels_param)
label_ids_by_reference = extract_references(labels_param, :label).map(&:id)
......
......@@ -12,9 +12,9 @@ do.
| Command | Aliases | Action |
|:---------------------------|:--------------------|:-------------|
| `/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 |
| `/assign @username` | `/reassign` | Assign |
| `/assign @username` | None | Assign |
| `/unassign` | `/remove_assignee` | Remove assignee |
| `/milestone %milestone` | None | Set milestone |
| `/clear_milestone` | `/remove_milestone` | Remove milestone |
......@@ -25,5 +25,5 @@ do.
| `/done` | None | Mark todo as done |
| `/subscribe` | None | Subscribe |
| `/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 |
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