Commit 00105348 authored by Katrin Leinweber's avatar Katrin Leinweber Committed by Fabio Pitino

Resolve several Rails/IncludeUrlHelper violations

parent 6ba31f27
......@@ -21,20 +21,16 @@ Rails/IncludeUrlHelper:
- app/models/integrations/webex_teams.rb
- app/models/integrations/youtrack.rb
- app/presenters/alert_management/alert_presenter.rb
- app/presenters/ci/pipeline_presenter.rb
- app/presenters/environment_presenter.rb
- app/presenters/gitlab/blame_presenter.rb
- app/presenters/merge_request_presenter.rb
- app/presenters/project_presenter.rb
- app/presenters/prometheus_alert_presenter.rb
- app/presenters/release_presenter.rb
- app/presenters/releases/evidence_presenter.rb
- ee/app/helpers/license_helper.rb
- ee/app/models/integrations/github.rb
- ee/app/presenters/merge_request_approver_presenter.rb
- ee/spec/helpers/ee/projects/security/configuration_helper_spec.rb
- ee/spec/lib/banzai/filter/cross_project_issuable_information_filter_spec.rb
- lib/gitlab/ci/badge/metadata.rb
- spec/helpers/merge_requests_helper_spec.rb
- spec/helpers/nav/top_nav_helper_spec.rb
- spec/helpers/notify_helper_spec.rb
......
......@@ -3,7 +3,6 @@
module Ci
class PipelinePresenter < Gitlab::View::Presenter::Delegated
include Gitlab::Utils::StrongMemoize
include ActionView::Helpers::UrlHelper
delegator_override_with Gitlab::Utils::StrongMemoize # TODO: Remove `Gitlab::Utils::StrongMemoize` inclusion as it's duplicate
delegator_override_with ActionView::Helpers::TagHelper # TODO: Remove `ActionView::Helpers::UrlHelper` inclusion as it overrides `Ci::Pipeline#tag`
......@@ -108,7 +107,7 @@ module Ci
end
def link_to_pipeline_ref
link_to(pipeline.ref,
ApplicationController.helpers.link_to(pipeline.ref,
project_commits_path(pipeline.project, pipeline.ref),
class: "ref-name")
end
......@@ -116,7 +115,7 @@ module Ci
def link_to_merge_request
return unless merge_request_presenter
link_to(merge_request_presenter.to_reference,
ApplicationController.helpers.link_to(merge_request_presenter.to_reference,
project_merge_request_path(merge_request_presenter.project, merge_request_presenter),
class: 'mr-iid')
end
......@@ -143,7 +142,7 @@ module Ci
private
def plain_ref_name
content_tag(:span, pipeline.ref, class: 'ref-name')
ApplicationController.helpers.content_tag(:span, pipeline.ref, class: 'ref-name')
end
def merge_request_presenter
......@@ -160,7 +159,7 @@ module Ci
all_related_merge_requests.first(limit).map do |merge_request|
mr_path = project_merge_request_path(merge_request.project, merge_request)
link_to "#{merge_request.to_reference} #{merge_request.title}", mr_path, class: 'mr-iid'
ApplicationController.helpers.link_to "#{merge_request.to_reference} #{merge_request.title}", mr_path, class: 'mr-iid'
end
end
......
# frozen_string_literal: true
class PrometheusAlertPresenter < Gitlab::View::Presenter::Delegated
include ActionView::Helpers::UrlHelper
presents ::PrometheusAlert, as: :prometheus_alert
def humanized_text
......
......@@ -7,7 +7,6 @@
# - skip_user
class MergeRequestApproverPresenter < Gitlab::View::Presenter::Simple
include ActionView::Helpers::TagHelper
include ActionView::Helpers::UrlHelper
include ActionView::Helpers::OutputSafetyHelper
include ActionView::RecordIdentifier
include Gitlab::Utils::StrongMemoize
......@@ -30,7 +29,7 @@ class MergeRequestApproverPresenter < Gitlab::View::Presenter::Simple
end
def render_user(user)
link_to user.name, '#', id: dom_id(user)
ApplicationController.helpers.link_to user.name, '#', id: dom_id(user)
end
def show_code_owner_tips?
......
......@@ -8,14 +8,13 @@ module Gitlab::Ci
class Metadata
include Gitlab::Routing
include ActionView::Helpers::AssetTagHelper
include ActionView::Helpers::UrlHelper
def initialize(badge)
@badge = badge
end
def to_html
link_to(image_tag(image_url, alt: title), link_url)
ApplicationController.helpers.link_to(image_tag(image_url, alt: title), link_url)
end
def to_markdown
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment