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
Kazuhiko Shiozaki
gitlab-ce
Commits
103a1bb0
Commit
103a1bb0
authored
Jan 23, 2015
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use service settings instead of config file settings to present issues.
parent
737f6516
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
14 deletions
+24
-14
app/helpers/issues_helper.rb
app/helpers/issues_helper.rb
+3
-8
app/models/project.rb
app/models/project.rb
+12
-0
app/models/project_services/issue_tracker_service.rb
app/models/project_services/issue_tracker_service.rb
+4
-0
app/models/project_services/redmine_service.rb
app/models/project_services/redmine_service.rb
+2
-2
lib/gitlab/markdown.rb
lib/gitlab/markdown.rb
+3
-4
No files found.
app/helpers/issues_helper.rb
View file @
103a1bb0
...
...
@@ -16,7 +16,7 @@ module IssuesHelper
def
url_for_project_issues
(
project
=
@project
)
return
''
if
project
.
nil?
if
project
.
used_default_issues_tracker?
||
!
external_issues_tracker_enabled?
if
project
.
used_default_issues_tracker?
||
!
project
.
external_issues_tracker_enabled?
project_issues_path
(
project
)
else
url
=
Gitlab
.
config
.
issues_tracker
[
project
.
issues_tracker
][
'project_url'
]
...
...
@@ -28,7 +28,7 @@ module IssuesHelper
def
url_for_new_issue
(
project
=
@project
)
return
''
if
project
.
nil?
if
project
.
used_default_issues_tracker?
||
!
external_issues_tracker_enabled?
if
project
.
used_default_issues_tracker?
||
!
project
.
external_issues_tracker_enabled?
url
=
new_project_issue_path
project_id:
project
else
issues_tracker
=
Gitlab
.
config
.
issues_tracker
[
project
.
issues_tracker
]
...
...
@@ -41,7 +41,7 @@ module IssuesHelper
def
url_for_issue
(
issue_iid
,
project
=
@project
)
return
''
if
project
.
nil?
if
project
.
used_default_issues_tracker?
||
!
external_issues_tracker_enabled?
if
project
.
used_default_issues_tracker?
||
!
project
.
external_issues_tracker_enabled?
url
=
project_issue_url
project_id:
project
,
id:
issue_iid
else
url
=
Gitlab
.
config
.
issues_tracker
[
project
.
issues_tracker
][
'issues_url'
]
...
...
@@ -77,11 +77,6 @@ module IssuesHelper
ts
.
html_safe
end
# Checks if issues_tracker setting exists in gitlab.yml
def
external_issues_tracker_enabled?
Gitlab
.
config
.
issues_tracker
&&
Gitlab
.
config
.
issues_tracker
.
values
.
any?
end
def
bulk_update_milestone_options
options_for_select
([
'None (backlog)'
])
+
options_from_collection_for_select
(
project_active_milestones
,
'id'
,
...
...
app/models/project.rb
View file @
103a1bb0
...
...
@@ -309,6 +309,18 @@ class Project < ActiveRecord::Base
self
.
issues_tracker
==
Project
.
issues_tracker
.
default_value
end
def
external_issues_tracker_enabled?
external_issues_trackers
.
any?
end
def
external_issues_trackers
services
.
select
{
|
service
|
service
.
category
==
:issue_tracker
}
end
def
external_issue_tracker
@external_issues_tracker
||=
external_issues_trackers
.
select
(
&
:activated?
).
first
end
def
can_have_issues_tracker_id?
self
.
issues_enabled
&&
!
self
.
used_default_issues_tracker?
end
...
...
app/models/project_services/issue_tracker_service.rb
View file @
103a1bb0
class
IssueTrackerService
<
Service
def
category
:issue_tracker
end
def
project_url
# implement inside child
end
...
...
app/models/project_services/redmine_service.rb
View file @
103a1bb0
...
...
@@ -48,9 +48,9 @@ class RedmineService < IssueTrackerService
end
def
set_project_url
id
=
self
.
project
.
issue_tracker_id
id
=
self
.
project
.
issue
s
_tracker_id
if
id
issues_tracker
[
'project_url'
].
gsub
(
":issue_tracker_id"
,
id
)
issues_tracker
[
'project_url'
].
gsub
(
":issue
s
_tracker_id"
,
id
)
else
issues_tracker
[
'project_url'
]
end
...
...
lib/gitlab/markdown.rb
View file @
103a1bb0
...
...
@@ -208,7 +208,7 @@ module Gitlab
end
def
reference_issue
(
identifier
,
project
=
@project
,
prefix_text
=
nil
)
if
project
.
used_default_issues_tracker?
||
!
external_issues_tracker_enabled?
if
project
.
used_default_issues_tracker?
||
!
project
.
external_issues_tracker_enabled?
if
project
.
issue_exists?
identifier
url
=
url_for_issue
(
identifier
,
project
)
title
=
title_for_issue
(
identifier
,
project
)
...
...
@@ -220,8 +220,7 @@ module Gitlab
link_to
(
"
#{
prefix_text
}
#
#{
identifier
}
"
,
url
,
options
)
end
else
config
=
Gitlab
.
config
external_issue_tracker
=
config
.
issues_tracker
[
project
.
issues_tracker
]
external_issue_tracker
=
project
.
external_issue_tracker
if
external_issue_tracker
.
present?
reference_external_issue
(
identifier
,
external_issue_tracker
,
project
,
prefix_text
)
...
...
@@ -270,7 +269,7 @@ module Gitlab
def
reference_external_issue
(
identifier
,
issue_tracker
,
project
=
@project
,
prefix_text
=
nil
)
url
=
url_for_issue
(
identifier
,
project
)
title
=
issue_tracker
[
'title'
]
title
=
issue_tracker
.
title
options
=
html_options
.
merge
(
title:
"Issue in
#{
title
}
"
,
...
...
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