summaryrefslogtreecommitdiff
path: root/app/presenters
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-29 12:09:08 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-29 12:09:08 +0000
commit7cc6872401eb487ed20dbb9d455f8bb9c97d9e39 (patch)
tree63f6ed5d4e6c5cec31c43363626d9f5b178eddf8 /app/presenters
parent46b10c0fc884400941c17e2777b242ac54d111e5 (diff)
downloadgitlab-ce-7cc6872401eb487ed20dbb9d455f8bb9c97d9e39.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/presenters')
-rw-r--r--app/presenters/sentry_error_presenter.rb (renamed from app/presenters/sentry_detailed_error_presenter.rb)14
1 files changed, 13 insertions, 1 deletions
diff --git a/app/presenters/sentry_detailed_error_presenter.rb b/app/presenters/sentry_error_presenter.rb
index 9329f987879..ba724b0f8be 100644
--- a/app/presenters/sentry_detailed_error_presenter.rb
+++ b/app/presenters/sentry_error_presenter.rb
@@ -1,10 +1,22 @@
# frozen_string_literal: true
-class SentryDetailedErrorPresenter < Gitlab::View::Presenter::Delegated
+class SentryErrorPresenter < Gitlab::View::Presenter::Delegated
presents :error
FrequencyStruct = Struct.new(:time, :count, keyword_init: true)
+ def first_seen
+ DateTime.parse(error.first_seen)
+ end
+
+ def last_seen
+ DateTime.parse(error.last_seen)
+ end
+
+ def project_id
+ Gitlab::GlobalId.build(model_name: 'Project', id: error.project_id).to_s
+ end
+
def frequency
utc_offset = Time.zone_offset('UTC')