Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/serializers/analytics/cycle_analytics/stage_entity.rb')
-rw-r--r--app/serializers/analytics/cycle_analytics/stage_entity.rb16
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