summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorSimon Knox <simon@gitlab.com>2019-01-11 22:52:26 +0000
committerClement Ho <clemmakesapps@gmail.com>2019-01-11 22:52:26 +0000
commit5a5212542aeac8c3b2e05e853e2e709c7141a999 (patch)
tree9c92bbb6f3c619c69dd225ec32350f59883bba32 /app/helpers
parent6d6c2e95dd8c813a9646c6289589957749bd4b0c (diff)
downloadgitlab-ce-5a5212542aeac8c3b2e05e853e2e709c7141a999.tar.gz
List Sentry Errors in GitLab - Frontend
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/projects/error_tracking_helper.rb15
-rw-r--r--app/helpers/projects_helper.rb2
2 files changed, 17 insertions, 0 deletions
diff --git a/app/helpers/projects/error_tracking_helper.rb b/app/helpers/projects/error_tracking_helper.rb
new file mode 100644
index 00000000000..6daf2e21ca2
--- /dev/null
+++ b/app/helpers/projects/error_tracking_helper.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+module Projects::ErrorTrackingHelper
+ def error_tracking_data(project)
+ error_tracking_enabled = !!project.error_tracking_setting&.enabled?
+
+ {
+ 'index-path' => project_error_tracking_index_path(project,
+ format: :json),
+ '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
+end
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index e67c327f7f8..ebbed08f78a 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -335,6 +335,7 @@ module ProjectsHelper
builds: :read_build,
clusters: :read_cluster,
serverless: :read_cluster,
+ error_tracking: :read_sentry_issue,
labels: :read_label,
issues: :read_issue,
project_members: :read_project_member,
@@ -579,6 +580,7 @@ module ProjectsHelper
environments
clusters
functions
+ error_tracking
user
gcp
]