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