diff options
Diffstat (limited to 'app/serializers/pipeline_details_entity.rb')
-rw-r--r-- | app/serializers/pipeline_details_entity.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/app/serializers/pipeline_details_entity.rb b/app/serializers/pipeline_details_entity.rb index 76797a773b5..6c20f665bfa 100644 --- a/app/serializers/pipeline_details_entity.rb +++ b/app/serializers/pipeline_details_entity.rb @@ -8,8 +8,14 @@ class PipelineDetailsEntity < Ci::PipelineEntity end expose :details do - expose :manual_actions, using: BuildActionEntity - expose :scheduled_actions, using: BuildActionEntity + expose :manual_actions, unless: proc { options[:disable_manual_and_scheduled_actions] }, using: BuildActionEntity + expose :scheduled_actions, unless: proc { options[:disable_manual_and_scheduled_actions] }, using: BuildActionEntity + expose :has_manual_actions do |pipeline| + pipeline.manual_actions.any? + end + expose :has_scheduled_actions do |pipeline| + pipeline.scheduled_actions.any? + end end expose :triggered_by_pipeline, as: :triggered_by, with: TriggeredPipelineEntity |