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