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