2018-11-29 23:03:35 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class IssueSidebarBasicEntity < IssuableSidebarBasicEntity
|
|
|
|
expose :due_date
|
|
|
|
expose :confidential
|
2020-09-10 14:08:54 -04:00
|
|
|
expose :severity
|
2022-01-26 04:14:20 -05: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 08:07:59 -04:00
|
|
|
|
|
|
|
expose :show_crm_contacts do |issuable|
|
2022-04-29 17:10:44 -04:00
|
|
|
current_user&.can?(:read_crm_contacts, issuable) &&
|
2022-03-14 08:07:59 -04:00
|
|
|
CustomerRelations::Contact.exists_for_group?(issuable.project.root_ancestor)
|
|
|
|
end
|
2018-11-29 23:03:35 -05:00
|
|
|
end
|
2019-09-13 09:26:31 -04:00
|
|
|
|
2021-05-11 17:10:21 -04:00
|
|
|
IssueSidebarBasicEntity.prepend_mod_with('IssueSidebarBasicEntity')
|