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

Refactor namespace of `Overview::TableComponent`

Aaron Contreras7091fc02f37c
diff --git a/modules/team_planner/app/components/team_planner_overview/row_component.rb b/modules/team_planner/app/components/team_planner/overview/row_component.rb
similarity index 74%
rename from modules/team_planner/app/components/team_planner_overview/row_component.rb
rename to modules/team_planner/app/components/team_planner/overview/row_component.rb
index c73df3a4fae..bffab29ed0b 100644
--- a/modules/team_planner/app/components/team_planner_overview/row_component.rb
+++ b/modules/team_planner/app/components/team_planner/overview/row_component.rb
@@ -26,24 +26,26 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-module TeamPlannerOverview
- class RowComponent < ::RowComponent
- def query
- model
- end
+module TeamPlanner
+ module Overview
+ class RowComponent < ::RowComponent
+ def query
+ model
+ end
- delegate :project, to: :query
+ delegate :project, to: :query
- def name
- link_to query.name, project_team_planner_path(project, query.id)
- end
+ def name
+ link_to query.name, project_team_planner_path(project, query.id)
+ end
- def project_id
- helpers.link_to_project model.project, {}, {}, false
- end
+ def project_id
+ helpers.link_to_project model.project, {}, {}, false
+ end
- def created_at
- helpers.format_time(query.created_at)
+ def created_at
+ helpers.format_time(query.created_at)
+ end
end
end
end
diff --git a/modules/team_planner/app/components/team_planner_overview/table_component.rb b/modules/team_planner/app/components/team_planner/overview/table_component.rb
similarity index 67%
rename from modules/team_planner/app/components/team_planner_overview/table_component.rb
rename to modules/team_planner/app/components/team_planner/overview/table_component.rb
index 924d16b7885..0afaa67a378 100644
--- a/modules/team_planner/app/components/team_planner_overview/table_component.rb
+++ b/modules/team_planner/app/components/team_planner/overview/table_component.rb
@@ -26,30 +26,32 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-module TeamPlannerOverview
- class TableComponent < ::TableComponent
- options :current_user
- columns :name, :project_id, :created_at
- sortable_columns :name, :project_id, :created_at
+module TeamPlanner
+ module Overview
+ class TableComponent < ::TableComponent
+ options :current_user
+ columns :name, :project_id, :created_at
+ sortable_columns :name, :project_id, :created_at
- def initial_sort
- %w[name asc]
- end
+ def initial_sort
+ %w[name asc]
+ end
- def sortable?
- true
- end
+ def sortable?
+ true
+ end
- def paginated?
- true
- end
+ def paginated?
+ true
+ end
- def headers
- [
- [:name, { caption: I18n.t(:label_name) }],
- [:project_id, { caption: Query.human_attribute_name(:project) }],
- [:created_at, { caption: Query.human_attribute_name(:created_at) }]
- ]
+ def headers
+ [
+ [:name, { caption: I18n.t(:label_name) }],
+ [:project_id, { caption: Query.human_attribute_name(:project) }],
+ [:created_at, { caption: Query.human_attribute_name(:created_at) }]
+ ]
+ end
end
end
end
diff --git a/modules/team_planner/app/views/team_planner/team_planner/overview.html.erb b/modules/team_planner/app/views/team_planner/team_planner/overview.html.erb
index 7d7899a5d1e..5ec1711568b 100644
--- a/modules/team_planner/app/views/team_planner/team_planner/overview.html.erb
+++ b/modules/team_planner/app/views/team_planner/team_planner/overview.html.erb
@@ -2,4 +2,4 @@
<%= toolbar title: t(:'team_planner.label_team_planner_plural') %>
-<%= render ::TeamPlannerOverview::TableComponent.new(rows: @views, current_user: current_user) %>
+<%= render ::TeamPlanner::Overview::TableComponent.new(rows: @views, current_user: current_user) %>