From ea090291bba6bb665b3631cc5a2659e6673a6959 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Wed, 31 May 2017 00:50:53 -0500 Subject: Rename "Slash commands" to "Quick actions" Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/27070 Deprecate "chat commands" in favor of "slash commands" We looked for things like: - `slash commmand` - `slash_command` - `slash-command` - `SlashCommand` --- app/assets/javascripts/gfm_auto_complete.js | 6 +- .../issue_show/components/fields/description.vue | 2 +- app/assets/javascripts/notes.js | 44 +- app/assets/javascripts/preview_markdown.js | 2 +- .../sidebar/components/time_tracking/help_state.js | 4 +- .../time_tracking/sidebar_time_tracking.js | 8 +- app/helpers/notes_helper.rb | 4 +- app/models/merge_request.rb | 2 +- app/models/note.rb | 2 +- .../chat_slash_commands_service.rb | 52 - .../mattermost_slash_commands_service.rb | 2 +- .../slack_slash_commands_service.rb | 2 +- .../project_services/slash_commands_service.rb | 52 + app/policies/global_policy.rb | 2 +- app/services/issuable_base_service.rb | 6 +- app/services/merge_requests/update_service.rb | 6 +- app/services/notes/create_service.rb | 8 +- app/services/notes/quick_actions_service.rb | 36 + app/services/notes/slash_commands_service.rb | 36 - app/services/preview_markdown_service.rb | 12 +- app/services/projects/autocomplete_service.rb | 2 +- app/services/quick_actions/interpret_service.rb | 515 ++++++++++ app/services/slash_commands/interpret_service.rb | 515 ---------- app/views/projects/_zen.html.haml | 4 +- .../projects/issues/_issue_by_email.html.haml | 2 +- .../shared/form_elements/_description.html.haml | 10 +- app/views/shared/notes/_form.html.haml | 10 +- app/views/shared/notes/_hints.html.haml | 6 +- ...7070-rename-slash-commands-to-quick-actions.yml | 5 + doc/README.md | 2 +- doc/development/limit_ee_conflicts.md | 4 +- doc/integration/chat_commands.md | 15 +- doc/integration/slash_commands.md | 14 + doc/user/discussions/index.md | 4 +- .../project/integrations/slack_slash_commands.md | 4 +- doc/user/project/issues/issues_functionalities.md | 4 +- doc/user/project/quick_actions.md | 39 + doc/user/project/slash_commands.md | 40 +- doc/workflow/README.md | 2 +- doc/workflow/time_tracking.md | 8 +- lib/api/services.rb | 4 +- lib/api/v3/services.rb | 4 +- lib/gitlab/chat_commands/base_command.rb | 47 - lib/gitlab/chat_commands/command.rb | 44 - lib/gitlab/chat_commands/deploy.rb | 50 - lib/gitlab/chat_commands/help.rb | 28 - lib/gitlab/chat_commands/issue_command.rb | 13 - lib/gitlab/chat_commands/issue_new.rb | 42 - lib/gitlab/chat_commands/issue_search.rb | 23 - lib/gitlab/chat_commands/issue_show.rb | 23 - lib/gitlab/chat_commands/presenters/access.rb | 40 - lib/gitlab/chat_commands/presenters/base.rb | 77 -- lib/gitlab/chat_commands/presenters/deploy.rb | 21 - lib/gitlab/chat_commands/presenters/help.rb | 27 - lib/gitlab/chat_commands/presenters/issue_base.rb | 43 - lib/gitlab/chat_commands/presenters/issue_new.rb | 50 - .../chat_commands/presenters/issue_search.rb | 47 - lib/gitlab/chat_commands/presenters/issue_show.rb | 61 -- lib/gitlab/chat_commands/result.rb | 5 - lib/gitlab/quick_actions/command_definition.rb | 89 ++ lib/gitlab/quick_actions/dsl.rb | 140 +++ lib/gitlab/quick_actions/extractor.rb | 122 +++ lib/gitlab/slash_commands/base_command.rb | 47 + lib/gitlab/slash_commands/command.rb | 44 + lib/gitlab/slash_commands/command_definition.rb | 89 -- lib/gitlab/slash_commands/deploy.rb | 50 + lib/gitlab/slash_commands/dsl.rb | 140 --- lib/gitlab/slash_commands/extractor.rb | 122 --- lib/gitlab/slash_commands/help.rb | 28 + lib/gitlab/slash_commands/issue_command.rb | 13 + lib/gitlab/slash_commands/issue_new.rb | 42 + lib/gitlab/slash_commands/issue_search.rb | 23 + lib/gitlab/slash_commands/issue_show.rb | 23 + lib/gitlab/slash_commands/presenters/access.rb | 40 + lib/gitlab/slash_commands/presenters/base.rb | 77 ++ lib/gitlab/slash_commands/presenters/deploy.rb | 21 + lib/gitlab/slash_commands/presenters/help.rb | 27 + lib/gitlab/slash_commands/presenters/issue_base.rb | 43 + lib/gitlab/slash_commands/presenters/issue_new.rb | 50 + .../slash_commands/presenters/issue_search.rb | 47 + lib/gitlab/slash_commands/presenters/issue_show.rb | 61 ++ lib/gitlab/slash_commands/result.rb | 5 + .../controllers/projects/issues_controller_spec.rb | 2 +- spec/features/issues/award_emoji_spec.rb | 8 +- spec/features/issues/gfm_autocomplete_spec.rb | 2 +- .../issues/user_uses_slash_commands_spec.rb | 6 +- .../user_uses_slash_commands_spec.rb | 6 +- spec/javascripts/notes_spec.js | 48 +- spec/lib/gitlab/chat_commands/command_spec.rb | 111 --- spec/lib/gitlab/chat_commands/deploy_spec.rb | 90 -- spec/lib/gitlab/chat_commands/issue_new_spec.rb | 78 -- spec/lib/gitlab/chat_commands/issue_search_spec.rb | 48 - spec/lib/gitlab/chat_commands/issue_show_spec.rb | 59 -- .../gitlab/chat_commands/presenters/access_spec.rb | 49 - .../gitlab/chat_commands/presenters/deploy_spec.rb | 47 - .../chat_commands/presenters/issue_new_spec.rb | 17 - .../chat_commands/presenters/issue_search_spec.rb | 25 - .../chat_commands/presenters/issue_show_spec.rb | 52 - .../email/handler/create_note_handler_spec.rb | 2 +- .../quick_actions/command_definition_spec.rb | 225 +++++ spec/lib/gitlab/quick_actions/dsl_spec.rb | 109 ++ spec/lib/gitlab/quick_actions/extractor_spec.rb | 223 +++++ .../slash_commands/command_definition_spec.rb | 225 ----- spec/lib/gitlab/slash_commands/command_spec.rb | 111 +++ spec/lib/gitlab/slash_commands/deploy_spec.rb | 90 ++ spec/lib/gitlab/slash_commands/dsl_spec.rb | 109 -- spec/lib/gitlab/slash_commands/extractor_spec.rb | 223 ----- spec/lib/gitlab/slash_commands/issue_new_spec.rb | 78 ++ .../lib/gitlab/slash_commands/issue_search_spec.rb | 48 + spec/lib/gitlab/slash_commands/issue_show_spec.rb | 59 ++ .../slash_commands/presenters/access_spec.rb | 49 + .../slash_commands/presenters/deploy_spec.rb | 47 + .../slash_commands/presenters/issue_new_spec.rb | 17 + .../slash_commands/presenters/issue_search_spec.rb | 25 + .../slash_commands/presenters/issue_show_spec.rb | 52 + spec/models/merge_request_spec.rb | 24 +- spec/services/issues/create_service_spec.rb | 4 +- .../services/merge_requests/create_service_spec.rb | 4 +- spec/services/notes/quick_actions_service_spec.rb | 252 +++++ spec/services/notes/slash_commands_service_spec.rb | 252 ----- spec/services/preview_markdown_service_spec.rb | 18 +- .../quick_actions/interpret_service_spec.rb | 1042 ++++++++++++++++++++ .../slash_commands/interpret_service_spec.rb | 1042 -------------------- .../support/chat_slash_commands_shared_examples.rb | 2 +- .../issuable_slash_commands_shared_examples.rb | 6 +- spec/support/quick_actions_helpers.rb | 10 + ...reate_service_slash_commands_shared_examples.rb | 2 +- spec/support/slash_commands_helpers.rb | 10 - spec/support/time_tracking_shared_examples.rb | 8 +- spec/views/shared/notes/_form.html.haml_spec.rb | 6 +- 130 files changed, 4257 insertions(+), 4250 deletions(-) delete mode 100644 app/models/project_services/chat_slash_commands_service.rb create mode 100644 app/models/project_services/slash_commands_service.rb create mode 100644 app/services/notes/quick_actions_service.rb delete mode 100644 app/services/notes/slash_commands_service.rb create mode 100644 app/services/quick_actions/interpret_service.rb delete mode 100644 app/services/slash_commands/interpret_service.rb create mode 100644 changelogs/unreleased/27070-rename-slash-commands-to-quick-actions.yml create mode 100644 doc/integration/slash_commands.md create mode 100644 doc/user/project/quick_actions.md delete mode 100644 lib/gitlab/chat_commands/base_command.rb delete mode 100644 lib/gitlab/chat_commands/command.rb delete mode 100644 lib/gitlab/chat_commands/deploy.rb delete mode 100644 lib/gitlab/chat_commands/help.rb delete mode 100644 lib/gitlab/chat_commands/issue_command.rb delete mode 100644 lib/gitlab/chat_commands/issue_new.rb delete mode 100644 lib/gitlab/chat_commands/issue_search.rb delete mode 100644 lib/gitlab/chat_commands/issue_show.rb delete mode 100644 lib/gitlab/chat_commands/presenters/access.rb delete mode 100644 lib/gitlab/chat_commands/presenters/base.rb delete mode 100644 lib/gitlab/chat_commands/presenters/deploy.rb delete mode 100644 lib/gitlab/chat_commands/presenters/help.rb delete mode 100644 lib/gitlab/chat_commands/presenters/issue_base.rb delete mode 100644 lib/gitlab/chat_commands/presenters/issue_new.rb delete mode 100644 lib/gitlab/chat_commands/presenters/issue_search.rb delete mode 100644 lib/gitlab/chat_commands/presenters/issue_show.rb delete mode 100644 lib/gitlab/chat_commands/result.rb create mode 100644 lib/gitlab/quick_actions/command_definition.rb create mode 100644 lib/gitlab/quick_actions/dsl.rb create mode 100644 lib/gitlab/quick_actions/extractor.rb create mode 100644 lib/gitlab/slash_commands/base_command.rb create mode 100644 lib/gitlab/slash_commands/command.rb delete mode 100644 lib/gitlab/slash_commands/command_definition.rb create mode 100644 lib/gitlab/slash_commands/deploy.rb delete mode 100644 lib/gitlab/slash_commands/dsl.rb delete mode 100644 lib/gitlab/slash_commands/extractor.rb create mode 100644 lib/gitlab/slash_commands/help.rb create mode 100644 lib/gitlab/slash_commands/issue_command.rb create mode 100644 lib/gitlab/slash_commands/issue_new.rb create mode 100644 lib/gitlab/slash_commands/issue_search.rb create mode 100644 lib/gitlab/slash_commands/issue_show.rb create mode 100644 lib/gitlab/slash_commands/presenters/access.rb create mode 100644 lib/gitlab/slash_commands/presenters/base.rb create mode 100644 lib/gitlab/slash_commands/presenters/deploy.rb create mode 100644 lib/gitlab/slash_commands/presenters/help.rb create mode 100644 lib/gitlab/slash_commands/presenters/issue_base.rb create mode 100644 lib/gitlab/slash_commands/presenters/issue_new.rb create mode 100644 lib/gitlab/slash_commands/presenters/issue_search.rb create mode 100644 lib/gitlab/slash_commands/presenters/issue_show.rb create mode 100644 lib/gitlab/slash_commands/result.rb delete mode 100644 spec/lib/gitlab/chat_commands/command_spec.rb delete mode 100644 spec/lib/gitlab/chat_commands/deploy_spec.rb delete mode 100644 spec/lib/gitlab/chat_commands/issue_new_spec.rb delete mode 100644 spec/lib/gitlab/chat_commands/issue_search_spec.rb delete mode 100644 spec/lib/gitlab/chat_commands/issue_show_spec.rb delete mode 100644 spec/lib/gitlab/chat_commands/presenters/access_spec.rb delete mode 100644 spec/lib/gitlab/chat_commands/presenters/deploy_spec.rb delete mode 100644 spec/lib/gitlab/chat_commands/presenters/issue_new_spec.rb delete mode 100644 spec/lib/gitlab/chat_commands/presenters/issue_search_spec.rb delete mode 100644 spec/lib/gitlab/chat_commands/presenters/issue_show_spec.rb create mode 100644 spec/lib/gitlab/quick_actions/command_definition_spec.rb create mode 100644 spec/lib/gitlab/quick_actions/dsl_spec.rb create mode 100644 spec/lib/gitlab/quick_actions/extractor_spec.rb delete mode 100644 spec/lib/gitlab/slash_commands/command_definition_spec.rb create mode 100644 spec/lib/gitlab/slash_commands/command_spec.rb create mode 100644 spec/lib/gitlab/slash_commands/deploy_spec.rb delete mode 100644 spec/lib/gitlab/slash_commands/dsl_spec.rb delete mode 100644 spec/lib/gitlab/slash_commands/extractor_spec.rb create mode 100644 spec/lib/gitlab/slash_commands/issue_new_spec.rb create mode 100644 spec/lib/gitlab/slash_commands/issue_search_spec.rb create mode 100644 spec/lib/gitlab/slash_commands/issue_show_spec.rb create mode 100644 spec/lib/gitlab/slash_commands/presenters/access_spec.rb create mode 100644 spec/lib/gitlab/slash_commands/presenters/deploy_spec.rb create mode 100644 spec/lib/gitlab/slash_commands/presenters/issue_new_spec.rb create mode 100644 spec/lib/gitlab/slash_commands/presenters/issue_search_spec.rb create mode 100644 spec/lib/gitlab/slash_commands/presenters/issue_show_spec.rb create mode 100644 spec/services/notes/quick_actions_service_spec.rb delete mode 100644 spec/services/notes/slash_commands_service_spec.rb create mode 100644 spec/services/quick_actions/interpret_service_spec.rb delete mode 100644 spec/services/slash_commands/interpret_service_spec.rb create mode 100644 spec/support/quick_actions_helpers.rb delete mode 100644 spec/support/slash_commands_helpers.rb diff --git a/app/assets/javascripts/gfm_auto_complete.js b/app/assets/javascripts/gfm_auto_complete.js index 401dec1a370..105762cb1ba 100644 --- a/app/assets/javascripts/gfm_auto_complete.js +++ b/app/assets/javascripts/gfm_auto_complete.js @@ -34,7 +34,7 @@ class GfmAutoComplete { const $input = $(input); $input.off('focus.setupAtWho').on('focus.setupAtWho', this.setupAtWho.bind(this, $input)); // This triggers at.js again - // Needed for slash commands with suffixes (ex: /label ~) + // Needed for quick actions with suffixes (ex: /label ~) $input.on('inserted-commands.atwho', $input.trigger.bind($input, 'keyup')); $input.on('clear-commands-cache.atwho', () => this.clearCache()); }); @@ -48,8 +48,8 @@ class GfmAutoComplete { if (this.enableMap.mergeRequests) this.setupMergeRequests($input); if (this.enableMap.labels) this.setupLabels($input); - // We don't instantiate the slash commands autocomplete for note and issue/MR edit forms - $input.filter('[data-supports-slash-commands="true"]').atwho({ + // We don't instantiate the quick actions autocomplete for note and issue/MR edit forms + $input.filter('[data-supports-quick-actions="true"]').atwho({ at: '/', alias: 'commands', searchKey: 'search', diff --git a/app/assets/javascripts/issue_show/components/fields/description.vue b/app/assets/javascripts/issue_show/components/fields/description.vue index 30a1be5cb50..54650d2f184 100644 --- a/app/assets/javascripts/issue_show/components/fields/description.vue +++ b/app/assets/javascripts/issue_show/components/fields/description.vue @@ -41,7 +41,7 @@