From 0eea8c885743575b0e93a98846b3663e9903aa66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Thu, 30 Jun 2016 17:34:19 +0200 Subject: Support slash commands in noteable description and notes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some important things to note: - commands are removed from noteable.description / note.note - commands are translated to params so that they are treated as normal params in noteable Creation services - the logic is not in the models but in the Creation services, which is the right place for advanced logic that has nothing to do with what models should be responsible of! - UI/JS needs to be updated to handle notes which consist of commands only - the `/merge` command is not handled yet Other improvements: - Don't process commands in commit notes and display a flash is note is only commands - Add autocomplete for slash commands - Add description and params to slash command DSL methods - Ensure replying by email with a commands-only note works - Use :subscription_event instead of calling noteable.subscribe - Support :todo_event in IssuableBaseService Signed-off-by: Rémy Coutable --- doc/workflow/README.md | 1 + doc/workflow/slash_commands.md | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 doc/workflow/slash_commands.md (limited to 'doc/workflow') diff --git a/doc/workflow/README.md b/doc/workflow/README.md index 49dec613716..17c04377b4c 100644 --- a/doc/workflow/README.md +++ b/doc/workflow/README.md @@ -6,6 +6,7 @@ - [GitLab Flow](gitlab_flow.md) - [Groups](groups.md) - [Keyboard shortcuts](shortcuts.md) +- [Slash commands](slash_commands.md) - [File finder](file_finder.md) - [Labels](../user/project/labels.md) - [Notification emails](notifications.md) diff --git a/doc/workflow/slash_commands.md b/doc/workflow/slash_commands.md new file mode 100644 index 00000000000..3bfc66309ba --- /dev/null +++ b/doc/workflow/slash_commands.md @@ -0,0 +1,28 @@ +# GitLab slash commands + +Slash commands are textual shortcuts for common actions on issues or merge +requests that are usually done by clicking buttons or dropdowns in GitLab's UI. +You can enter these commands while creating a new issue or merge request, and +in comments. Each command should be on a separate line in order to be properly +detected and executed. + +Here is a list of all of the available commands and descriptions about what they +do. + +| Command | Aliases | Action | +|:---------------------------|:--------------------|:-------------| +| `/close` | None | Close the issue or merge request | +| `/open` | `/reopen` | Reopen the issue or merge request | +| `/assign @username` | `/reassign` | Reassign | +| `/unassign` | `/remove_assignee` | Remove assignee | +| `/milestone %milestone` | None | Change milestone | +| `/clear_milestone` | `/remove_milestone` | Remove milestone | +| `/label ~foo ~"bar baz"` | `/labels` | Add label(s) | +| `/unlabel ~foo ~"bar baz"` | `/remove_label`, `remove_labels` | Remove label(s) | +| `/clear_labels` | `/clear_label` | Clear all labels | +| `/todo` | None | Add a todo | +| `/done` | None | Mark todo as done | +| `/subscribe` | None | Subscribe | +| `/unsubscribe` | None | Unsubscribe | +| `/due_date` | None | Set a due date | +| `/clear_due_date` | None | Remove due date | -- cgit v1.2.1