summaryrefslogtreecommitdiff
path: root/app/serializers
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-12-07 16:46:37 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-12-07 16:46:37 +0100
commite4efb135e810046b1f4283db4dfe1b386ef15bad (patch)
tree4398b740d2f75252b0a425fe2a961de6ee82abfe /app/serializers
parentad19de19498a1337a242fd67731e59771e65a9d3 (diff)
downloadgitlab-ce-e4efb135e810046b1f4283db4dfe1b386ef15bad.tar.gz
Add status entity prototype and expose in pipeline
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/pipeline_entity.rb2
-rw-r--r--app/serializers/status_entity.rb8
2 files changed, 9 insertions, 1 deletions
diff --git a/app/serializers/pipeline_entity.rb b/app/serializers/pipeline_entity.rb
index cf99e628d5f..a07abb4bec0 100644
--- a/app/serializers/pipeline_entity.rb
+++ b/app/serializers/pipeline_entity.rb
@@ -12,7 +12,7 @@ class PipelineEntity < Grape::Entity
end
expose :details do
- expose :status
+ expose :detailed_status, as: :status, using: StatusEntity
expose :duration
expose :finished_at
expose :stages_with_statuses, as: :stages, using: PipelineStageEntity
diff --git a/app/serializers/status_entity.rb b/app/serializers/status_entity.rb
new file mode 100644
index 00000000000..ae14dd57f61
--- /dev/null
+++ b/app/serializers/status_entity.rb
@@ -0,0 +1,8 @@
+class StatusEntity < Grape::Entity
+ include RequestAwareEntity
+
+ expose :icon, :text, :label, :title
+
+ expose :has_details?, as: :has_details
+ expose :details_path
+end