diff options
author | Maneschi Romain <rmaneschi@gmail.com> | 2019-09-05 21:17:36 +0000 |
---|---|---|
committer | Clement Ho <408677-ClemMakesApps@users.noreply.gitlab.com> | 2019-09-05 21:17:36 +0000 |
commit | dbca77e346468704a93c68e81a0f7fac84956308 (patch) | |
tree | 71cc75e4ab2eab28e809118314a8d4d1833e9c57 /app/helpers/projects/error_tracking_helper.rb | |
parent | aadd1c8c84c451d9ce698d87f08a30a555a0b8b0 (diff) | |
download | gitlab-ce-dbca77e346468704a93c68e81a0f7fac84956308.tar.gz |
If user can't activate error tracking display a learn more button pointing
to doc
Diffstat (limited to 'app/helpers/projects/error_tracking_helper.rb')
-rw-r--r-- | app/helpers/projects/error_tracking_helper.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/helpers/projects/error_tracking_helper.rb b/app/helpers/projects/error_tracking_helper.rb index 6daf2e21ca2..fd1222a1dfb 100644 --- a/app/helpers/projects/error_tracking_helper.rb +++ b/app/helpers/projects/error_tracking_helper.rb @@ -1,12 +1,13 @@ # frozen_string_literal: true module Projects::ErrorTrackingHelper - def error_tracking_data(project) + def error_tracking_data(current_user, project) error_tracking_enabled = !!project.error_tracking_setting&.enabled? { 'index-path' => project_error_tracking_index_path(project, format: :json), + 'user-can-enable-error-tracking' => can?(current_user, :admin_operations, project).to_s, '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') |