OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Remove including helpers in ViewComponents, use the #helpers method instead (#12709)
Dombi Attila804462f00c87
diff --git a/app/components/components/on_off_status_component.html.erb b/app/components/components/on_off_status_component.html.erbindex 085b2dd60cb..45fccd6b7a2 100644--- a/app/components/components/on_off_status_component.html.erb+++ b/app/components/components/on_off_status_component.html.erb@@ -32,7 +32,7 @@ See COPYRIGHT and LICENSE files for more details.<div class="on-off-status-cell"><% if enabled? %><span class="on-off-status -enabled">- <%= op_icon 'icon-yes' %>+ <%= helpers.op_icon 'icon-yes' %><%= model[:on_text] %></span><p>@@ -40,7 +40,7 @@ See COPYRIGHT and LICENSE files for more details.</p><% else %><span class="on-off-status -disabled">- <%= op_icon 'icon-not-supported' %>+ <%= helpers.op_icon 'icon-not-supported' %><%= model[:off_text] %></span><p><%= model[:off_description] %></p>diff --git a/app/components/individual_principal_base_filter_component.rb b/app/components/individual_principal_base_filter_component.rbindex 0e8de2a9807..559e8e3c029 100644--- a/app/components/individual_principal_base_filter_component.rb+++ b/app/components/individual_principal_base_filter_component.rb@@ -29,9 +29,6 @@#++class IndividualPrincipalBaseFilterComponent < RailsComponent- include UsersHelper- include ActionView::Helpers::FormOptionsHelper-class << selfdef query(params)q = base_query.newdiff --git a/app/components/members/role_form_component.rb b/app/components/members/role_form_component.rbindex 7be33016185..81d63245359 100644--- a/app/components/members/role_form_component.rb+++ b/app/components/members/role_form_component.rb@@ -30,8 +30,6 @@module Membersclass RoleFormComponent < ::RailsComponent- include RemovedJsHelpersHelper-options :row, :params, :rolesdef memberdiff --git a/app/components/members/row_component.rb b/app/components/members/row_component.rbindex ea6c6f45773..18f40888c09 100644--- a/app/components/members/row_component.rb+++ b/app/components/members/row_component.rb@@ -30,9 +30,6 @@module Membersclass RowComponent < ::RowComponent- include AvatarHelper- include UsersHelper-property :principaldef member@@ -48,7 +45,7 @@ module Membersenddef name- icon = avatar principal, size: :mini+ icon = helpers.avatar principal, size: :miniicon + principal_linkend@@ -105,7 +102,7 @@ module Membersenddef status- translate_user_status(model.principal.status)+ helpers.translate_user_status(model.principal.status)enddef may_update?@@ -128,7 +125,7 @@ module Membersdef edit_linklink_to(- op_icon('icon icon-edit'),+ helpers.op_icon('icon icon-edit'),'#',class: "toggle-membership-button #{toggle_item_class_name}",'data-action': 'members-form#toggleMembershipEdit',@@ -148,7 +145,7 @@ module Membersdef delete_linkif model.deletable?link_to(- op_icon('icon icon-delete'),+ helpers.op_icon('icon icon-delete'),{ controller: '/members', action: 'destroy', id: model, page: params[:page] },method: :delete,data: { confirm: delete_link_confirmation, disable_with: I18n.t(:label_loading) },diff --git a/app/components/oauth/applications/row_component.rb b/app/components/oauth/applications/row_component.rbindex 219120e7760..68285e00a7f 100644--- a/app/components/oauth/applications/row_component.rb+++ b/app/components/oauth/applications/row_component.rb@@ -31,9 +31,6 @@module OAuthmodule Applicationsclass RowComponent < ::RowComponent- include ::IconsHelper- include ::OAuthHelper- include ::OpenProject::ObjectLinkingproperty :confidential@@ -51,7 +48,7 @@ module OAuthdef confidentialif application.confidential?- op_icon 'icon icon-checkmark'+ helpers.op_icon 'icon icon-checkmark'endend@@ -77,7 +74,7 @@ module OAuthenddef button_links- [edit_link, delete_link(oauth_application_path(application))]+ [edit_link, helpers.delete_link(oauth_application_path(application))]endendenddiff --git a/app/components/oauth/applications/table_component.rb b/app/components/oauth/applications/table_component.rbindex 3c26d7f2d4e..e30b5668942 100644--- a/app/components/oauth/applications/table_component.rb+++ b/app/components/oauth/applications/table_component.rb@@ -54,7 +54,7 @@ module OAutharia: { label: t('oauth.application.new') },class: 'wp-inline-create--add-link',title: t('oauth.application.new') do- op_icon('icon icon-add')+ helpers.op_icon('icon icon-add')endenddiff --git a/app/components/placeholder_users/row_component.rb b/app/components/placeholder_users/row_component.rbindex 969bc2d6e08..f752ca2a408 100644--- a/app/components/placeholder_users/row_component.rb+++ b/app/components/placeholder_users/row_component.rb@@ -28,11 +28,6 @@module PlaceholderUsersclass RowComponent < ::RowComponent- include AvatarHelper- include UsersHelper- include PlaceholderUsersHelper- include TooltipHelper-def placeholder_usermodelend@@ -42,7 +37,7 @@ module PlaceholderUsersenddef created_at- format_time placeholder_user.created_at+ helpers.format_time placeholder_user.created_atenddef button_links@@ -50,12 +45,12 @@ module PlaceholderUsersenddef delete_link- if can_delete_placeholder_user?(placeholder_user, User.current)+ if helpers.can_delete_placeholder_user?(placeholder_user, User.current)link_to deletion_info_placeholder_user_path(placeholder_user) do- tooltip_tag I18n.t('placeholder_users.delete_tooltip'), icon: 'icon-delete'+ helpers.tooltip_tag I18n.t('placeholder_users.delete_tooltip'), icon: 'icon-delete'endelse- tooltip_tag I18n.t('placeholder_users.right_to_manage_members_missing'), icon: 'icon-help2'+ helpers.tooltip_tag I18n.t('placeholder_users.right_to_manage_members_missing'), icon: 'icon-help2'endenddiff --git a/app/components/projects/row_component.html.erb b/app/components/projects/row_component.html.erbindex 9ea66e45be2..e20e6e7ddca 100644--- a/app/components/projects/row_component.html.erb+++ b/app/components/projects/row_component.html.erb@@ -37,7 +37,7 @@ See COPYRIGHT and LICENSE files for more details.</td><% end %><td class="buttons">- <% items = project_more_menu_items(project) %>+ <% items = helpers.project_more_menu_items(project) %><% if items.any? %><ul class="project-actions"><li aria-haspopup="true" title="<%= I18n.t(:label_open_menu) %>" class="drop-down">@@ -63,7 +63,7 @@ See COPYRIGHT and LICENSE files for more details.<td></td><td colspan="<%= columns.length%>" class="project--hierarchy"><div class="description-container wiki">- <%= format_text(short_project_description(project), project: project) %>+ <%= helpers.format_text(short_project_description(project), project: project) %></div></td></tr>diff --git a/app/components/projects/row_component.rb b/app/components/projects/row_component.rbindex fc51ff72d1e..9f2fdaf1d90 100644--- a/app/components/projects/row_component.rb+++ b/app/components/projects/row_component.rb@@ -30,10 +30,6 @@module Projectsclass RowComponent < ::RowComponent- include ProjectsHelper- include ProjectStatusHelper- include ::Redmine::I18n-def projectmodel.firstend@@ -69,11 +65,11 @@ module Projectsenddef created_at- format_date(project.created_at)+ helpers.format_date(project.created_at)enddef latest_activity_at- format_date(project.latest_activity_at)+ helpers.format_date(project.latest_activity_at)enddef required_disk_space@@ -91,7 +87,7 @@ module Projectsendcontent << ' '- content << link_to_project(project, {}, {}, false)+ content << helpers.link_to_project(project, {}, {}, false)contentend@@ -101,9 +97,9 @@ module Projectsstatus_code = project.status_codeif status_code- classes = project_status_css_class(status_code)+ classes = helpers.project_status_css_class(status_code)content << content_tag(:span, '', class: "project-status--bulb -inline #{classes}")- content << content_tag(:span, project_status_name(status_code), class: "project-status--name #{classes}")+ content << content_tag(:span, helpers.project_status_name(status_code), class: "project-status--name #{classes}")endcontent@@ -111,12 +107,12 @@ module Projectsdef status_explanationif project.status_explanation- content_tag :div, format_text(project.status_explanation), class: 'wiki'+ content_tag :div, helpers.format_text(project.status_explanation), class: 'wiki'endenddef public- checked_image project.public?+ helpers.checked_image project.public?enddef row_css_classdiff --git a/app/components/projects/table_component.html.erb b/app/components/projects/table_component.html.erbindex c65dee4e690..328add258e9 100644--- a/app/components/projects/table_component.html.erb+++ b/app/components/projects/table_component.html.erb@@ -45,7 +45,7 @@ See COPYRIGHT and LICENSE files for more details.<div class="generic-table--sort-header-outer generic-table--sort-header-outer_no-highlighting"><div class="generic-table--sort-header"><%= content_tag :a,- op_icon("icon-hierarchy"),+ helpers.op_icon("icon-hierarchy"),href: href_only_when_not_sort_lft,class: "spot-link #{deactivate_class_on_lft_sort}",title: t(:label_sort_by, value: %("#{t(:label_project_hierarchy)}")) %>@@ -70,9 +70,9 @@ See COPYRIGHT and LICENSE files for more details.<div class="generic-table--header-outer"><div class="generic-table--header"><% if params[:expand] == 'all' %>- <%= link_to t(:button_collapse_all), { params: safe_query_params(%w{filters page per_page sortBy}).except(:expand) } %>+ <%= link_to t(:button_collapse_all), { params: helpers.safe_query_params(%w{filters page per_page sortBy}).except(:expand) } %><% else %>- <%= link_to t(:button_expand_all), { params: safe_query_params(%w{filters page per_page sortBy}).merge(expand: 'all') } %>+ <%= link_to t(:button_expand_all), { params: helpers.safe_query_params(%w{filters page per_page sortBy}).merge(expand: 'all') } %><% end %></div></div>@@ -96,6 +96,6 @@ See COPYRIGHT and LICENSE files for more details.</div></div><% if paginated? %>- <%= pagination_links_full model %>+ <%= helpers.pagination_links_full model %><% end %></div>diff --git a/app/components/projects/table_component.rb b/app/components/projects/table_component.rbindex 72d681f4104..8558b3144a7 100644--- a/app/components/projects/table_component.rb+++ b/app/components/projects/table_component.rb@@ -30,8 +30,6 @@module Projectsclass TableComponent < ::TableComponent- include ProjectsHelper-options :params # We read collapsed state from paramsoptions :current_user # adds this option to those of the base class@@ -46,21 +44,24 @@ module Projects### The project sort by is handled differentlydef build_sort_header(column, options)- projects_sort_header_tag(column, options.merge(param: :json))+ helpers.projects_sort_header_tag(column, options.merge(param: :json))end# We don't return the project row# but the [project, level] array from the helperdef rows- @rows ||= to_enum(:projects_with_levels_order_sensitive, model).to_a # rubocop:disable Lint/ToEnumArguments+ @rows ||= begin+ projects_enumerator = ->(model) { to_enum(:projects_with_levels_order_sensitive, model).to_a } # rubocop:disable Lint/ToEnumArguments+ helpers.instance_exec(model, &projects_enumerator)+ endenddef initialize_sorted_model- sort_clear+ helpers.sort_clearorders = options[:orders]- sort_init orders- sort_update orders.map(&:first)+ helpers.sort_init orders+ helpers.sort_update orders.map(&:first)enddef paginated?@@ -68,13 +69,13 @@ module Projectsenddef deactivate_class_on_lft_sort- if sorted_by_lft?+ if helpers.sorted_by_lft?'spot-link_inactive'endenddef href_only_when_not_sort_lft- unless sorted_by_lft?+ unless helpers.sorted_by_lft?projects_path(sortBy: JSON::dump([['lft', 'asc']]))endenddiff --git a/app/components/rails_component.rb b/app/components/rails_component.rbindex 22238f91922..fe49cecf32e 100644--- a/app/components/rails_component.rb+++ b/app/components/rails_component.rb@@ -29,8 +29,6 @@#++class RailsComponent < ViewComponent::Base- include ApplicationHelper-attr_reader :model, :optionsdef initialize(model = nil, **options)diff --git a/app/components/settings/numeric_setting_component.html.erb b/app/components/settings/numeric_setting_component.html.erbindex 4e9297d6ca5..298953dc676 100644--- a/app/components/settings/numeric_setting_component.html.erb+++ b/app/components/settings/numeric_setting_component.html.erb@@ -29,7 +29,7 @@ See COPYRIGHT and LICENSE files for more details.<div class="form--field"><%=- setting_text_field(+ helpers.setting_text_field(name,size: size,unit: t("label_#{unit.singularize}_plural"),diff --git a/app/components/settings/numeric_setting_component.rb b/app/components/settings/numeric_setting_component.rbindex e7bb7a27f07..4658e00012f 100644--- a/app/components/settings/numeric_setting_component.rb+++ b/app/components/settings/numeric_setting_component.rb@@ -32,8 +32,6 @@ module Settings### A text field to enter numeric values.class NumericSettingComponent < ::RailsComponent- include SettingsHelper-options :unit, :titleoptions size: 3diff --git a/app/components/settings/text_setting_component.html.erb b/app/components/settings/text_setting_component.html.erbindex e615c88f6de..4347267e48e 100644--- a/app/components/settings/text_setting_component.html.erb+++ b/app/components/settings/text_setting_component.html.erb@@ -36,7 +36,7 @@ See COPYRIGHT and LICENSE files for more details.<%=styled_select_tag("lang",- options_for_select(lang_options_for_select(false), current_language.to_s),+ options_for_select(helpers.lang_options_for_select(false), current_language.to_s),id: "lang-for-#{name}",class: "lang-select-switch",container_class: '-slim'diff --git a/app/components/settings/text_setting_component.rb b/app/components/settings/text_setting_component.rbindex b87c9c4daa7..a49c3723b4e 100644--- a/app/components/settings/text_setting_component.rb+++ b/app/components/settings/text_setting_component.rb@@ -32,10 +32,7 @@ module Settings### A language switch and text area for updating a localized text setting.class TextSettingComponent < ::RailsComponent- include ActionView::Helpers::JavaScriptHelper- include ActionView::Helpers::FormOptionsHelperinclude OpenProject::FormTagHelper- include TextFormattingHelperoptions :name # name of setting and tag to differentiate between different language selectsdiff --git a/app/components/settings/time_zone_setting_component.rb b/app/components/settings/time_zone_setting_component.rbindex 40aeb90fedd..906d2139a16 100644--- a/app/components/settings/time_zone_setting_component.rb+++ b/app/components/settings/time_zone_setting_component.rb@@ -32,9 +32,6 @@ module Settings### A text field to enter numeric values.class TimeZoneSettingComponent < ::RailsComponent- include ActionView::Helpers::FormOptionsHelper- include SettingsHelper-options :form, :titleoptions container_class: "-wide"options include_blank: true@@ -63,7 +60,7 @@ module Settingsenddef render_setting_select- setting_select(+ helpers.setting_select(name,time_zone_entries,include_blank:,diff --git a/app/components/statuses/row_component.rb b/app/components/statuses/row_component.rbindex 21a6963d825..647132d42d0 100644--- a/app/components/statuses/row_component.rb+++ b/app/components/statuses/row_component.rb@@ -30,10 +30,6 @@module Statusesclass RowComponent < ::RowComponent- include ::IconsHelper- include ::ColorsHelper- include ReorderLinksHelper-def statusmodelend@@ -76,7 +72,7 @@ module Statusesdef delete_linklink_to(- op_icon('icon icon-delete'),+ helpers.op_icon('icon icon-delete'),status_path(status),method: :delete,data: { confirm: I18n.t(:text_are_you_sure) },diff --git a/app/components/statuses/table_component.rb b/app/components/statuses/table_component.rbindex 013e86cb422..199562a50c0 100644--- a/app/components/statuses/table_component.rb+++ b/app/components/statuses/table_component.rb@@ -47,7 +47,7 @@ module Statusesaria: { label: t(:label_work_package_status_new) },class: 'wp-inline-create--add-link',title: t(:label_work_package_status_new) do- op_icon('icon icon-add')+ helpers.op_icon('icon icon-add')endenddiff --git a/app/components/table_component.html.erb b/app/components/table_component.html.erbindex 8a26cb3b25d..ebaf4f905a2 100644--- a/app/components/table_component.html.erb+++ b/app/components/table_component.html.erb@@ -40,7 +40,7 @@ See COPYRIGHT and LICENSE files for more details.<tr><% headers.each do |name, options| %><% if sortable_column?(name) %>- <%= sort_header_tag name, options %>+ <%= helpers.sort_header_tag name, options %><% else %><th><div class="generic-table--sort-header-outer">@@ -76,5 +76,5 @@ See COPYRIGHT and LICENSE files for more details.</div></div><% if paginated? %>- <%= pagination_links_full rows %>+ <%= helpers.pagination_links_full rows %><% end %>diff --git a/app/components/table_component.rb b/app/components/table_component.rbindex 8746edfe2db..3f0cc4392cb 100644--- a/app/components/table_component.rb+++ b/app/components/table_component.rb@@ -31,9 +31,6 @@### Abstract view component. Subclass this for a concrete table.class TableComponent < RailsComponent- include SortHelper- include PaginationHelper-def initialize(rows: [], **options)super(rows, **options)end@@ -94,18 +91,22 @@ class TableComponent < RailsComponentenddef initialize_sorted_model- sort_init *initial_sort.map(&:to_s)- sort_update sortable_columns.map(&:to_s)+ helpers.sort_init *initial_sort.map(&:to_s)+ helpers.sort_update sortable_columns.map(&:to_s)@model = paginate_collection apply_sort(model)end+ def sort_criteria+ helpers.instance_variable_get(:@sort_criteria)+ end+def apply_sort(model)case modelwhen ActiveRecord::QueryMethods- sort_collection(model, sort_clause)+ sort_collection(model, helpers.sort_clause)when Queries::BaseQuerymodel- .order(@sort_criteria.to_query_hash)+ .order(sort_criteria.to_query_hash).resultselseraise ArgumentError, "Cannot sort the given model class #{model.class}"@@ -125,8 +126,8 @@ class TableComponent < RailsComponentdef paginate_collection(query)query- .page(page_param(controller.params))- .per_page(per_page_param)+ .page(helpers.page_param(controller.params))+ .per_page(helpers.per_page_param)enddef rowsdiff --git a/app/components/user_filter_component.rb b/app/components/user_filter_component.rbindex ad1b06cb400..eaac406b921 100644--- a/app/components/user_filter_component.rb+++ b/app/components/user_filter_component.rb@@ -73,7 +73,7 @@ class UserFilterComponent < IndividualPrincipalBaseFilterComponentenddef user_status_options- users_status_options_for_select status, extra: extra_user_status_options+ helpers.users_status_options_for_select status, extra: extra_user_status_optionsenddef extra_user_status_optionsdiff --git a/app/components/users/row_component.rb b/app/components/users/row_component.rbindex 1d155756bbf..c9974723345 100644--- a/app/components/users/row_component.rb+++ b/app/components/users/row_component.rb@@ -30,9 +30,6 @@module Usersclass RowComponent < ::RowComponent- include AvatarHelper- include UsersHelper-property :firstname, :lastnamedef user@@ -47,7 +44,7 @@ module Usersenddef login- icon = avatar user, size: :mini+ icon = helpers.avatar user, size: :minilink = link_to h(user.login), edit_user_path(user)icon + link@@ -58,19 +55,19 @@ module Usersenddef admin- checked_image user.admin?+ helpers.checked_image user.admin?enddef last_login_on- format_time user.last_login_on unless user.last_login_on.nil?+ helpers.format_time user.last_login_on unless user.last_login_on.nil?enddef created_at- format_time user.created_at+ helpers.format_time user.created_atenddef status- full_user_status user+ helpers.full_user_status userenddef button_links@@ -84,7 +81,7 @@ module Users# Don't show if non-adminreturn unless table.current_user.admin?- change_user_status_links user+ helpers.change_user_status_links userenddef column_css_class(column)diff --git a/app/components/versions/row_component.rb b/app/components/versions/row_component.rbindex f3e9a94b834..99b9e889e53 100644--- a/app/components/versions/row_component.rb+++ b/app/components/versions/row_component.rb@@ -30,8 +30,6 @@module Versionsclass RowComponent < ::RowComponent- include VersionsHelper-# Overriding cell's method to set the project instance variable.# A lot of helpers rely on the existence of it.def setup!(model, options)@@ -53,15 +51,15 @@ module Versionsenddef name- link_to_version version, {}, project: version.project+ helpers.link_to_version version, {}, project: version.projectenddef start_date- format_date(version.start_date)+ helpers.format_date(version.start_date)enddef effective_date- format_date(version.effective_date)+ helpers.format_date(version.effective_date)enddef description@@ -73,17 +71,17 @@ module Versionsenddef sharing- h(format_version_sharing(version.sharing))+ helpers.format_version_sharing(version.sharing)enddef wiki_pagereturn '' if wiki_page_title.blank? || version.project.wiki.nil?- link_to_if_authorized(wiki_page_title,- controller: '/wiki',- action: 'show',- project_id: version.project,- id: wiki_page_title) || h(wiki_page_title)+ helpers.link_to_if_authorized(wiki_page_title,+ controller: '/wiki',+ action: 'show',+ project_id: version.project,+ id: wiki_page_title) || h(wiki_page_title)enddef button_links@@ -99,21 +97,21 @@ module Versionsdef edit_linkreturn unless version.project == table.project- link_to_if_authorized '',- { controller: '/versions', action: 'edit', id: version },- class: 'icon icon-edit',- title: t(:button_edit)+ helpers.link_to_if_authorized '',+ { controller: '/versions', action: 'edit', id: version },+ class: 'icon icon-edit',+ title: t(:button_edit)enddef delete_linkreturn unless version.project == table.project- link_to_if_authorized '',- { controller: '/versions', action: 'destroy', id: version },- data: { confirm: t(:text_are_you_sure) },- method: :delete,- class: 'icon icon-delete',- title: t(:button_delete)+ helpers.link_to_if_authorized '',+ { controller: '/versions', action: 'destroy', id: version },+ data: { confirm: t(:text_are_you_sure) },+ method: :delete,+ class: 'icon icon-delete',+ title: t(:button_delete)enddef column_css_class(column)diff --git a/modules/backlogs/lib/open_project/backlogs/patches/versions/row_component_patch.rb b/modules/backlogs/lib/open_project/backlogs/patches/versions/row_component_patch.rbindex 7f9cad8c407..3c4d4ca5778 100644--- a/modules/backlogs/lib/open_project/backlogs/patches/versions/row_component_patch.rb+++ b/modules/backlogs/lib/open_project/backlogs/patches/versions/row_component_patch.rb@@ -36,9 +36,9 @@ module OpenProject::Backlogs::Patches::Versions::RowComponentPatchdef backlogs_edit_linkreturn if version.project == table.project || !table.project.module_enabled?("backlogs")- link_to_if_authorized '',- { controller: '/versions', action: 'edit', id: version, project_id: table.project.id },- class: 'icon icon-edit',- title: t(:button_edit)+ helpers.link_to_if_authorized '',+ { controller: '/versions', action: 'edit', id: version, project_id: table.project.id },+ class: 'icon icon-edit',+ title: t(:button_edit)endenddiff --git a/modules/bim/app/components/bim/ifc_models/row_component.rb b/modules/bim/app/components/bim/ifc_models/row_component.rbindex 9e94fbecbe9..73ea4c4c9eb 100644--- a/modules/bim/app/components/bim/ifc_models/row_component.rb+++ b/modules/bim/app/components/bim/ifc_models/row_component.rb@@ -1,10 +1,6 @@module Bimmodule IfcModelsclass RowComponent < ::RowComponent- include ::IconsHelper- include ::AvatarHelper- include ::Redmine::I18n-property :created_atdef title@@ -18,16 +14,16 @@ module Bimdef default?if model.is_default?- op_icon 'icon icon-checkmark'+ helpers.op_icon 'icon icon-checkmark'endenddef updated_at- format_date(model.updated_at)+ helpers.format_date(model.updated_at)enddef uploader- icon = avatar model.uploader, size: :mini+ icon = helpers.avatar model.uploader, size: :miniicon + model.uploader.nameend@@ -89,7 +85,7 @@ module Bimlink_to '',edit_bcf_project_ifc_model_path(model.project, model),class: 'icon icon-edit',- accesskey: accesskey(:edit),+ accesskey: helpers.accesskey(:edit),title: I18n.t(:button_edit)endenddiff --git a/modules/bim/app/components/bim/ifc_models/table_component.rb b/modules/bim/app/components/bim/ifc_models/table_component.rbindex ab0b2fd1b32..db381543671 100644--- a/modules/bim/app/components/bim/ifc_models/table_component.rb+++ b/modules/bim/app/components/bim/ifc_models/table_component.rb@@ -1,7 +1,6 @@module Bimmodule IfcModelsclass TableComponent < ::TableComponent- include ::IconsHelpercolumns :title, :default?, :created_at, :updated_at, :uploader, :processingdef initial_sort@@ -16,7 +15,7 @@ module Bimlink_to(new_bcf_project_ifc_model_path,class: 'wp-inline-create--add-link',title: I18n.t('ifc_models.label_new_ifc_model')) do- op_icon('icon icon-add')+ helpers.op_icon('icon icon-add')endenddiff --git a/modules/boards/app/components/boards/row_component.rb b/modules/boards/app/components/boards/row_component.rbindex f4e081a0dd2..5256834460c 100644--- a/modules/boards/app/components/boards/row_component.rb+++ b/modules/boards/app/components/boards/row_component.rb@@ -30,10 +30,8 @@module Boardsclass RowComponent < ::RowComponent- include ApplicationHelper-def project_id- link_to_project model.project, {}, {}, false+ helpers.link_to_project model.project, {}, {}, falseenddef name@@ -41,7 +39,7 @@ module Boardsenddef created_at- safe_join([format_date(model.created_at), format_time(model.created_at, false)], " ")+ safe_join([helpers.format_date(model.created_at), helpers.format_time(model.created_at, false)], " ")enddef typediff --git a/modules/calendar/app/components/calendar/row_component.rb b/modules/calendar/app/components/calendar/row_component.rbindex dd62990624e..0da2962cd43 100644--- a/modules/calendar/app/components/calendar/row_component.rb+++ b/modules/calendar/app/components/calendar/row_component.rb@@ -28,9 +28,6 @@module Calendarclass RowComponent < ::RowComponent- include ApplicationHelper- include ::Redmine::I18n-def querymodelend@@ -42,7 +39,7 @@ module Calendarenddef created_at- format_time(query.created_at)+ helpers.format_time(query.created_at)enddef button_linksdiff --git a/modules/ldap_groups/app/components/ldap_groups/memberships/row_component.rb b/modules/ldap_groups/app/components/ldap_groups/memberships/row_component.rbindex 34b16c0f32d..8df89bda343 100644--- a/modules/ldap_groups/app/components/ldap_groups/memberships/row_component.rb+++ b/modules/ldap_groups/app/components/ldap_groups/memberships/row_component.rb@@ -42,7 +42,7 @@ module LdapGroupsenddef added- format_date(membership.updated_at)+ helpers.format_date(membership.updated_at)endendenddiff --git a/modules/ldap_groups/app/components/ldap_groups/synchronized_filters/row_component.rb b/modules/ldap_groups/app/components/ldap_groups/synchronized_filters/row_component.rbindex 41f51864b77..c78c04f2243 100644--- a/modules/ldap_groups/app/components/ldap_groups/synchronized_filters/row_component.rb+++ b/modules/ldap_groups/app/components/ldap_groups/synchronized_filters/row_component.rb@@ -31,9 +31,6 @@module LdapGroupsmodule SynchronizedFiltersclass RowComponent < ::RowComponent- include ::IconsHelper- include ::PasswordHelper-property :base_dndef synchronized_filter@@ -53,7 +50,7 @@ module LdapGroupsenddef sync_users- checked_image synchronized_filter.sync_users+ helpers.checked_image synchronized_filter.sync_usersenddef button_linksdiff --git a/modules/ldap_groups/app/components/ldap_groups/synchronized_filters/table_component.rb b/modules/ldap_groups/app/components/ldap_groups/synchronized_filters/table_component.rbindex 6589f0679d8..487fdc90c8e 100644--- a/modules/ldap_groups/app/components/ldap_groups/synchronized_filters/table_component.rb+++ b/modules/ldap_groups/app/components/ldap_groups/synchronized_filters/table_component.rb@@ -49,7 +49,7 @@ module LdapGroupslink_to({ controller: target_controller, action: :new },class: 'budget-add-row wp-inline-create--add-link',title: I18n.t('ldap_groups.synchronized_filters.add_new')) do- op_icon('icon icon-add')+ helpers.op_icon('icon icon-add')endenddiff --git a/modules/ldap_groups/app/components/ldap_groups/synchronized_groups/row_component.rb b/modules/ldap_groups/app/components/ldap_groups/synchronized_groups/row_component.rbindex b35088ec175..35dfa45cf84 100644--- a/modules/ldap_groups/app/components/ldap_groups/synchronized_groups/row_component.rb+++ b/modules/ldap_groups/app/components/ldap_groups/synchronized_groups/row_component.rb@@ -31,9 +31,6 @@module LdapGroupsmodule SynchronizedGroupsclass RowComponent < ::RowComponent- include ::IconsHelper- include ::PasswordHelper-def synchronized_groupmodelend@@ -51,7 +48,7 @@ module LdapGroupsenddef sync_users- checked_image synchronized_group.sync_users+ helpers.checked_image synchronized_group.sync_usersenddef usersdiff --git a/modules/ldap_groups/app/components/ldap_groups/synchronized_groups/table_component.rb b/modules/ldap_groups/app/components/ldap_groups/synchronized_groups/table_component.rbindex 7b8a78e4540..be208c2c7f0 100644--- a/modules/ldap_groups/app/components/ldap_groups/synchronized_groups/table_component.rb+++ b/modules/ldap_groups/app/components/ldap_groups/synchronized_groups/table_component.rb@@ -53,7 +53,7 @@ module LdapGroupslink_to({ controller: target_controller, action: :new },class: 'budget-add-row wp-inline-create--add-link',title: I18n.t('ldap_groups.synchronized_groups.add_new')) do- op_icon('icon icon-add')+ helpers.op_icon('icon icon-add')endenddiff --git a/modules/meeting/app/components/meetings/row_component.rb b/modules/meeting/app/components/meetings/row_component.rbindex b9855385f10..a2bb3f670c3 100644--- a/modules/meeting/app/components/meetings/row_component.rb+++ b/modules/meeting/app/components/meetings/row_component.rb@@ -30,10 +30,8 @@module Meetingsclass RowComponent < ::RowComponent- include ApplicationHelper-def project- link_to_project model.project, {}, {}, false+ helpers.link_to_project model.project, {}, {}, falseenddef title@@ -41,7 +39,7 @@ module Meetingsenddef start_time- safe_join([format_date(model.start_time), format_time(model.start_time, false)], " ")+ safe_join([helpers.format_date(model.start_time), helpers.format_time(model.start_time, false)], " ")enddef durationdiff --git a/modules/openid_connect/app/components/openid_connect/providers/row_component.rb b/modules/openid_connect/app/components/openid_connect/providers/row_component.rbindex 65834c95f04..350b8473d53 100644--- a/modules/openid_connect/app/components/openid_connect/providers/row_component.rb+++ b/modules/openid_connect/app/components/openid_connect/providers/row_component.rb@@ -1,8 +1,6 @@module OpenIDConnectmodule Providersclass RowComponent < ::RowComponent- include ::IconsHelper-def providermodelend@@ -29,7 +27,7 @@ module OpenIDConnectdef edit_linklink_to(- op_icon('icon icon-edit button--link'),+ helpers.op_icon('icon icon-edit button--link'),url_for(action: :edit, id: provider.id),title: t(:button_edit))@@ -37,7 +35,7 @@ module OpenIDConnectdef delete_linklink_to(- op_icon('icon icon-delete button--link'),+ helpers.op_icon('icon icon-delete button--link'),url_for(action: :destroy, id: provider.id),method: :delete,data: { confirm: I18n.t(:text_are_you_sure) },diff --git a/modules/storages/app/components/storages/admin/row_component.rb b/modules/storages/app/components/storages/admin/row_component.rbindex c218441d7d3..ef561ae2bda 100644--- a/modules/storages/app/components/storages/admin/row_component.rb+++ b/modules/storages/app/components/storages/admin/row_component.rb@@ -30,11 +30,6 @@# Used by: Storages table in table_component.rbmodule Storages::Adminclass RowComponent < ::RowComponent- include ::IconsHelper # Global helper for icons, defines op_icon and icon_wrapper?- include ::AvatarHelper # Global helper for avatar (image of a user)- include ::Redmine::I18n # Internationalization support (defines I18n.t(...) translation)- include ::ApplicationHelper # For `accesskey` method-def storagerowend@@ -51,7 +46,7 @@ module Storages::Admindelegate :provider_type, to: :storagedef creator- icon = avatar storage.creator, size: :mini+ icon = helpers.avatar storage.creator, size: :miniicon + storage.creator.nameend@@ -72,7 +67,7 @@ module Storages::Adminlink_to '',edit_admin_settings_storage_path(storage),class: 'icon icon-edit',- accesskey: accesskey(:edit),+ accesskey: helpers.accesskey(:edit),title: I18n.t(:button_edit)endenddiff --git a/modules/storages/app/components/storages/admin/table_component.rb b/modules/storages/app/components/storages/admin/table_component.rbindex c4eb1085884..6340f4ce355 100644--- a/modules/storages/app/components/storages/admin/table_component.rb+++ b/modules/storages/app/components/storages/admin/table_component.rb@@ -33,8 +33,6 @@# See also: row_component.rb defining the rows of the tablemodule Storages::Adminclass TableComponent < ::TableComponent- include ::IconsHelper # Global helper for icons, defines op_icon(...)-# Defines the list of columns in the table using symbols.# These symbols are used below to define header (top of the table)# and contents of the components@@ -56,7 +54,7 @@ module Storages::Adminlink_to(new_admin_settings_storage_path,class: 'wp-inline-create--add-link',title: I18n.t('storages.label_new_storage')) do- op_icon('icon icon-add')+ helpers.op_icon('icon icon-add')endenddiff --git a/modules/storages/app/components/storages/projects_storages/row_component.rb b/modules/storages/app/components/storages/projects_storages/row_component.rbindex e835dace27d..f53d2542b7d 100644--- a/modules/storages/app/components/storages/projects_storages/row_component.rb+++ b/modules/storages/app/components/storages/projects_storages/row_component.rb@@ -30,9 +30,6 @@# associated with a projectmodule Storages::ProjectsStoragesclass RowComponent < ::RowComponent- include ::IconsHelper- include ::AvatarHelper- include ::Redmine::I18ndef project_storagerowend@@ -48,7 +45,7 @@ module Storages::ProjectsStoragesenddef creator- icon = avatar project_storage.creator, size: :mini+ icon = helpers.avatar project_storage.creator, size: :miniicon + project_storage.creator.nameenddiff --git a/modules/storages/app/components/storages/projects_storages/table_component.rb b/modules/storages/app/components/storages/projects_storages/table_component.rbindex dee88e50228..e371457ccf2 100644--- a/modules/storages/app/components/storages/projects_storages/table_component.rb+++ b/modules/storages/app/components/storages/projects_storages/table_component.rb@@ -33,8 +33,6 @@# for every "column" defined below.module Storages::ProjectsStoragesclass TableComponent < ::TableComponent- include ::IconsHelper-columns :name,:provider_type,:creator,@@ -52,7 +50,7 @@ module Storages::ProjectsStorageslink_to(new_project_settings_projects_storage_path,class: 'wp-inline-create--add-link',title: I18n.t('storages.label_new_storage')) do- op_icon('icon icon-add')+ helpers.op_icon('icon icon-add')endenddiff --git a/modules/team_planner/app/components/team_planner/row_component.rb b/modules/team_planner/app/components/team_planner/row_component.rbindex 71eb937700c..23b220502f5 100644--- a/modules/team_planner/app/components/team_planner/row_component.rb+++ b/modules/team_planner/app/components/team_planner/row_component.rb@@ -28,9 +28,6 @@module TeamPlannerclass RowComponent < ::RowComponent- include ApplicationHelper- include ::Redmine::I18n-def querymodelend@@ -42,7 +39,7 @@ module TeamPlannerenddef created_at- format_time(query.created_at)+ helpers.format_time(query.created_at)enddef assigneesdiff --git a/modules/two_factor_authentication/app/components/two_factor_authentication/devices/row_component.rb b/modules/two_factor_authentication/app/components/two_factor_authentication/devices/row_component.rbindex ddbc804f1a3..f5fb8536193 100644--- a/modules/two_factor_authentication/app/components/two_factor_authentication/devices/row_component.rb+++ b/modules/two_factor_authentication/app/components/two_factor_authentication/devices/row_component.rb@@ -1,9 +1,6 @@module ::TwoFactorAuthenticationmodule Devicesclass RowComponent < ::RowComponent- include ::IconsHelper- include ::PasswordHelper-def devicemodelend@@ -20,7 +17,7 @@ module ::TwoFactorAuthenticationdef defaultif device.default- op_icon 'icon-yes'+ helpers.op_icon 'icon-yes'else'-'end@@ -28,13 +25,13 @@ module ::TwoFactorAuthenticationdef confirmedif device.active- op_icon 'icon-yes'+ helpers.op_icon 'icon-yes'elsif table.self_table?link_to t('two_factor_authentication.devices.confirm_now'),{ controller: table.target_controller, action: :confirm, device_id: device.id }else- op_icon 'icon-no'+ helpers.op_icon 'icon-no'endend@@ -48,7 +45,7 @@ module ::TwoFactorAuthenticationenddef make_default_link- password_confirmation_form_for(+ helpers.password_confirmation_form_for(device,url: { controller: table.target_controller, action: :make_default, device_id: device.id },method: :post,@@ -67,7 +64,7 @@ module ::TwoFactorAuthenticationI18n.t(:button_delete)end- password_confirmation_form_for(+ helpers.password_confirmation_form_for(device,url: { controller: table.target_controller, action: :destroy, device_id: device.id },method: :delete,diff --git a/modules/two_factor_authentication/app/components/two_factor_authentication/devices/table_component.rb b/modules/two_factor_authentication/app/components/two_factor_authentication/devices/table_component.rbindex f1d88e391ab..e689d01a5ab 100644--- a/modules/two_factor_authentication/app/components/two_factor_authentication/devices/table_component.rb+++ b/modules/two_factor_authentication/app/components/two_factor_authentication/devices/table_component.rb@@ -33,7 +33,7 @@ module ::TwoFactorAuthenticationlink_to({ controller: target_controller, action: :new },class: 'budget-add-row wp-inline-create--add-link',title: I18n.t('two_factor_authentication.devices.add_new')) do- op_icon('icon icon-add')+ helpers.op_icon('icon icon-add')endendenddiff --git a/modules/webhooks/app/components/webhooks/outgoing/deliveries/response_component.html.erb b/modules/webhooks/app/components/webhooks/outgoing/deliveries/response_component.html.erbindex 5f63fe747f6..c66f63de748 100644--- a/modules/webhooks/app/components/webhooks/outgoing/deliveries/response_component.html.erb+++ b/modules/webhooks/app/components/webhooks/outgoing/deliveries/response_component.html.erb@@ -4,7 +4,7 @@data-modal-class-name="webhooks--response-body-modal"><a class="log-response-<%= id %>-modal--activation-link" title="<%= title %>">- <%= op_icon('icon-info1') %>+ <%= helpers.op_icon('icon-info1') %><%= t(:button_show) %></a><div class="modal-delivery-element">diff --git a/modules/webhooks/app/components/webhooks/outgoing/deliveries/row_component.rb b/modules/webhooks/app/components/webhooks/outgoing/deliveries/row_component.rbindex d3d9074f7cf..d7c9b674577 100644--- a/modules/webhooks/app/components/webhooks/outgoing/deliveries/row_component.rb+++ b/modules/webhooks/app/components/webhooks/outgoing/deliveries/row_component.rb@@ -2,8 +2,6 @@ module ::Webhooksmodule Outgoingmodule Deliveriesclass RowComponent < ::RowComponent- include ::IconsHelper-property :id, :description, :event_name, :response_codedef logdiff --git a/modules/webhooks/app/components/webhooks/outgoing/webhooks/row_component.rb b/modules/webhooks/app/components/webhooks/outgoing/webhooks/row_component.rbindex aef519745ce..1833c9c235f 100644--- a/modules/webhooks/app/components/webhooks/outgoing/webhooks/row_component.rb+++ b/modules/webhooks/app/components/webhooks/outgoing/webhooks/row_component.rb@@ -2,8 +2,6 @@ module ::Webhooksmodule Outgoingmodule Webhooksclass RowComponent < ::RowComponent- include ::IconsHelper-property :descriptiondef webhook@@ -17,7 +15,7 @@ module ::Webhooksdef enabledif webhook.enabled?- op_icon 'icon-yes'+ helpers.op_icon 'icon-yes'endend@@ -73,7 +71,7 @@ module ::Webhooksdef edit_linklink_to(- op_icon('icon icon-edit button--link'),+ helpers.op_icon('icon icon-edit button--link'),{ controller: table.target_controller, action: :edit, webhook_id: webhook.id },title: t(:button_edit))@@ -81,7 +79,7 @@ module ::Webhooksdef delete_linklink_to(- op_icon('icon icon-delete button--link'),+ helpers.op_icon('icon icon-delete button--link'),{ controller: table.target_controller, action: :destroy, webhook_id: webhook.id },method: :delete,data: { confirm: I18n.t(:text_are_you_sure) },diff --git a/modules/webhooks/app/components/webhooks/outgoing/webhooks/table_component.rb b/modules/webhooks/app/components/webhooks/outgoing/webhooks/table_component.rbindex 79269a23081..b9c2cf52ce6 100644--- a/modules/webhooks/app/components/webhooks/outgoing/webhooks/table_component.rb+++ b/modules/webhooks/app/components/webhooks/outgoing/webhooks/table_component.rb@@ -20,7 +20,7 @@ module ::Webhookslink_to({ controller: target_controller, action: :new },class: 'webhooks--add-row wp-inline-create--add-link',title: I18n.t('webhooks.outgoing.label_add_new')) do- op_icon('icon icon-add')+ helpers.op_icon('icon icon-add')endend