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
9371c6b9
Commit
9371c6b9
authored
Jan 20, 2015
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add issue tracker services.
parent
148740cc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
124 additions
and
0 deletions
+124
-0
app/models/project_services/issue_tracker_service.rb
app/models/project_services/issue_tracker_service.rb
+14
-0
app/models/project_services/jira_service.rb
app/models/project_services/jira_service.rb
+59
-0
app/models/project_services/redmine_service.rb
app/models/project_services/redmine_service.rb
+51
-0
No files found.
app/models/project_services/issue_tracker_service.rb
0 → 100644
View file @
9371c6b9
class
IssueTrackerService
<
Service
def
project_url
# implement inside child
end
def
issues_url
# implement inside child
end
def
new_issue_url
# implement inside child
end
end
app/models/project_services/jira_service.rb
0 → 100644
View file @
9371c6b9
class
JiraService
<
IssueTrackerService
prop_accessor
:title
,
:description
,
:project_url
,
:issues_url
,
:new_issue_url
def
title
if
self
.
properties
&&
self
.
properties
[
'title'
].
present?
self
.
properties
[
'title'
]
else
'JIRA'
end
end
def
description
if
self
.
properties
&&
self
.
properties
[
'description'
].
present?
self
.
properties
[
'description'
]
else
'Jira issue tracker'
end
end
def
to_param
'jira'
end
def
fields
[
{
type:
'text'
,
name:
'title'
,
placeholder:
title
},
{
type:
'text'
,
name:
'description'
,
placeholder:
description
},
{
type:
'text'
,
name:
'project_url'
,
placeholder:
'Project url'
},
{
type:
'text'
,
name:
'issues_url'
,
placeholder:
'Issue url'
},
{
type:
'text'
,
name:
'new_issue_url'
,
placeholder:
'New Issue url'
}
]
end
def
initialize_properties
if
properties
.
nil?
if
enabled_in_gitlab_config
self
.
properties
=
{
title:
issues_tracker
[
'title'
],
project_url:
issues_tracker
[
'project_url'
],
issues_url:
issues_tracker
[
'issues_url'
],
new_issue_url:
issues_tracker
[
'new_issue_url'
]
}
end
end
end
private
def
enabled_in_gitlab_config
Gitlab
.
config
.
issues_tracker
&&
Gitlab
.
config
.
issues_tracker
.
values
.
any?
&&
issues_tracker
end
def
issues_tracker
Gitlab
.
config
.
issues_tracker
[
'jira'
]
end
end
app/models/project_services/redmine_service.rb
0 → 100644
View file @
9371c6b9
class
RedmineService
<
IssueTrackerService
prop_accessor
:title
,
:description
,
:project_url
,
:issues_url
,
:new_issue_url
def
title
'Redmine'
end
def
description
'Redmine issue tracker'
end
def
to_param
'redmine'
end
def
fields
[
{
type:
'text'
,
name:
'title'
,
placeholder:
title
},
{
type:
'text'
,
name:
'description'
,
placeholder:
description
},
{
type:
'text'
,
name:
'project_url'
,
placeholder:
'Project url'
},
{
type:
'text'
,
name:
'issues_url'
,
placeholder:
'Issue url'
},
{
type:
'text'
,
name:
'new_issue_url'
,
placeholder:
'New Issue url'
}
]
end
def
initialize_properties
if
properties
.
nil?
if
enabled_in_gitlab_config
self
.
properties
=
{
title:
issues_tracker
[
'title'
],
project_url:
issues_tracker
[
'project_url'
],
issues_url:
issues_tracker
[
'issues_url'
],
new_issue_url:
issues_tracker
[
'new_issue_url'
]
}
end
end
end
private
def
enabled_in_gitlab_config
Gitlab
.
config
.
issues_tracker
&&
Gitlab
.
config
.
issues_tracker
.
values
.
any?
&&
issues_tracker
end
def
issues_tracker
Gitlab
.
config
.
issues_tracker
[
'redmine'
]
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