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
Rename wide columns to main column and update width
Mir Bhatia73281b53ac9d
diff --git a/app/components/op_primer/border_box_row_component.rb b/app/components/op_primer/border_box_row_component.rbindex fabc5e2be67..4da530abcc4 100644--- a/app/components/op_primer/border_box_row_component.rb+++ b/app/components/op_primer/border_box_row_component.rb@@ -45,7 +45,8 @@ module OpPrimerdef grid_column_classes(column)classes = ["op-border-box-grid--row-item"]classes << column_css_class(column)- classes << "op-border-box-grid--wide-column" if table.wide_column?(column)+ classes << "op-border-box-grid--main-column" if table.main_column?(column)+ classes << "ellipsis" unless table.main_column?(column)classes << "op-border-box-grid--no-mobile" unless visible_on_mobile?(column)classes.compact.join(" ")diff --git a/app/components/op_primer/border_box_table_component.rb b/app/components/op_primer/border_box_table_component.rbindex 9aed4a5d22b..b005fe4be6d 100644--- a/app/components/op_primer/border_box_table_component.rb+++ b/app/components/op_primer/border_box_table_component.rb@@ -59,22 +59,22 @@ module OpPrimer@mobile_labels = names.map(&:to_sym)end- # Declare wide columns, that will result in a grid column span of 3+ # Declare main columns, that will result in a grid column span of 2 and not truncate text## column_grid_span :title#- def wide_columns(*names)- return Array(@wide_columns) if names.empty?+ def main_column(*names)+ return Array(@main_columns) if names.empty?- @wide_columns = names.map(&:to_sym)+ @main_columns = names.map(&:to_sym)endenddelegate :mobile_columns, :mobile_labels,to: :class- def wide_column?(column)- self.class.wide_columns.include?(column)+ def main_column?(column)+ self.class.main_column.include?(column)enddef header_args(_column)@@ -88,7 +88,7 @@ module OpPrimerdef header_classes(column)classes = [heading_class]- classes << "op-border-box-grid--wide-column" if wide_column?(column)+ classes << "op-border-box-grid--main-column" if main_column?(column)classes.join(" ")enddiff --git a/app/components/op_primer/border_box_table_component.sass b/app/components/op_primer/border_box_table_component.sassindex 785d88c3c70..d6b3dac8155 100644--- a/app/components/op_primer/border_box_table_component.sass+++ b/app/components/op_primer/border_box_table_component.sass@@ -15,12 +15,19 @@justify-content: flex-startalign-items: center+ &--row-item+ &:not(:first-child)+ margin-left: 6px++ &:not(:last-child)+ margin-right: 6px+&--mobile-heading,&--row-labeldisplay: none- &--wide-column- grid-column: span 3+ &--main-column+ grid-column: span 2@media screen and (max-width: $breakpoint-md).op-border-box-griddiff --git a/lookbook/previews/op_primer/border_box_table_component_preview/custom_column_widths.html.erb b/lookbook/previews/op_primer/border_box_table_component_preview/custom_column_widths.html.erbindex 10cb8864e81..9066de13c70 100644--- a/lookbook/previews/op_primer/border_box_table_component_preview/custom_column_widths.html.erb+++ b/lookbook/previews/op_primer/border_box_table_component_preview/custom_column_widths.html.erb@@ -2,7 +2,7 @@table = Class.new(OpPrimer::BorderBoxTableComponent) docolumns :foo, :bar- wide_columns :foo+ main_column :foodef self.name"MyTable"diff --git a/modules/auth_saml/app/components/saml/providers/table_component.rb b/modules/auth_saml/app/components/saml/providers/table_component.rbindex a1134e62b34..3093d260275 100644--- a/modules/auth_saml/app/components/saml/providers/table_component.rb+++ b/modules/auth_saml/app/components/saml/providers/table_component.rb@@ -7,7 +7,7 @@ module Samlmobile_labels :users- wide_columns :name+ main_column :namedef initial_sort%i[id asc]diff --git a/modules/meeting/app/components/meetings/table_component.rb b/modules/meeting/app/components/meetings/table_component.rbindex 8c97fac4fae..cd18de9b891 100644--- a/modules/meeting/app/components/meetings/table_component.rb+++ b/modules/meeting/app/components/meetings/table_component.rb@@ -38,6 +38,8 @@ module Meetingsmobile_labels :project_name+ main_column :title+def sortable?trueenddiff --git a/modules/openid_connect/app/components/openid_connect/providers/table_component.rb b/modules/openid_connect/app/components/openid_connect/providers/table_component.rbindex 9718c7c8a84..a0696ab019d 100644--- a/modules/openid_connect/app/components/openid_connect/providers/table_component.rb+++ b/modules/openid_connect/app/components/openid_connect/providers/table_component.rb@@ -3,7 +3,7 @@ module OpenIDConnectclass TableComponent < ::OpPrimer::BorderBoxTableComponentcolumns :name, :type, :users, :creator, :created_at- wide_columns :name+ main_column :namemobile_columns :name, :type, :users