diff options
Diffstat (limited to 'app/helpers/projects/error_tracking_helper.rb')
-rw-r--r-- | app/helpers/projects/error_tracking_helper.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/app/helpers/projects/error_tracking_helper.rb b/app/helpers/projects/error_tracking_helper.rb index fc4ad10db21..b21bac9da7f 100644 --- a/app/helpers/projects/error_tracking_helper.rb +++ b/app/helpers/projects/error_tracking_helper.rb @@ -9,6 +9,7 @@ module Projects::ErrorTrackingHelper '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, + 'integrated-error-tracking-enabled' => integrated_tracking_enabled?(project).to_s, 'project-path' => project.full_path, 'list-path' => project_error_tracking_index_path(project), 'illustration-path' => image_path('illustrations/cluster_popover.svg'), @@ -24,15 +25,25 @@ module Projects::ErrorTrackingHelper 'project-path' => project.full_path, 'issue-update-path' => update_project_error_tracking_index_path(*opts), 'project-issues-path' => project_issues_path(project), - 'issue-stack-trace-path' => stack_trace_project_error_tracking_index_path(*opts) + 'issue-stack-trace-path' => stack_trace_project_error_tracking_index_path(*opts), + 'integrated-error-tracking-enabled' => integrated_tracking_enabled?(project).to_s } end private + # Should show the alert if the FF was turned off after the integrated client has been configured. def show_integrated_tracking_disabled_alert?(project) return false if ::Feature.enabled?(:integrated_error_tracking, project) + integrated_client_enabled?(project) + end + + def integrated_tracking_enabled?(project) + ::Feature.enabled?(:integrated_error_tracking, project) && integrated_client_enabled?(project) + end + + def integrated_client_enabled?(project) setting ||= project.error_tracking_setting || project.build_error_tracking_setting |