diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 18:42:06 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 18:42:06 +0000 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /lib/gitlab/slash_commands | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) | |
download | gitlab-ce-6e4e1050d9dba2b7b2523fdd1768823ab85feef4.tar.gz |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'lib/gitlab/slash_commands')
-rw-r--r-- | lib/gitlab/slash_commands/presenters/base.rb | 1 | ||||
-rw-r--r-- | lib/gitlab/slash_commands/presenters/issue_search.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/slash_commands/presenters/issue_show.rb | 8 |
3 files changed, 5 insertions, 10 deletions
diff --git a/lib/gitlab/slash_commands/presenters/base.rb b/lib/gitlab/slash_commands/presenters/base.rb index b60f0b78fef..b8affb42372 100644 --- a/lib/gitlab/slash_commands/presenters/base.rb +++ b/lib/gitlab/slash_commands/presenters/base.rb @@ -69,7 +69,6 @@ module Gitlab def resource_url url_for( [ - resource.project.namespace.becomes(Namespace), resource.project, resource ] diff --git a/lib/gitlab/slash_commands/presenters/issue_search.rb b/lib/gitlab/slash_commands/presenters/issue_search.rb index fffa082baac..f5b1670b2e9 100644 --- a/lib/gitlab/slash_commands/presenters/issue_search.rb +++ b/lib/gitlab/slash_commands/presenters/issue_search.rb @@ -22,7 +22,7 @@ module Gitlab def attachments resource.map do |issue| - url = "[#{issue.to_reference}](#{url_for([namespace, project, issue])})" + url = "[#{issue.to_reference}](#{url_for([project, issue])})" { color: color(issue), @@ -39,10 +39,6 @@ module Gitlab def project @project ||= resource.first.project end - - def namespace - @namespace ||= project.namespace.becomes(Namespace) - end end end end diff --git a/lib/gitlab/slash_commands/presenters/issue_show.rb b/lib/gitlab/slash_commands/presenters/issue_show.rb index 448381b64ed..e9df015f249 100644 --- a/lib/gitlab/slash_commands/presenters/issue_show.rb +++ b/lib/gitlab/slash_commands/presenters/issue_show.rb @@ -23,14 +23,14 @@ module Gitlab def text message = ["**#{status_text(resource)}**"] - if resource.upvotes.zero? && resource.downvotes.zero? && resource.user_notes_count.zero? + if resource.upvotes == 0 && resource.downvotes == 0 && resource.user_notes_count == 0 return message.join end message << " ยท " - message << ":+1: #{resource.upvotes} " unless resource.upvotes.zero? - message << ":-1: #{resource.downvotes} " unless resource.downvotes.zero? - message << ":speech_balloon: #{resource.user_notes_count}" unless resource.user_notes_count.zero? + message << ":+1: #{resource.upvotes} " unless resource.upvotes == 0 + message << ":-1: #{resource.downvotes} " unless resource.downvotes == 0 + message << ":speech_balloon: #{resource.user_notes_count}" unless resource.user_notes_count == 0 message.join end |