2019-02-15 15:39:39 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class IssueSidebarBasicEntity < IssuableSidebarBasicEntity
|
|
|
|
expose :due_date
|
|
|
|
expose :confidential
|
2020-11-24 15:15:51 +05:30
|
|
|
expose :severity
|
2022-04-04 11:22:00 +05:30
|
|
|
|
|
|
|
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-05-07 20:08:51 +05:30
|
|
|
|
|
|
|
expose :show_crm_contacts do |issuable|
|
2022-07-16 23:28:13 +05:30
|
|
|
current_user&.can?(:read_crm_contacts, issuable) &&
|
2022-05-07 20:08:51 +05:30
|
|
|
CustomerRelations::Contact.exists_for_group?(issuable.project.root_ancestor)
|
|
|
|
end
|
2019-02-15 15:39:39 +05:30
|
|
|
end
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
IssueSidebarBasicEntity.prepend_mod_with('IssueSidebarBasicEntity')
|