2018-08-10 06:45:01 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-01-28 17:28:17 +00:00
|
|
|
class GitlabIssueTrackerService < IssueTrackerService
|
2017-07-07 15:43:37 +00:00
|
|
|
include Gitlab::Routing
|
2015-01-28 17:28:17 +00:00
|
|
|
|
2018-06-01 11:43:53 +00:00
|
|
|
validates :project_url, :issues_url, :new_issue_url, presence: true, public_url: true, if: :activated?
|
2016-09-29 21:11:32 +00:00
|
|
|
|
2015-03-24 16:20:05 +00:00
|
|
|
prop_accessor :title, :description, :project_url, :issues_url, :new_issue_url
|
2015-01-28 17:28:17 +00:00
|
|
|
|
2016-01-19 12:48:07 +00:00
|
|
|
default_value_for :default, true
|
2015-01-28 17:28:17 +00:00
|
|
|
|
2016-12-27 12:44:24 +00:00
|
|
|
def self.to_param
|
2015-01-28 17:28:17 +00:00
|
|
|
'gitlab'
|
|
|
|
end
|
2015-01-28 21:19:32 +00:00
|
|
|
|
|
|
|
def project_url
|
2017-06-29 17:06:35 +00:00
|
|
|
project_issues_url(project)
|
2015-01-28 21:19:32 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def new_issue_url
|
2017-06-29 17:06:35 +00:00
|
|
|
new_project_issue_url(project)
|
2015-01-28 21:19:32 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def issue_url(iid)
|
2017-06-29 17:06:35 +00:00
|
|
|
project_issue_url(project, id: iid)
|
2015-01-28 21:19:32 +00:00
|
|
|
end
|
2015-03-25 09:03:55 +00:00
|
|
|
|
2017-07-17 18:56:35 +00:00
|
|
|
def issue_tracker_path
|
2017-06-29 17:06:35 +00:00
|
|
|
project_issues_path(project)
|
2015-03-25 09:03:55 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def new_issue_path
|
2017-06-29 17:06:35 +00:00
|
|
|
new_project_issue_path(project)
|
2015-03-25 09:03:55 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def issue_path(iid)
|
2017-06-29 17:06:35 +00:00
|
|
|
project_issue_path(project, id: iid)
|
2015-03-25 09:03:55 +00:00
|
|
|
end
|
2015-01-28 17:28:17 +00:00
|
|
|
end
|