2020-07-23 09:09:18 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Projects::IncidentsHelper
|
2020-09-21 12:09:34 +00:00
|
|
|
def incidents_data(project, params)
|
2020-07-23 09:09:18 +00:00
|
|
|
{
|
2020-07-25 00:09:23 +00:00
|
|
|
'project-path' => project.full_path,
|
|
|
|
'new-issue-path' => new_project_issue_path(project),
|
2020-07-27 15:09:25 +00:00
|
|
|
'incident-template-name' => 'incident',
|
2020-08-17 12:10:12 +00:00
|
|
|
'incident-type' => 'incident',
|
2020-08-19 12:10:17 +00:00
|
|
|
'issue-path' => project_issues_path(project),
|
2020-09-21 12:09:34 +00:00
|
|
|
'empty-list-svg-path' => image_path('illustrations/incident-empty-state.svg'),
|
|
|
|
'text-query': params[:search],
|
2020-10-15 18:08:43 +00:00
|
|
|
'author-username-query': params[:author_username],
|
2021-11-09 21:10:00 +00:00
|
|
|
'assignee-username-query': params[:assignee_username],
|
|
|
|
'can-create-incident': create_issue_type_allowed?(project, :incident).to_s
|
2020-07-23 09:09:18 +00:00
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
2020-08-05 03:10:58 +00:00
|
|
|
|
2021-05-11 21:10:21 +00:00
|
|
|
Projects::IncidentsHelper.prepend_mod_with('Projects::IncidentsHelper')
|