2018-07-19 18:43:13 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-11-19 02:19:04 +00:00
|
|
|
class LabelEntity < Grape::Entity
|
2017-07-07 12:54:49 +00:00
|
|
|
expose :id, if: ->(label, _) { !label.is_a?(GlobalLabel) }
|
|
|
|
|
2016-11-19 02:19:04 +00:00
|
|
|
expose :title
|
|
|
|
expose :color
|
|
|
|
expose :description
|
|
|
|
expose :group_id
|
|
|
|
expose :project_id
|
|
|
|
expose :template
|
2017-05-05 22:47:32 +00:00
|
|
|
expose :text_color
|
2016-11-19 02:19:04 +00:00
|
|
|
expose :created_at
|
|
|
|
expose :updated_at
|
2018-12-03 15:23:38 +00:00
|
|
|
|
|
|
|
expose :priority, if: -> (*) { options.key?(:project) } do |label|
|
|
|
|
label.priority(options[:project])
|
|
|
|
end
|
2016-11-19 02:19:04 +00:00
|
|
|
end
|