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 specifying a scheme for a Table row

Klaus Zanders953edbe29b2d
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 2bba751fdde..6473ca6726e 100644
--- a/app/components/op_primer/border_box_table_component.html.erb
+++ b/app/components/op_primer/border_box_table_component.html.erb
@@ -67,8 +67,9 @@ See COPYRIGHT and LICENSE files for more details.
component.with_row(scheme: :default) { render_blank_slate }
else
rows.each do |row|
- component.with_row(scheme: :default) do
- render(row_class.new(row:, table: self))
+ row_instance = row_class.new(row: row, table: self)
+ component.with_row(scheme: row_instance.scheme) do
+ render(row_instance)
end
end
end
diff --git a/app/components/row_component.rb b/app/components/row_component.rb
index 092ac500996..7bb982ad7ce 100644
--- a/app/components/row_component.rb
+++ b/app/components/row_component.rb
@@ -68,6 +68,10 @@ class RowComponent < ApplicationComponent
nil
end
+ def scheme
+ :default
+ end
+
def checkmark(condition)
if condition
helpers.op_icon "icon icon-checkmark"