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

allow setting an id on the container for TableComponent

Klaus Zanders11810c217d65
diff --git a/app/components/op_primer/border_box_table_component.html.erb b/app/components/op_primer/border_box_table_component.html.erb
index 927e3f9d997..2bba751fdde 100644
--- a/app/components/op_primer/border_box_table_component.html.erb
+++ b/app/components/op_primer/border_box_table_component.html.erb
@@ -30,6 +30,7 @@ See COPYRIGHT and LICENSE files for more details.
<%=
render(
border_box_container(
+ id: container_id,
classes: container_class,
test_selector:
)
diff --git a/app/components/table_component.html.erb b/app/components/table_component.html.erb
index 9449d5dc489..f3125367435 100644
--- a/app/components/table_component.html.erb
+++ b/app/components/table_component.html.erb
@@ -27,7 +27,7 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
-<div class="generic-table--container <%= container_class %>" data-test-selector="<%= test_selector %>">
+<div class="generic-table--container <%= container_class %>" data-test-selector="<%= test_selector %>" id="<%= container_id %>">
<div class="generic-table--results-container">
<table class="generic-table" data-controller="table-highlighting">
<colgroup>
diff --git a/app/components/table_component.rb b/app/components/table_component.rb
index e88c9db9593..369f8a9c69c 100644
--- a/app/components/table_component.rb
+++ b/app/components/table_component.rb
@@ -159,6 +159,10 @@ class TableComponent < ApplicationComponent
nil
end
+ def container_id
+ nil
+ end
+
def columns
self.class.columns.reject { skip_column?(it) }
end