diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-10 21:08:01 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-10 21:08:01 +0000 |
commit | 4ba55564e1dd7fdbdb89065be8eefd01d8c2d607 (patch) | |
tree | 32e6eaec4cf44b40607e3fd8c4077050c3ce9771 /app/helpers/issuables_helper.rb | |
parent | 115c8ea7af7ef69ca3f09c333314546e9b5712f9 (diff) | |
download | gitlab-ce-4ba55564e1dd7fdbdb89065be8eefd01d8c2d607.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers/issuables_helper.rb')
-rw-r--r-- | app/helpers/issuables_helper.rb | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/app/helpers/issuables_helper.rb b/app/helpers/issuables_helper.rb index 18451bc5273..8c75a4a13e8 100644 --- a/app/helpers/issuables_helper.rb +++ b/app/helpers/issuables_helper.rb @@ -279,19 +279,30 @@ module IssuablesHelper initialDescriptionText: issuable.description, initialTaskStatus: issuable.task_status } + data.merge!(issue_only_initial_data(issuable)) + data.merge!(path_data(parent)) + data.merge!(updated_at_by(issuable)) - data[:hasClosingMergeRequest] = issuable.merge_requests_count(current_user) != 0 if issuable.is_a?(Issue) - data[:zoomMeetingUrl] = ZoomMeeting.canonical_meeting_url(issuable) if issuable.is_a?(Issue) + data + end - if parent.is_a?(Group) - data[:groupPath] = parent.path - else - data.merge!(projectPath: ref_project.path, projectNamespace: ref_project.namespace.full_path) - end + def issue_only_initial_data(issuable) + return {} unless issuable.is_a?(Issue) - data.merge!(updated_at_by(issuable)) + { + hasClosingMergeRequest: issuable.merge_requests_count(current_user) != 0, + zoomMeetingUrl: ZoomMeeting.canonical_meeting_url(issuable), + sentryIssueIdentifier: SentryIssue.find_by(issue: issuable)&.sentry_issue_identifier # rubocop:disable CodeReuse/ActiveRecord + } + end - data + def path_data(parent) + return { groupPath: parent.path } if parent.is_a?(Group) + + { + projectPath: ref_project.path, + projectNamespace: ref_project.namespace.full_path + } end def updated_at_by(issuable) |