diff options
author | charlieablett <cablett@gitlab.com> | 2019-09-02 08:35:45 +0300 |
---|---|---|
committer | charlieablett <cablett@gitlab.com> | 2019-09-02 08:35:45 +0300 |
commit | 23bb9424c0f0f872cb33e61169a56abe5e7e6985 (patch) | |
tree | ce9e3a0d21150d641973e79d9913c087c1ebf426 /lib/gitlab/slash_commands | |
parent | cd8d008cb95ce2321b7cdb36433ff40375043ce9 (diff) |
Handle projectless `help` commands to chatops
- Pass in a nil project to Gitlab::SlashCommands::ApplicationHelp.new
if the chatops command is help.
- Modify the Gitlab::SlashCommands::Presenters::Help message to skip
printing out project information.
Diffstat (limited to 'lib/gitlab/slash_commands')
-rw-r--r-- | lib/gitlab/slash_commands/presenters/help.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/gitlab/slash_commands/presenters/help.rb b/lib/gitlab/slash_commands/presenters/help.rb index 5421b0b9a84..bb2298f8395 100644 --- a/lib/gitlab/slash_commands/presenters/help.rb +++ b/lib/gitlab/slash_commands/presenters/help.rb @@ -44,15 +44,21 @@ module Gitlab def help_footer <<~MESSAGE + #{project_info if @project} + *Documentation* + + For more information about GitLab chatops, refer to its + documentation: https://docs.gitlab.com/ce/ci/chatops/README.html. + MESSAGE + end + + def project_info + <<~MESSAGE *Project* The GitLab project for this chatops integration can be found at #{url_for(@project)}. - *Documentation* - - For more information about GitLab chatops, refer to its - documentation: https://docs.gitlab.com/ce/ci/chatops/README.html. MESSAGE end |