diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-12-07 16:46:37 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-12-07 16:46:37 +0100 |
commit | e4efb135e810046b1f4283db4dfe1b386ef15bad (patch) | |
tree | 4398b740d2f75252b0a425fe2a961de6ee82abfe /app/serializers | |
parent | ad19de19498a1337a242fd67731e59771e65a9d3 (diff) | |
download | gitlab-ce-e4efb135e810046b1f4283db4dfe1b386ef15bad.tar.gz |
Add status entity prototype and expose in pipeline
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/pipeline_entity.rb | 2 | ||||
-rw-r--r-- | app/serializers/status_entity.rb | 8 |
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 |