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/serializers/analytics/cycle_analytics/configuration_entity.rb')
-rw-r--r--app/serializers/analytics/cycle_analytics/configuration_entity.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/app/serializers/analytics/cycle_analytics/configuration_entity.rb b/app/serializers/analytics/cycle_analytics/configuration_entity.rb
new file mode 100644
index 00000000000..45ea7c92758
--- /dev/null
+++ b/app/serializers/analytics/cycle_analytics/configuration_entity.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+module Analytics
+ module CycleAnalytics
+ class ConfigurationEntity < Grape::Entity
+ include RequestAwareEntity
+
+ expose :events, using: Analytics::CycleAnalytics::EventEntity
+ expose :stages, using: Analytics::CycleAnalytics::StageEntity
+
+ private
+
+ def events
+ (stage_events.events - stage_events.internal_events).sort_by(&:name)
+ end
+
+ def stage_events
+ Gitlab::Analytics::CycleAnalytics::StageEvents
+ end
+ end
+ end
+end