Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
94024cd6
Commit
94024cd6
authored
Feb 28, 2019
by
Douglas Barbosa Alexandre
Committed by
Sean McGivern
Feb 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Jira: Make issue links title compact
Port of a community contribution from @glensc to upstream.
parent
f2753695
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
6 deletions
+16
-6
app/models/project_services/jira_service.rb
app/models/project_services/jira_service.rb
+3
-2
changelogs/unreleased/jira-link-mention-compact.yml
changelogs/unreleased/jira-link-mention-compact.yml
+5
-0
spec/models/project_services/jira_service_spec.rb
spec/models/project_services/jira_service_spec.rb
+2
-1
spec/services/system_note_service_spec.rb
spec/services/system_note_service_spec.rb
+6
-3
No files found.
app/models/project_services/jira_service.rb
View file @
94024cd6
...
...
@@ -215,7 +215,7 @@ class JiraService < IssueTrackerService
end
def
add_issue_solved_comment
(
issue
,
commit_id
,
commit_url
)
link_title
=
"
GitLab:
Solved by commit
#{
commit_id
}
."
link_title
=
"Solved by commit
#{
commit_id
}
."
comment
=
"Issue solved with [
#{
commit_id
}
|
#{
commit_url
}
]."
link_props
=
build_remote_link_props
(
url:
commit_url
,
title:
link_title
,
resolved:
true
)
send_message
(
issue
,
comment
,
link_props
)
...
...
@@ -230,7 +230,7 @@ class JiraService < IssueTrackerService
project_name
=
data
[
:project
][
:name
]
message
=
"[
#{
user_name
}
|
#{
user_url
}
] mentioned this issue in [a
#{
entity_name
}
of
#{
project_name
}
|
#{
entity_url
}
]:
\n
'
#{
entity_title
.
chomp
}
'"
link_title
=
"
GitLab: Mentioned on
#{
entity_nam
e
}
-
#{
entity_title
}
"
link_title
=
"
#{
entity_name
.
capitaliz
e
}
-
#{
entity_title
}
"
link_props
=
build_remote_link_props
(
url:
entity_url
,
title:
link_title
)
unless
comment_exists?
(
issue
,
message
)
...
...
@@ -278,6 +278,7 @@ class JiraService < IssueTrackerService
{
GlobalID
:
'GitLab'
,
relationship:
'mentioned on'
,
object:
{
url:
url
,
title:
title
,
...
...
changelogs/unreleased/jira-link-mention-compact.yml
0 → 100644
View file @
94024cd6
---
title
:
"
Jira:
make
issue
links
title
compact"
merge_request
:
25609
author
:
Elan Ruusamäe @glensc
type
:
changed
spec/models/project_services/jira_service_spec.rb
View file @
94024cd6
...
...
@@ -177,9 +177,10 @@ describe JiraService do
expect
(
WebMock
).
to
have_requested
(
:post
,
@remote_link_url
).
with
(
body:
hash_including
(
GlobalID
:
'GitLab'
,
relationship:
'mentioned on'
,
object:
{
url:
"
#{
Gitlab
.
config
.
gitlab
.
url
}
/
#{
project
.
full_path
}
/commit/
#{
commit_id
}
"
,
title:
"
GitLab:
Solved by commit
#{
commit_id
}
."
,
title:
"Solved by commit
#{
commit_id
}
."
,
icon:
{
title:
'GitLab'
,
url16x16:
favicon_path
},
status:
{
resolved:
true
}
}
...
...
spec/services/system_note_service_spec.rb
View file @
94024cd6
...
...
@@ -807,9 +807,10 @@ describe SystemNoteService do
expect
(
WebMock
).
to
have_requested
(
:post
,
jira_api_remote_link_url
(
jira_issue
)).
with
(
body:
hash_including
(
GlobalID
:
"GitLab"
,
relationship:
'mentioned on'
,
object:
{
url:
project_commit_url
(
project
,
commit
),
title:
"
GitLab: Mentioned on c
ommit -
#{
commit
.
title
}
"
,
title:
"
C
ommit -
#{
commit
.
title
}
"
,
icon:
{
title:
"GitLab"
,
url16x16:
favicon_path
},
status:
{
resolved:
false
}
}
...
...
@@ -833,9 +834,10 @@ describe SystemNoteService do
expect
(
WebMock
).
to
have_requested
(
:post
,
jira_api_remote_link_url
(
jira_issue
)).
with
(
body:
hash_including
(
GlobalID
:
"GitLab"
,
relationship:
'mentioned on'
,
object:
{
url:
project_issue_url
(
project
,
issue
),
title:
"
GitLab: Mentioned on i
ssue -
#{
issue
.
title
}
"
,
title:
"
I
ssue -
#{
issue
.
title
}
"
,
icon:
{
title:
"GitLab"
,
url16x16:
favicon_path
},
status:
{
resolved:
false
}
}
...
...
@@ -859,9 +861,10 @@ describe SystemNoteService do
expect
(
WebMock
).
to
have_requested
(
:post
,
jira_api_remote_link_url
(
jira_issue
)).
with
(
body:
hash_including
(
GlobalID
:
"GitLab"
,
relationship:
'mentioned on'
,
object:
{
url:
project_snippet_url
(
project
,
snippet
),
title:
"
GitLab: Mentioned on s
nippet -
#{
snippet
.
title
}
"
,
title:
"
S
nippet -
#{
snippet
.
title
}
"
,
icon:
{
title:
"GitLab"
,
url16x16:
favicon_path
},
status:
{
resolved:
false
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment