Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a3b8dbfa
Commit
a3b8dbfa
authored
Feb 18, 2022
by
Katrin Leinweber
Committed by
Alex Pooley
Feb 18, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stop using view helpers in AlertPresenter
Closes
https://gitlab.com/gitlab-org/gitlab/-/issues/341387
parent
f25fd8d0
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
10 additions
and
17 deletions
+10
-17
.rubocop_todo/rails/include_url_helper.yml
.rubocop_todo/rails/include_url_helper.yml
+0
-7
app/presenters/alert_management/alert_presenter.rb
app/presenters/alert_management/alert_presenter.rb
+0
-1
app/presenters/environment_presenter.rb
app/presenters/environment_presenter.rb
+0
-2
app/presenters/merge_request_presenter.rb
app/presenters/merge_request_presenter.rb
+5
-1
app/presenters/project_presenter.rb
app/presenters/project_presenter.rb
+5
-1
app/presenters/release_presenter.rb
app/presenters/release_presenter.rb
+0
-2
app/presenters/releases/evidence_presenter.rb
app/presenters/releases/evidence_presenter.rb
+0
-2
ee/app/helpers/license_helper.rb
ee/app/helpers/license_helper.rb
+0
-1
No files found.
.rubocop_todo/rails/include_url_helper.yml
View file @
a3b8dbfa
...
...
@@ -19,14 +19,7 @@ Rails/IncludeUrlHelper:
-
app/models/integrations/redmine.rb
-
app/models/integrations/webex_teams.rb
-
app/models/integrations/youtrack.rb
-
app/presenters/alert_management/alert_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/release_presenter.rb
-
app/presenters/releases/evidence_presenter.rb
-
ee/app/helpers/license_helper.rb
-
ee/app/models/integrations/github.rb
-
ee/spec/helpers/ee/projects/security/configuration_helper_spec.rb
-
ee/spec/lib/banzai/filter/cross_project_issuable_information_filter_spec.rb
...
...
app/presenters/alert_management/alert_presenter.rb
View file @
a3b8dbfa
...
...
@@ -3,7 +3,6 @@
module
AlertManagement
class
AlertPresenter
<
Gitlab
::
View
::
Presenter
::
Delegated
include
IncidentManagement
::
Settings
include
ActionView
::
Helpers
::
UrlHelper
presents
::
AlertManagement
::
Alert
delegator_override_with
Gitlab
::
Utils
::
StrongMemoize
# TODO: Remove `Gitlab::Utils::StrongMemoize` inclusion as it's duplicate
...
...
app/presenters/environment_presenter.rb
View file @
a3b8dbfa
# frozen_string_literal: true
class
EnvironmentPresenter
<
Gitlab
::
View
::
Presenter
::
Delegated
include
ActionView
::
Helpers
::
UrlHelper
presents
::
Environment
,
as: :environment
def
path
...
...
app/presenters/merge_request_presenter.rb
View file @
a3b8dbfa
# frozen_string_literal: true
class
MergeRequestPresenter
<
Gitlab
::
View
::
Presenter
::
Delegated
include
ActionView
::
Helpers
::
UrlHelper
include
GitlabRoutingHelper
include
MarkupHelper
include
TreeHelper
...
...
@@ -287,6 +286,11 @@ class MergeRequestPresenter < Gitlab::View::Presenter::Delegated
def
user_can_fork_project?
can?
(
current_user
,
:fork_project
,
project
)
end
# Avoid including ActionView::Helpers::UrlHelper
def
link_to
(
*
args
)
ApplicationController
.
helpers
.
link_to
(
*
args
)
end
end
MergeRequestPresenter
.
prepend_mod_with
(
'MergeRequestPresenter'
)
app/presenters/project_presenter.rb
View file @
a3b8dbfa
...
...
@@ -2,7 +2,6 @@
class
ProjectPresenter
<
Gitlab
::
View
::
Presenter
::
Delegated
include
ActionView
::
Helpers
::
NumberHelper
include
ActionView
::
Helpers
::
UrlHelper
include
GitlabRoutingHelper
include
StorageHelper
include
TreeHelper
...
...
@@ -473,6 +472,11 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
project
.
topics
.
map
(
&
:name
)
end
end
# Avoid including ActionView::Helpers::UrlHelper
def
content_tag
(
*
args
)
ActionController
::
Base
.
helpers
.
content_tag
(
*
args
)
end
end
ProjectPresenter
.
prepend_mod_with
(
'ProjectPresenter'
)
app/presenters/release_presenter.rb
View file @
a3b8dbfa
# frozen_string_literal: true
class
ReleasePresenter
<
Gitlab
::
View
::
Presenter
::
Delegated
include
ActionView
::
Helpers
::
UrlHelper
presents
::
Release
,
as: :release
# TODO: Remove `delegate` as it's redundant due to SimpleDelegator.
...
...
app/presenters/releases/evidence_presenter.rb
View file @
a3b8dbfa
...
...
@@ -2,8 +2,6 @@
module
Releases
class
EvidencePresenter
<
Gitlab
::
View
::
Presenter
::
Delegated
include
ActionView
::
Helpers
::
UrlHelper
presents
::
Releases
::
Evidence
,
as: :evidence
def
filepath
...
...
ee/app/helpers/license_helper.rb
View file @
a3b8dbfa
...
...
@@ -2,7 +2,6 @@
module
LicenseHelper
include
ActionView
::
Helpers
::
AssetTagHelper
include
ActionView
::
Helpers
::
UrlHelper
delegate
:new_admin_license_path
,
to:
'Gitlab::Routing.url_helpers'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment