Class: CustomIssueTrackerService

Inherits:
IssueTrackerService show all
Defined in:
app/models/project_services/custom_issue_tracker_service.rb

Overview

Schema Information

Table name: services

id                    :integer          not null, primary key
type                  :string
title                 :string
project_id            :integer
created_at            :datetime         not null
updated_at            :datetime         not null
active                :boolean          not null
properties            :text
template              :boolean          default(FALSE)
push_events           :boolean          default(TRUE)
issues_events         :boolean          default(TRUE)
merge_requests_events :boolean          default(TRUE)
tag_push_events       :boolean          default(TRUE)
note_events           :boolean          default(TRUE), not null
build_events          :boolean          default(FALSE), not null
category              :string           default("common"), not null
default               :boolean          default(FALSE)
wiki_page_events      :boolean          default(TRUE)

Instance Method Summary collapse

Methods inherited from IssueTrackerService

#default?, #execute, #issue_path, #issue_url, #new_issue_path, #project_path, #supported_events

Methods inherited from Service

#activated?, #async_execute, available_services_names, boolean_accessor, #can_test?, #category, create_from_template, #execute, #help, #issue_tracker?, prop_accessor, #reset_updated_properties, #supported_events, #template?, #test, #updated_properties

Instance Method Details

#descriptionObject


37
38
39
40
41
42
43
# File 'app/models/project_services/custom_issue_tracker_service.rb', line 37

def description
  if self.properties && self.properties['description'].present?
    self.properties['description']
  else
    'Custom issue tracker'
  end
end

#fieldsObject


49
50
51
52
53
54
55
56
57
# File 'app/models/project_services/custom_issue_tracker_service.rb', line 49

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

#initialize_propertiesObject


59
60
61
# File 'app/models/project_services/custom_issue_tracker_service.rb', line 59

def initialize_properties
  self.properties = {} if properties.nil?
end

#titleObject


29
30
31
32
33
34
35
# File 'app/models/project_services/custom_issue_tracker_service.rb', line 29

def title
  if self.properties && self.properties['title'].present?
    self.properties['title']
  else
    'Custom Issue Tracker'
  end
end

#to_paramObject


45
46
47
# File 'app/models/project_services/custom_issue_tracker_service.rb', line 45

def to_param
  'custom_issue_tracker'
end