Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/integration.rb')
-rw-r--r--app/models/integration.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/app/models/integration.rb b/app/models/integration.rb
index 7c14c1b1716..618f9f986e8 100644
--- a/app/models/integration.rb
+++ b/app/models/integration.rb
@@ -15,6 +15,7 @@ class Integration < ApplicationRecord
UnknownType = Class.new(StandardError)
+ self.allow_legacy_sti_class = true
self.inheritance_column = :type_new
INTEGRATION_NAMES = %w[
@@ -25,10 +26,9 @@ class Integration < ApplicationRecord
unify_circuit webex_teams youtrack zentao
].freeze
- # TODO Shimo is temporary disabled on group and instance-levels.
# See: https://gitlab.com/gitlab-org/gitlab/-/issues/345677
PROJECT_SPECIFIC_INTEGRATION_NAMES = %w[
- apple_app_store gitlab_slack_application google_play jenkins shimo
+ apple_app_store gitlab_slack_application google_play jenkins
].freeze
# Fake integrations to help with local development.
@@ -526,6 +526,17 @@ class Integration < ApplicationRecord
fields.reject { _1[:type] == :password || _1[:name] == 'webhook' || (_1.key?(:if) && _1[:if] != true) }.pluck(:name)
end
+ def self.api_fields
+ fields.map do |field|
+ {
+ required: field.required?,
+ name: field.name.to_sym,
+ type: field.api_type,
+ desc: field.description
+ }
+ end
+ end
+
def form_fields
fields.reject { _1[:api_only] == true || (_1.key?(:if) && _1[:if] != true) }
end