Class: Integrations::GitlabSlackApplication
Constant Summary
Base::SlackNotification::SUPPORTED_EVENTS_FOR_USAGE_LOG
Base::ChatNotification::EVENT_CHANNEL, Base::ChatNotification::GROUP_ONLY_SUPPORTED_EVENTS, Base::ChatNotification::LABEL_NOTIFICATION_BEHAVIOURS, Base::ChatNotification::SECRET_MASK, Base::ChatNotification::SUPPORTED_EVENTS, Base::ChatNotification::SUPPORTED_EVENTS_FOR_LABEL_FILTER
NotificationPipelineStatusSelection::FIELD
Base::Integration::BASE_ATTRIBUTES, Base::Integration::BASE_CLASSES, Base::Integration::DEV_INTEGRATION_NAMES, Base::Integration::ENCRYPTED_PROPERTIES_MAX_SIZE, 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
ApplicationRecord::MAX_PLUCK
HasCheckConstraints::NOT_NULL_CHECK_PATTERN
ResetOnColumnErrors::MAX_RESET_PERIOD
Class Method Summary
collapse
Instance Method Summary
collapse
#configurable_channels?, #default_channel_placeholder, #get_message, #supported_events
#extended, extensions, #included, #method_added, #override, #prepended, #queue_verification, verify!
#api_field_names, #channel_limit_per_event, #confidential_issue_channel, #confidential_note_channel, #configurable_channels?, #default_channel_placeholder, #event_channel_names, #event_channel_value, #execute, #form_fields, #initialize_properties, #mask_configurable_channels?, #webhook_help
#notify_for_branch?
#activate!, #activate_disabled_reason, #activated?, #api_field_names, #async_execute, #attributes, #attribution_notice, #category, #chat?, #ci?, #deactivate!, #default_test_event, #description, #dup, #event_channel_names, #event_names, #execute, #form_fields, #group_level?, #help, #inheritable?, #initialize_properties, #instance_level?, #json_fields, #operating?, #organization_id_from_parent, #parent, #project_level?, #reencrypt_properties, #reset_updated_properties, #secret_fields, #supported_events, #supports_data_fields?, #testable?, #title, #to_database_hash, #to_param, #toggle!, #updated_properties, #validate_encrypted_properties_size_limit
===, 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
#sharding_organization
#reset_on_union_error, #reset_on_unknown_attribute_error
#serializable_hash
Class Method Details
.description ⇒ Object
33
34
35
|
# File 'app/models/integrations/gitlab_slack_application.rb', line 33
def self.description
s_('Integrations|Enable slash commands and notifications for a Slack workspace.')
end
|
.requires_webhook? ⇒ Boolean
103
104
105
|
# File 'app/models/integrations/gitlab_slack_application.rb', line 103
def self.requires_webhook?
false
end
|
.title ⇒ Object
29
30
31
|
# File 'app/models/integrations/gitlab_slack_application.rb', line 29
def self.title
s_('Integrations|GitLab for Slack app')
end
|
.to_param ⇒ Object
37
38
39
|
# File 'app/models/integrations/gitlab_slack_application.rb', line 37
def self.to_param
'gitlab_slack_application'
end
|
.webhook_help ⇒ Object
74
75
76
|
# File 'app/models/integrations/gitlab_slack_application.rb', line 74
def self.webhook_help
end
|
Instance Method Details
#after_build_from_integration(new_integration) ⇒ Object
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
# File 'app/models/integrations/gitlab_slack_application.rb', line 85
def after_build_from_integration(new_integration)
return unless slack_integration
new_integration.slack_integration = slack_integration.dup.tap do |entity|
entity.alias = new_integration.parent&.full_path ||
SlackIntegration.organization_alias(new_integration.organization_id)
entity.organization_id = new_integration.organization_id
entity.project_id = new_integration.project_id
entity.group_id = new_integration.group_id
entity.authorized_scope_names = slack_integration.authorized_scope_names
end
end
|
#configurable_events ⇒ Object
79
80
81
82
83
|
# File 'app/models/integrations/gitlab_slack_application.rb', line 79
def configurable_events
return [] unless editable?
super
end
|
#editable? ⇒ Boolean
56
57
58
|
# File 'app/models/integrations/gitlab_slack_application.rb', line 56
def editable?
activated?
end
|
#fields ⇒ Object
61
62
63
64
65
|
# File 'app/models/integrations/gitlab_slack_application.rb', line 61
def fields
return [] unless editable?
super
end
|
#manual_activation? ⇒ Boolean
42
43
44
|
# File 'app/models/integrations/gitlab_slack_application.rb', line 42
def manual_activation?
false
end
|
#sections ⇒ Object
68
69
70
71
72
|
# File 'app/models/integrations/gitlab_slack_application.rb', line 68
def sections
return [] unless editable?
super.drop(1)
end
|
#test(_data) ⇒ Object
47
48
49
50
51
|
# File 'app/models/integrations/gitlab_slack_application.rb', line 47
def test(_data)
failures = test_notification_channels
{ success: failures.blank?, result: failures }
end
|
#upgrade_needed? ⇒ Boolean
107
108
109
|
# File 'app/models/integrations/gitlab_slack_application.rb', line 107
def upgrade_needed?
slack_integration.present? && slack_integration.upgrade_needed?
end
|