Commit 6fdc09c7 authored by Douwe Maan's avatar Douwe Maan

Merge branch 'issue_31081' into 'master'

Use host URL to build JIRA remote link icon

Closes #31081

See merge request gitlab-org/gitlab-ce!17541
parents fd09e661 36a0f6aa
class JiraService < IssueTrackerService class JiraService < IssueTrackerService
include Gitlab::Routing include Gitlab::Routing
include ApplicationHelper
include ActionView::Helpers::AssetUrlHelper
validates :url, url: true, presence: true, if: :activated? validates :url, url: true, presence: true, if: :activated?
validates :api_url, url: true, allow_blank: true validates :api_url, url: true, allow_blank: true
...@@ -268,7 +270,9 @@ class JiraService < IssueTrackerService ...@@ -268,7 +270,9 @@ class JiraService < IssueTrackerService
url: url, url: url,
title: title, title: title,
status: status, status: status,
icon: { title: 'GitLab', url16x16: 'https://gitlab.com/favicon.ico' } icon: {
title: 'GitLab', url16x16: asset_url('favicon.ico', host: gitlab_config.url)
}
} }
} }
end end
......
---
title: Use host URL to build JIRA remote link icon
merge_request:
author:
type: other
...@@ -166,7 +166,6 @@ describe JiraService do ...@@ -166,7 +166,6 @@ describe JiraService do
# Creates comment # Creates comment
expect(WebMock).to have_requested(:post, @comment_url) expect(WebMock).to have_requested(:post, @comment_url)
# Creates Remote Link in JIRA issue fields # Creates Remote Link in JIRA issue fields
expect(WebMock).to have_requested(:post, @remote_link_url).with( expect(WebMock).to have_requested(:post, @remote_link_url).with(
body: hash_including( body: hash_including(
...@@ -174,7 +173,7 @@ describe JiraService do ...@@ -174,7 +173,7 @@ describe JiraService do
object: { object: {
url: "#{Gitlab.config.gitlab.url}/#{project.full_path}/commit/#{merge_request.diff_head_sha}", url: "#{Gitlab.config.gitlab.url}/#{project.full_path}/commit/#{merge_request.diff_head_sha}",
title: "GitLab: Solved by commit #{merge_request.diff_head_sha}.", title: "GitLab: Solved by commit #{merge_request.diff_head_sha}.",
icon: { title: "GitLab", url16x16: "https://gitlab.com/favicon.ico" }, icon: { title: "GitLab", url16x16: "http://localhost/favicon.ico" },
status: { resolved: true } status: { resolved: true }
} }
) )
......
...@@ -789,7 +789,7 @@ describe SystemNoteService do ...@@ -789,7 +789,7 @@ describe SystemNoteService do
object: { object: {
url: project_commit_url(project, commit), url: project_commit_url(project, commit),
title: "GitLab: Mentioned on commit - #{commit.title}", title: "GitLab: Mentioned on commit - #{commit.title}",
icon: { title: "GitLab", url16x16: "https://gitlab.com/favicon.ico" }, icon: { title: "GitLab", url16x16: "http://localhost/favicon.ico" },
status: { resolved: false } status: { resolved: false }
} }
) )
...@@ -815,7 +815,7 @@ describe SystemNoteService do ...@@ -815,7 +815,7 @@ describe SystemNoteService do
object: { object: {
url: project_issue_url(project, issue), url: project_issue_url(project, issue),
title: "GitLab: Mentioned on issue - #{issue.title}", title: "GitLab: Mentioned on issue - #{issue.title}",
icon: { title: "GitLab", url16x16: "https://gitlab.com/favicon.ico" }, icon: { title: "GitLab", url16x16: "http://localhost/favicon.ico" },
status: { resolved: false } status: { resolved: false }
} }
) )
...@@ -841,7 +841,7 @@ describe SystemNoteService do ...@@ -841,7 +841,7 @@ describe SystemNoteService do
object: { object: {
url: project_snippet_url(project, snippet), url: project_snippet_url(project, snippet),
title: "GitLab: Mentioned on snippet - #{snippet.title}", title: "GitLab: Mentioned on snippet - #{snippet.title}",
icon: { title: "GitLab", url16x16: "https://gitlab.com/favicon.ico" }, icon: { title: "GitLab", url16x16: "http://localhost/favicon.ico" },
status: { resolved: false } status: { resolved: false }
} }
) )
......
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