diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
commit | 7021455bd1ed7b125c55eb1b33c5a01f2bc55ee0 (patch) | |
tree | 5bdc2229f5198d516781f8d24eace62fc7e589e9 /app/serializers/detailed_status_entity.rb | |
parent | 185b095e93520f96e9cfc31d9c3e69b498cdab7c (diff) |
Add latest changes from gitlab-org/gitlab@15-6-stable-eev15.6.0-rc42
Diffstat (limited to 'app/serializers/detailed_status_entity.rb')
-rw-r--r-- | app/serializers/detailed_status_entity.rb | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/app/serializers/detailed_status_entity.rb b/app/serializers/detailed_status_entity.rb index 4f23ef0ed82..ed8ac9f40f7 100644 --- a/app/serializers/detailed_status_entity.rb +++ b/app/serializers/detailed_status_entity.rb @@ -3,12 +3,25 @@ class DetailedStatusEntity < Grape::Entity include RequestAwareEntity - expose :icon, :text, :label, :group - expose :status_tooltip, as: :tooltip - expose :has_details?, as: :has_details - expose :details_path + expose :icon, documentation: { type: 'string', example: 'status_success' } + expose :text, documentation: { type: 'string', example: 'passed' } + expose :label, documentation: { type: 'string', example: 'passed' } + expose :group, documentation: { type: 'string', example: 'success' } + expose :status_tooltip, as: :tooltip, documentation: { type: 'string', example: 'passed' } + expose :has_details?, as: :has_details, documentation: { type: 'boolean', example: true } + expose :details_path, documentation: { type: 'string', example: '/test-group/test-project/-/pipelines/287' } - expose :illustration do |status| + expose :illustration, documentation: { + type: 'object', + example: <<~JSON + { + "image": "illustrations/job_not_triggered.svg", + "size": "svg-306", + "title": "This job has not been triggered yet", + "content": "This job depends on upstream jobs that need to succeed in order for this job to be triggered" + } + JSON + } do |status| illustration = { image: ActionController::Base.helpers.image_path(status.illustration[:image]) } @@ -19,15 +32,17 @@ class DetailedStatusEntity < Grape::Entity # ignored end - expose :favicon do |status| + expose :favicon, + documentation: { type: 'string', + example: '/assets/ci_favicons/favicon_status_success.png' } do |status| Gitlab::Favicon.status_overlay(status.favicon) end expose :action, if: -> (status, _) { status.has_action? } do - expose :action_icon, as: :icon - expose :action_title, as: :title - expose :action_path, as: :path - expose :action_method, as: :method - expose :action_button_title, as: :button_title + expose :action_icon, as: :icon, documentation: { type: 'string', example: 'cancel' } + expose :action_title, as: :title, documentation: { type: 'string', example: 'Cancel' } + expose :action_path, as: :path, documentation: { type: 'string', example: '/namespace1/project1/-/jobs/2/cancel' } + expose :action_method, as: :method, documentation: { type: 'string', example: 'post' } + expose :action_button_title, as: :button_title, documentation: { type: 'string', example: 'Cancel this job' } end end |