Skip to content

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

[#48267] Replace Two factor authentication cells by ViewComponent

Dombi Attilaa021ede33cd0
diff --git a/modules/two_factor_authentication/app/cells/two_factor_authentication/devices/row_cell.rb b/modules/two_factor_authentication/app/components/two_factor_authentication/devices/row_component.rb
similarity index 98%
rename from modules/two_factor_authentication/app/cells/two_factor_authentication/devices/row_cell.rb
rename to modules/two_factor_authentication/app/components/two_factor_authentication/devices/row_component.rb
index 905d31ca7a8..ddbc804f1a3 100644
--- a/modules/two_factor_authentication/app/cells/two_factor_authentication/devices/row_cell.rb
+++ b/modules/two_factor_authentication/app/components/two_factor_authentication/devices/row_component.rb
@@ -1,6 +1,6 @@
module ::TwoFactorAuthentication
module Devices
- class RowCell < ::RowCell
+ class RowComponent < ::RowComponent
include ::IconsHelper
include ::PasswordHelper
diff --git a/modules/two_factor_authentication/app/cells/two_factor_authentication/devices/table_cell.rb b/modules/two_factor_authentication/app/components/two_factor_authentication/devices/table_component.rb
similarity index 97%
rename from modules/two_factor_authentication/app/cells/two_factor_authentication/devices/table_cell.rb
rename to modules/two_factor_authentication/app/components/two_factor_authentication/devices/table_component.rb
index cb95246dedf..f1d88e391ab 100644
--- a/modules/two_factor_authentication/app/cells/two_factor_authentication/devices/table_cell.rb
+++ b/modules/two_factor_authentication/app/components/two_factor_authentication/devices/table_component.rb
@@ -1,6 +1,6 @@
module ::TwoFactorAuthentication
module Devices
- class TableCell < ::TableCell
+ class TableComponent < ::TableComponent
options :admin_table
columns :device_type, :default, :confirmed
diff --git a/modules/two_factor_authentication/app/views/two_factor_authentication/my/two_factor_devices/index.html.erb b/modules/two_factor_authentication/app/views/two_factor_authentication/my/two_factor_devices/index.html.erb
index b713eba3722..d515bc645b1 100644
--- a/modules/two_factor_authentication/app/views/two_factor_authentication/my/two_factor_devices/index.html.erb
+++ b/modules/two_factor_authentication/app/views/two_factor_authentication/my/two_factor_devices/index.html.erb
@@ -44,7 +44,7 @@
<section class="account--section">
<h2><%= t 'two_factor_authentication.label_devices' %></h2>
- <%= rails_cell ::TwoFactorAuthentication::Devices::TableCell, @two_factor_devices, admin_table: false %>
+ <%= render ::TwoFactorAuthentication::Devices::TableComponent.new(rows: @two_factor_devices, admin_table: false) %>
</section>
<section class="account--section">
diff --git a/modules/two_factor_authentication/app/views/users/_two_factor_authentication_admin.html.erb b/modules/two_factor_authentication/app/views/users/_two_factor_authentication_admin.html.erb
index ff8a4a42075..01b46eff98d 100644
--- a/modules/two_factor_authentication/app/views/users/_two_factor_authentication_admin.html.erb
+++ b/modules/two_factor_authentication/app/views/users/_two_factor_authentication_admin.html.erb
@@ -55,6 +55,6 @@
<% end %>
<% end %>
- <%= rails_cell ::TwoFactorAuthentication::Devices::TableCell, devices, admin_table: true || @user != User.current %>
+ <%= render ::TwoFactorAuthentication::Devices::TableComponent.new(rows: devices, admin_table: true || @user != User.current) %>
</div>
</section>