debian-mirror-gitlab/app/models/project_services/gitlab_issue_tracker_service.rb

48 lines
859 B
Ruby
Raw Normal View History

2018-11-20 20:47:30 +05:30
# frozen_string_literal: true
2015-04-26 12:48:37 +05:30
class GitlabIssueTrackerService < IssueTrackerService
2017-09-10 17:25:29 +05:30
include Gitlab::Routing
2015-04-26 12:48:37 +05:30
2018-11-08 19:23:39 +05:30
validates :project_url, :issues_url, :new_issue_url, presence: true, public_url: true, if: :activated?
2017-08-17 22:00:37 +05:30
2019-09-30 21:07:59 +05:30
prop_accessor :project_url, :issues_url, :new_issue_url
2015-04-26 12:48:37 +05:30
2016-01-29 22:53:50 +05:30
default_value_for :default, true
2015-04-26 12:48:37 +05:30
2019-09-30 21:07:59 +05:30
def default_title
'GitLab'
end
def default_description
s_('IssueTracker|GitLab issue tracker')
end
2017-08-17 22:00:37 +05:30
def self.to_param
2015-04-26 12:48:37 +05:30
'gitlab'
end
def project_url
2017-09-10 17:25:29 +05:30
project_issues_url(project)
2015-04-26 12:48:37 +05:30
end
def new_issue_url
2017-09-10 17:25:29 +05:30
new_project_issue_url(project)
2015-04-26 12:48:37 +05:30
end
def issue_url(iid)
2017-09-10 17:25:29 +05:30
project_issue_url(project, id: iid)
2015-04-26 12:48:37 +05:30
end
2017-09-10 17:25:29 +05:30
def issue_tracker_path
project_issues_path(project)
2015-04-26 12:48:37 +05:30
end
def new_issue_path
2017-09-10 17:25:29 +05:30
new_project_issue_path(project)
2015-04-26 12:48:37 +05:30
end
def issue_path(iid)
2017-09-10 17:25:29 +05:30
project_issue_path(project, id: iid)
2015-04-26 12:48:37 +05:30
end
end