debian-mirror-gitlab/app/helpers/projects/error_tracking_helper.rb

27 lines
1,007 B
Ruby
Raw Normal View History

2019-02-15 15:39:39 +05:30
# frozen_string_literal: true
module Projects::ErrorTrackingHelper
2019-12-04 20:38:33 +05:30
def error_tracking_data(current_user, project)
2019-02-15 15:39:39 +05:30
error_tracking_enabled = !!project.error_tracking_setting&.enabled?
{
'index-path' => project_error_tracking_index_path(project,
format: :json),
2019-12-04 20:38:33 +05:30
'user-can-enable-error-tracking' => can?(current_user, :admin_operations, project).to_s,
2019-02-15 15:39:39 +05:30
'enable-error-tracking-link' => project_settings_operations_path(project),
'error-tracking-enabled' => error_tracking_enabled.to_s,
'illustration-path' => image_path('illustrations/cluster_popover.svg')
}
end
2019-12-26 22:10:19 +05:30
def error_details_data(project, issue_id)
opts = [project, issue_id, { format: :json }]
{
2020-01-01 13:55:28 +05:30
'project-issues-path' => project_issues_path(project),
2019-12-26 22:10:19 +05:30
'issue-details-path' => details_project_error_tracking_index_path(*opts),
'issue-stack-trace-path' => stack_trace_project_error_tracking_index_path(*opts)
}
end
2019-02-15 15:39:39 +05:30
end