2018-11-30 04:03:35 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class IssueSidebarBasicEntity < IssuableSidebarBasicEntity
|
|
|
|
expose :due_date
|
|
|
|
expose :confidential
|
2020-09-10 18:08:54 +00:00
|
|
|
expose :severity
|
2022-01-26 09:14:20 +00:00
|
|
|
|
|
|
|
expose :current_user, merge: true do
|
|
|
|
expose :can_update_escalation_status, if: -> (issue, _) { issue.supports_escalation? } do |issue|
|
|
|
|
can?(current_user, :update_escalation_status, issue.project)
|
|
|
|
end
|
|
|
|
end
|
2022-03-14 12:07:59 +00:00
|
|
|
|
|
|
|
expose :show_crm_contacts do |issuable|
|
|
|
|
current_user&.can?(:read_crm_contact, issuable.project.root_ancestor) &&
|
|
|
|
CustomerRelations::Contact.exists_for_group?(issuable.project.root_ancestor)
|
|
|
|
end
|
2018-11-30 04:03:35 +00:00
|
|
|
end
|
2019-09-13 13:26:31 +00:00
|
|
|
|
2021-05-11 21:10:21 +00:00
|
|
|
IssueSidebarBasicEntity.prepend_mod_with('IssueSidebarBasicEntity')
|