Class: Integrations::JiraCloudApp

Inherits:
Integration show all
Includes:
HasAvatar
Defined in:
app/models/integrations/jira_cloud_app.rb

Constant Summary collapse

SERVICE_IDS_REGEX =
/\A^[A-Za-z0-9=,:]*$\z/
SERVICE_IDS_LIMIT =
100
ENVIRONMENT_REGEX =
/\A^[A-Za-z0-9,]*$\z/
AVAILABLE_ENVRIONMENT_NAMES =
%w[production staging testing development].freeze

Constants included from Base::Integration

Base::Integration::BASE_ATTRIBUTES, Base::Integration::BASE_CLASSES, Base::Integration::DEV_INTEGRATION_NAMES, Base::Integration::INSTANCE_LEVEL_ONLY_INTEGRATION_NAMES, Base::Integration::INTEGRATION_NAMES, Base::Integration::PROJECT_AND_GROUP_LEVEL_ONLY_INTEGRATION_NAMES, Base::Integration::PROJECT_LEVEL_ONLY_INTEGRATION_NAMES, Base::Integration::SECTION_TYPE_CONFIGURATION, Base::Integration::SECTION_TYPE_CONNECTION, Base::Integration::SECTION_TYPE_TRIGGER, Base::Integration::SNOWPLOW_EVENT_ACTION, Base::Integration::SNOWPLOW_EVENT_LABEL, Base::Integration::UnknownType

Constants inherited from ApplicationRecord

ApplicationRecord::MAX_PLUCK

Constants included from HasCheckConstraints

HasCheckConstraints::NOT_NULL_CHECK_PATTERN

Constants included from ResetOnColumnErrors

ResetOnColumnErrors::MAX_RESET_PERIOD

Class Method Summary collapse

Instance Method Summary collapse

Methods included from HasAvatar

#avatar_url

Methods included from Base::Integration

#activate!, #activate_disabled_reason, #activated?, #api_field_names, #async_execute, #attributes, #attribution_notice, #category, #chat?, #ci?, #configurable_events, #deactivate!, #default_test_event, #description, #dup, #event_channel_names, #event_names, #execute, #fields, #form_fields, #group_level?, #help, #inheritable?, #initialize_properties, #instance_level?, #json_fields, #operating?, #parent, #project_level?, #reencrypt_properties, #reset_updated_properties, #secret_fields, #supported_events, #supports_data_fields?, #test, #title, #to_database_hash, #to_param, #toggle!, #updated_properties

Methods included from Gitlab::Utils::Override

#extended, extensions, #included, #method_added, #override, #prepended, #queue_verification, verify!

Methods inherited from ApplicationRecord

===, cached_column_list, #create_or_load_association, current_transaction, declarative_enum, default_select_columns, delete_all_returning, #deleted_from_database?, id_in, id_not_in, iid_in, nullable_column?, primary_key_in, #readable_by?, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, #to_ability_name, underscore, where_exists, where_not_exists, with_fast_read_statement_timeout, without_order

Methods included from ResetOnColumnErrors

#reset_on_union_error, #reset_on_unknown_attribute_error

Methods included from Gitlab::SensitiveSerializableHash

#serializable_hash

Class Method Details

.descriptionObject



55
56
57
# File 'app/models/integrations/jira_cloud_app.rb', line 55

def self.description
  s_('JiraCloudApp|Sync development information to Jira in real time.')
end

.helpObject



59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'app/models/integrations/jira_cloud_app.rb', line 59

def self.help
  jira_doc_link_start = format('<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe,
    url: Gitlab::Routing.url_helpers.help_page_path('integration/jira/connect-app.md',
      anchor: 'configure-the-gitlab-for-jira-cloud-app')
  )

  format(
    s_('JiraCloudApp|This integration is enabled automatically when a group is linked in the ' \
      'GitLab for Jira Cloud app and cannot be enabled or disabled through this form. ' \
      "%{jira_doc_link_start}Learn more.%{link_end}"),
    jira_doc_link_start: jira_doc_link_start,
    link_end: '</a>'.html_safe)
end

.supported_eventsObject



77
78
79
# File 'app/models/integrations/jira_cloud_app.rb', line 77

def self.supported_events
  []
end

.titleObject



51
52
53
# File 'app/models/integrations/jira_cloud_app.rb', line 51

def self.title
  s_('JiraCloudApp|GitLab for Jira Cloud app')
end

.to_paramObject



73
74
75
# File 'app/models/integrations/jira_cloud_app.rb', line 73

def self.to_param
  'jira_cloud_app'
end

Instance Method Details

#editable?Boolean

Returns:

  • (Boolean)


108
109
110
# File 'app/models/integrations/jira_cloud_app.rb', line 108

def editable?
  activated?
end

#manual_activation?Boolean

Returns:

  • (Boolean)


101
102
103
# File 'app/models/integrations/jira_cloud_app.rb', line 101

def manual_activation?
  false
end

#sectionsObject



81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'app/models/integrations/jira_cloud_app.rb', line 81

def sections
  [
    {
      type: SECTION_TYPE_CONFIGURATION,
      title: s_('JiraCloudApp|Jira Service Management'),
      description: format(
        '%{description}<br><br>%{help}'.html_safe,
        description: s_('Seamlessly create change requests when your team initiates deployments.'),
        help: help
      )
    }
  ]
end

#testable?Boolean

Returns:

  • (Boolean)


96
97
98
# File 'app/models/integrations/jira_cloud_app.rb', line 96

def testable?
  false
end