2018-11-29 23:03:35 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class IssuableSidebarExtrasEntity < Grape::Entity
|
|
|
|
include RequestAwareEntity
|
|
|
|
include TimeTrackableEntity
|
2019-11-18 07:06:03 -05:00
|
|
|
include NotificationsHelper
|
2018-11-29 23:03:35 -05:00
|
|
|
|
|
|
|
expose :participants, using: ::API::Entities::UserBasic do |issuable|
|
|
|
|
issuable.participants(request.current_user)
|
|
|
|
end
|
|
|
|
|
2019-11-18 07:06:03 -05:00
|
|
|
expose :project_emails_disabled do |issuable|
|
|
|
|
issuable.project.emails_disabled?
|
|
|
|
end
|
|
|
|
|
|
|
|
expose :subscribe_disabled_description do |issuable|
|
|
|
|
notification_description(:owner_disabled)
|
|
|
|
end
|
|
|
|
|
2018-11-29 23:03:35 -05:00
|
|
|
expose :subscribed do |issuable|
|
|
|
|
issuable.subscribed?(request.current_user, issuable.project)
|
|
|
|
end
|
2019-04-07 14:35:16 -04:00
|
|
|
|
|
|
|
expose :assignees, using: API::Entities::UserBasic
|
2018-11-29 23:03:35 -05:00
|
|
|
end
|