debian-mirror-gitlab/app/serializers/status_entity.rb

22 lines
545 B
Ruby
Raw Normal View History

2018-11-18 11:00:15 +05:30
# frozen_string_literal: true
2017-08-17 22:00:37 +05:30
class StatusEntity < Grape::Entity
include RequestAwareEntity
expose :icon, :text, :label, :group
2018-05-09 12:01:36 +05:30
expose :status_tooltip, as: :tooltip
2017-08-17 22:00:37 +05:30
expose :has_details?, as: :has_details
expose :details_path
expose :favicon do |status|
2018-11-08 19:23:39 +05:30
Gitlab::Favicon.status_overlay(status.favicon)
2017-08-17 22:00:37 +05:30
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
end
end