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
[#47012] Replace PlaceholderUsers::TableCell by ViewComponent
Dombi Attilab3062220571d
diff --git a/app/cells/placeholder_users/placeholder_user_filter_cell.rb b/app/components/placeholder_users/placeholder_user_filter_component.rbsimilarity index 93%rename from app/cells/placeholder_users/placeholder_user_filter_cell.rbrename to app/components/placeholder_users/placeholder_user_filter_component.rbindex 9cb7e83df25..4a4a57fce21 100644--- a/app/cells/placeholder_users/placeholder_user_filter_cell.rb+++ b/app/components/placeholder_users/placeholder_user_filter_component.rb@@ -27,8 +27,8 @@#++module PlaceholderUsers- class PlaceholderUserFilterCell < IndividualPrincipalBaseFilterCell- options :roles, :clear_url, :project+ class PlaceholderUserFilterComponent < IndividualPrincipalBaseFilterComponent+ options :roles, :clear_urlclass << selfdef base_querydiff --git a/app/cells/placeholder_users/row_cell.rb b/app/components/placeholder_users/row_component.rbsimilarity index 94%rename from app/cells/placeholder_users/row_cell.rbrename to app/components/placeholder_users/row_component.rbindex 956d0bd937b..969bc2d6e08 100644--- a/app/cells/placeholder_users/row_cell.rb+++ b/app/components/placeholder_users/row_component.rb@@ -27,7 +27,7 @@#++module PlaceholderUsers- class RowCell < ::RowCell+ class RowComponent < ::RowComponentinclude AvatarHelperinclude UsersHelperinclude PlaceholderUsersHelper@@ -41,6 +41,10 @@ module PlaceholderUserslink_to h(placeholder_user.name), edit_placeholder_user_path(placeholder_user)end+ def created_at+ format_time placeholder_user.created_at+ end+def button_links[delete_link].compactenddiff --git a/app/cells/placeholder_users/table_cell.rb b/app/components/placeholder_users/table_component.rbsimilarity index 94%rename from app/cells/placeholder_users/table_cell.rbrename to app/components/placeholder_users/table_component.rbindex 3178e6a60bb..cc37b2e3b90 100644--- a/app/cells/placeholder_users/table_cell.rb+++ b/app/components/placeholder_users/table_component.rb@@ -27,8 +27,7 @@#++module PlaceholderUsers- class TableCell < ::TableCell- options :current_user # adds this option to those of the base class+ class TableComponent < ::TableComponentcolumns :name, :created_atdef initial_sortdiff --git a/app/controllers/placeholder_users_controller.rb b/app/controllers/placeholder_users_controller.rbindex 9e69896a2ac..806bf3e95d0 100644--- a/app/controllers/placeholder_users_controller.rb+++ b/app/controllers/placeholder_users_controller.rb@@ -40,7 +40,7 @@ class PlaceholderUsersController < ApplicationControllerbefore_action :authorize_deletion, only: %i[deletion_info destroy]def index- @placeholder_users = PlaceholderUsers::PlaceholderUserFilterCell.query params+ @placeholder_users = PlaceholderUsers::PlaceholderUserFilterComponent.query paramsrespond_to do |format|format.html dodiff --git a/app/views/placeholder_users/index.html.erb b/app/views/placeholder_users/index.html.erbindex 089c8b5b5e8..af5e36bd1e4 100644--- a/app/views/placeholder_users/index.html.erb+++ b/app/views/placeholder_users/index.html.erb@@ -49,9 +49,9 @@ See COPYRIGHT and LICENSE files for more details.<% if has_ee %>- <%= rails_cell PlaceholderUsers::PlaceholderUserFilterCell, params %>+ <%= render PlaceholderUsers::PlaceholderUserFilterComponent.new(params) %> - <%= rails_cell PlaceholderUsers::TableCell, @placeholder_users, project: @project, current_user: current_user %>+ <%= render PlaceholderUsers::TableComponent.new(rows: @placeholder_users) %><% else %><%= render template: 'common/upsale',locals: {