2016-11-18 21:19:04 -05:00
|
|
|
class IssueEntity < IssuableEntity
|
2017-05-17 08:01:24 -04:00
|
|
|
include RequestAwareEntity
|
|
|
|
|
2016-11-18 21:19:04 -05:00
|
|
|
expose :branch_name
|
|
|
|
expose :confidential
|
2017-05-04 08:11:15 -04:00
|
|
|
expose :assignees, using: API::Entities::UserBasic
|
2016-11-18 21:19:04 -05:00
|
|
|
expose :due_date
|
|
|
|
expose :moved_to_id
|
|
|
|
expose :project_id
|
2017-05-17 08:01:24 -04:00
|
|
|
|
2017-05-25 06:20:52 -04:00
|
|
|
expose :web_url do |issue|
|
2017-06-29 13:06:35 -04:00
|
|
|
project_issue_path(issue.project, issue)
|
2017-05-17 08:01:24 -04:00
|
|
|
end
|
2017-06-23 18:10:05 -04:00
|
|
|
|
|
|
|
expose :current_user do
|
|
|
|
expose :can_create_note do |issue|
|
|
|
|
can?(request.current_user, :create_note, issue.project)
|
|
|
|
end
|
|
|
|
|
|
|
|
expose :can_update do |issue|
|
|
|
|
can?(request.current_user, :update_issue, issue)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
expose :create_note_path do |issue|
|
2017-08-11 07:53:51 -04:00
|
|
|
project_notes_path(issue.project, target_type: 'issue', target_id: issue.id)
|
2017-06-23 18:10:05 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
expose :preview_note_path do |issue|
|
|
|
|
preview_markdown_path(issue.project, quick_actions_target_type: 'Issue', quick_actions_target_id: issue.id)
|
|
|
|
end
|
2016-11-18 21:19:04 -05:00
|
|
|
end
|