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
e9d6d1e5
Commit
e9d6d1e5
authored
Jan 20, 2015
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Custom issue tracker service.
parent
09de0bfc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
1 deletion
+40
-1
app/models/project.rb
app/models/project.rb
+2
-1
app/models/project_services/custom_issue_tracker_service.rb
app/models/project_services/custom_issue_tracker_service.rb
+38
-0
No files found.
app/models/project.rb
View file @
e9d6d1e5
...
@@ -70,6 +70,7 @@ class Project < ActiveRecord::Base
...
@@ -70,6 +70,7 @@ class Project < ActiveRecord::Base
has_one
:pushover_service
,
dependent: :destroy
has_one
:pushover_service
,
dependent: :destroy
has_one
:jira_service
,
dependent: :destroy
has_one
:jira_service
,
dependent: :destroy
has_one
:redmine_service
,
dependent: :destroy
has_one
:redmine_service
,
dependent: :destroy
has_one
:custom_issue_tracker_service
,
dependent: :destroy
has_one
:forked_project_link
,
dependent: :destroy
,
foreign_key:
"forked_to_project_id"
has_one
:forked_project_link
,
dependent: :destroy
,
foreign_key:
"forked_to_project_id"
has_one
:forked_from_project
,
through: :forked_project_link
has_one
:forked_from_project
,
through: :forked_project_link
...
@@ -324,7 +325,7 @@ class Project < ActiveRecord::Base
...
@@ -324,7 +325,7 @@ class Project < ActiveRecord::Base
def
available_services_names
def
available_services_names
%w(gitlab_ci campfire hipchat pivotaltracker flowdock assembla
%w(gitlab_ci campfire hipchat pivotaltracker flowdock assembla
emails_on_push gemnasium slack pushover buildbox bamboo teamcity jira redmine)
emails_on_push gemnasium slack pushover buildbox bamboo teamcity jira redmine
custom_issue_tracker
)
end
end
def
gitlab_ci?
def
gitlab_ci?
...
...
app/models/project_services/custom_issue_tracker_service.rb
0 → 100644
View file @
e9d6d1e5
class
CustomIssueTrackerService
<
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
'Custom Issue Tracker'
end
end
def
description
if
self
.
properties
&&
self
.
properties
[
'description'
].
present?
self
.
properties
[
'description'
]
else
'Custom issue tracker'
end
end
def
to_param
title
.
parameterize
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
self
.
properties
=
{}
if
properties
.
nil?
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