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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
4a1898a6
Commit
4a1898a6
authored
Feb 10, 2021
by
Tom Quirk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add gitlab_web_url to jira issue entity
parent
92757043
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
ee/app/serializers/integrations/jira/issue_entity.rb
ee/app/serializers/integrations/jira/issue_entity.rb
+10
-0
ee/spec/serializers/integrations/jira/issue_entity_spec.rb
ee/spec/serializers/integrations/jira/issue_entity_spec.rb
+11
-0
No files found.
ee/app/serializers/integrations/jira/issue_entity.rb
View file @
4a1898a6
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
module
Integrations
module
Integrations
module
Jira
module
Jira
class
IssueEntity
<
Grape
::
Entity
class
IssueEntity
<
Grape
::
Entity
include
RequestAwareEntity
expose
:project_id
do
|
_jira_issue
,
options
|
expose
:project_id
do
|
_jira_issue
,
options
|
options
[
:project
].
id
options
[
:project
].
id
end
end
...
@@ -61,6 +63,14 @@ module Integrations
...
@@ -61,6 +63,14 @@ module Integrations
"
#{
base_web_url
(
jira_issue
)
}
/browse/
#{
jira_issue
.
key
}
"
"
#{
base_web_url
(
jira_issue
)
}
/browse/
#{
jira_issue
.
key
}
"
end
end
expose
:gitlab_web_url
do
|
jira_issue
|
if
::
Feature
.
enabled?
(
:jira_issues_show_integration
,
options
[
:project
],
default_enabled: :yaml
)
project_integrations_jira_issue_path
(
options
[
:project
],
jira_issue
.
key
)
else
nil
end
end
expose
:references
do
|
jira_issue
|
expose
:references
do
|
jira_issue
|
{
{
relative:
jira_issue
.
key
relative:
jira_issue
.
key
...
...
ee/spec/serializers/integrations/jira/issue_entity_spec.rb
View file @
4a1898a6
...
@@ -76,6 +76,7 @@ RSpec.describe Integrations::Jira::IssueEntity do
...
@@ -76,6 +76,7 @@ RSpec.describe Integrations::Jira::IssueEntity do
it
'returns URLs including context path'
do
it
'returns URLs including context path'
do
expect
(
subject
[
:author
]).
to
include
(
web_url:
'http://jira.com/jira-sub-path/secure/ViewProfile.jspa?name=reporter@reporter.com'
)
expect
(
subject
[
:author
]).
to
include
(
web_url:
'http://jira.com/jira-sub-path/secure/ViewProfile.jspa?name=reporter@reporter.com'
)
expect
(
subject
[
:web_url
]).
to
eq
(
'http://jira.com/jira-sub-path/browse/GL-5'
)
expect
(
subject
[
:web_url
]).
to
eq
(
'http://jira.com/jira-sub-path/browse/GL-5'
)
expect
(
subject
[
:gitlab_web_url
]).
to
eq
(
Gitlab
::
Routing
.
url_helpers
.
project_integrations_jira_issue_path
(
project
,
'GL-5'
))
end
end
end
end
end
end
...
@@ -109,4 +110,14 @@ RSpec.describe Integrations::Jira::IssueEntity do
...
@@ -109,4 +110,14 @@ RSpec.describe Integrations::Jira::IssueEntity do
expect
(
subject
).
to
include
(
labels:
[])
expect
(
subject
).
to
include
(
labels:
[])
end
end
end
end
context
'feature flag "jira_issues_show_integration" is disabled'
do
before
do
stub_feature_flags
(
jira_issues_show_integration:
false
)
end
it
'sets `gitlab_web_url` to nil'
do
expect
(
subject
[
:gitlab_web_url
]).
to
eq
(
nil
)
end
end
end
end
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