Commit 83e70c2f authored by Fabio Pitino's avatar Fabio Pitino

Merge branch 'epic-6767-refactor-IncludeUrlHelpers' into 'master'

Resolve several Rails/IncludeUrlHelper violations

See merge request gitlab-org/gitlab!74803
parents 1d565010 00105348
...@@ -21,20 +21,16 @@ Rails/IncludeUrlHelper: ...@@ -21,20 +21,16 @@ Rails/IncludeUrlHelper:
- app/models/integrations/webex_teams.rb - app/models/integrations/webex_teams.rb
- app/models/integrations/youtrack.rb - app/models/integrations/youtrack.rb
- app/presenters/alert_management/alert_presenter.rb - app/presenters/alert_management/alert_presenter.rb
- app/presenters/ci/pipeline_presenter.rb
- app/presenters/environment_presenter.rb - app/presenters/environment_presenter.rb
- app/presenters/gitlab/blame_presenter.rb - app/presenters/gitlab/blame_presenter.rb
- app/presenters/merge_request_presenter.rb - app/presenters/merge_request_presenter.rb
- app/presenters/project_presenter.rb - app/presenters/project_presenter.rb
- app/presenters/prometheus_alert_presenter.rb
- app/presenters/release_presenter.rb - app/presenters/release_presenter.rb
- app/presenters/releases/evidence_presenter.rb - app/presenters/releases/evidence_presenter.rb
- ee/app/helpers/license_helper.rb - ee/app/helpers/license_helper.rb
- ee/app/models/integrations/github.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/helpers/ee/projects/security/configuration_helper_spec.rb
- ee/spec/lib/banzai/filter/cross_project_issuable_information_filter_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/merge_requests_helper_spec.rb
- spec/helpers/nav/top_nav_helper_spec.rb - spec/helpers/nav/top_nav_helper_spec.rb
- spec/helpers/notify_helper_spec.rb - spec/helpers/notify_helper_spec.rb
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
module Ci module Ci
class PipelinePresenter < Gitlab::View::Presenter::Delegated class PipelinePresenter < Gitlab::View::Presenter::Delegated
include Gitlab::Utils::StrongMemoize 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 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` delegator_override_with ActionView::Helpers::TagHelper # TODO: Remove `ActionView::Helpers::UrlHelper` inclusion as it overrides `Ci::Pipeline#tag`
...@@ -108,7 +107,7 @@ module Ci ...@@ -108,7 +107,7 @@ module Ci
end end
def link_to_pipeline_ref def link_to_pipeline_ref
link_to(pipeline.ref, ApplicationController.helpers.link_to(pipeline.ref,
project_commits_path(pipeline.project, pipeline.ref), project_commits_path(pipeline.project, pipeline.ref),
class: "ref-name") class: "ref-name")
end end
...@@ -116,7 +115,7 @@ module Ci ...@@ -116,7 +115,7 @@ module Ci
def link_to_merge_request def link_to_merge_request
return unless merge_request_presenter 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), project_merge_request_path(merge_request_presenter.project, merge_request_presenter),
class: 'mr-iid') class: 'mr-iid')
end end
...@@ -143,7 +142,7 @@ module Ci ...@@ -143,7 +142,7 @@ module Ci
private private
def plain_ref_name def plain_ref_name
content_tag(:span, pipeline.ref, class: 'ref-name') ApplicationController.helpers.content_tag(:span, pipeline.ref, class: 'ref-name')
end end
def merge_request_presenter def merge_request_presenter
...@@ -160,7 +159,7 @@ module Ci ...@@ -160,7 +159,7 @@ module Ci
all_related_merge_requests.first(limit).map do |merge_request| all_related_merge_requests.first(limit).map do |merge_request|
mr_path = project_merge_request_path(merge_request.project, 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
end end
......
# frozen_string_literal: true # frozen_string_literal: true
class PrometheusAlertPresenter < Gitlab::View::Presenter::Delegated class PrometheusAlertPresenter < Gitlab::View::Presenter::Delegated
include ActionView::Helpers::UrlHelper
presents ::PrometheusAlert, as: :prometheus_alert presents ::PrometheusAlert, as: :prometheus_alert
def humanized_text def humanized_text
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
# - skip_user # - skip_user
class MergeRequestApproverPresenter < Gitlab::View::Presenter::Simple class MergeRequestApproverPresenter < Gitlab::View::Presenter::Simple
include ActionView::Helpers::TagHelper include ActionView::Helpers::TagHelper
include ActionView::Helpers::UrlHelper
include ActionView::Helpers::OutputSafetyHelper include ActionView::Helpers::OutputSafetyHelper
include ActionView::RecordIdentifier include ActionView::RecordIdentifier
include Gitlab::Utils::StrongMemoize include Gitlab::Utils::StrongMemoize
...@@ -30,7 +29,7 @@ class MergeRequestApproverPresenter < Gitlab::View::Presenter::Simple ...@@ -30,7 +29,7 @@ class MergeRequestApproverPresenter < Gitlab::View::Presenter::Simple
end end
def render_user(user) def render_user(user)
link_to user.name, '#', id: dom_id(user) ApplicationController.helpers.link_to user.name, '#', id: dom_id(user)
end end
def show_code_owner_tips? def show_code_owner_tips?
......
...@@ -8,14 +8,13 @@ module Gitlab::Ci ...@@ -8,14 +8,13 @@ module Gitlab::Ci
class Metadata class Metadata
include Gitlab::Routing include Gitlab::Routing
include ActionView::Helpers::AssetTagHelper include ActionView::Helpers::AssetTagHelper
include ActionView::Helpers::UrlHelper
def initialize(badge) def initialize(badge)
@badge = badge @badge = badge
end end
def to_html 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 end
def to_markdown 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