diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-20 16:37:47 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-20 16:37:47 +0300 |
commit | aee0a117a889461ce8ced6fcf73207fe017f1d99 (patch) | |
tree | 891d9ef189227a8445d83f35c1b0fc99573f4380 /app/serializers/analytics | |
parent | 8d46af3258650d305f53b819eabf7ab18d22f59e (diff) |
Add latest changes from gitlab-org/gitlab@14-6-stable-eev14.6.0-rc42
Diffstat (limited to 'app/serializers/analytics')
-rw-r--r-- | app/serializers/analytics/cycle_analytics/stage_entity.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/app/serializers/analytics/cycle_analytics/stage_entity.rb b/app/serializers/analytics/cycle_analytics/stage_entity.rb index c5cc8c89fb7..cfbf6f60e38 100644 --- a/app/serializers/analytics/cycle_analytics/stage_entity.rb +++ b/app/serializers/analytics/cycle_analytics/stage_entity.rb @@ -3,6 +3,10 @@ module Analytics module CycleAnalytics class StageEntity < Grape::Entity + include ActionView::Context + include LabelsHelper + include ActionView::Helpers::TagHelper + expose :title expose :hidden expose :legend @@ -43,10 +47,20 @@ module Analytics html_description(object.end_event) end + # Avoid including ActionView::Helpers::UrlHelper + def link_to(*args) + ActionController::Base.helpers.link_to(*args) + end + private def html_description(event) - Banzai::Renderer.render(event.markdown_description, { group: object.group, project: nil }) + options = {} + if event.label_based? + options[:label_html] = render_label(event.label, link: '', small: true, tooltip: true) + end + + content_tag(:p) { event.html_description(options).html_safe } end end end |