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
Better table rendering
Oliver Günther1970bed7ffbb
diff --git a/app/components/op_primer/border_box_table_component.html.erb b/app/components/op_primer/border_box_table_component.html.erbindex f7488e61583..293aa2d79ed 100644--- a/app/components/op_primer/border_box_table_component.html.erb+++ b/app/components/op_primer/border_box_table_component.html.erb@@ -44,13 +44,13 @@ See COPYRIGHT and LICENSE files for more details.endend- component.with_row(scheme: :default) do- if rows.empty?- render_blank_slate- else- rows.each do |row|- concat render(row_class.new(row:, table: self))- end+ if rows.empty?+ component.with_row(scheme: :default) { render_blank_slate }+ end++ rows.each do |row|+ component.with_row(scheme: :default) do+ render(row_class.new(row:, table: self))endendenddiff --git a/modules/auth_saml/app/components/saml/providers/row_component.rb b/modules/auth_saml/app/components/saml/providers/row_component.rbindex d76e40b5f18..bf52b4957d0 100644--- a/modules/auth_saml/app/components/saml/providers/row_component.rb+++ b/modules/auth_saml/app/components/saml/providers/row_component.rb@@ -5,18 +5,27 @@ module Samlmodelend+ def column_args(column)+ if column == :name+ { style: "grid-column: span 3" }+ else+ super+ end+ end+def nameconcat render(Primer::Beta::Link.new(- scheme: :primary,- href: url_for(action: :show, id: provider.id)- )) { provider.display_name || provider.name }+ scheme: :primary,+ href: url_for(action: :show, id: provider.id)+ )) { provider.display_name || provider.name }if provider.idp_sso_service_urlconcat render(Primer::Beta::Text.new(- tag: :p,- font_size: :small,- color: :subtle- )) { provider.idp_sso_service_url }+ tag: :p,+ classes: "-break-word",+ font_size: :small,+ color: :subtle+ )) { provider.idp_sso_service_url }endend@@ -26,7 +35,7 @@ module Samldef edit_linklink_to(- helpers.op_icon('icon icon-edit button--link'),+ helpers.op_icon("icon icon-edit button--link"),url_for(action: :edit, id: provider.id),title: t(:button_edit))@@ -48,7 +57,7 @@ module Samlreturn if provider.readonlylink_to(- helpers.op_icon('icon icon-delete button--link'),+ helpers.op_icon("icon icon-delete button--link"),url_for(action: :destroy, id: provider.id),method: :delete,data: { confirm: I18n.t(:text_are_you_sure) },diff --git a/modules/auth_saml/app/components/saml/providers/table_component.rb b/modules/auth_saml/app/components/saml/providers/table_component.rbindex 564072dc3dc..fd9d403a57e 100644--- a/modules/auth_saml/app/components/saml/providers/table_component.rb+++ b/modules/auth_saml/app/components/saml/providers/table_component.rb@@ -7,29 +7,37 @@ module Saml%i[id asc]end+ def header_args(column)+ if column == :name+ { style: "grid-column: span 3" }+ else+ super+ end+ end+def sortable?falseenddef empty_row_message- I18n.t 'saml.providers.no_results_table'+ I18n.t "saml.providers.no_results_table"enddef headers[- ['name', { caption: I18n.t('attributes.name') }],- ['users', { caption: I18n.t(:label_user_plural) }],- ['creator', { caption: I18n.t("js.label_created_by") }],- ['created_at', { caption: Saml::Provider.human_attribute_name(:created_at) }]+ [:name, { caption: I18n.t("attributes.name") }],+ [:users, { caption: I18n.t(:label_user_plural) }],+ [:creator, { caption: I18n.t("js.label_created_by") }],+ [:created_at, { caption: Saml::Provider.human_attribute_name(:created_at) }]]enddef blank_title- I18n.t('saml.providers.label_empty_title')+ I18n.t("saml.providers.label_empty_title")enddef blank_description- I18n.t('saml.providers.label_empty_description')+ I18n.t("saml.providers.label_empty_description")enddef blank_icondiff --git a/modules/auth_saml/app/components/saml/providers/view_component.html.erb b/modules/auth_saml/app/components/saml/providers/view_component.html.erbindex 58e9b882b0e..32e51ae50ee 100644--- a/modules/auth_saml/app/components/saml/providers/view_component.html.erb+++ b/modules/auth_saml/app/components/saml/providers/view_component.html.erb@@ -23,5 +23,13 @@render(Saml::Providers::Sections::MetadataComponent.new(provider))endend++ component.with_row(scheme: :default) do+ if edit_state == :configuration+ render(Saml::Providers::Sections::ConfigurationFormComponent.new(provider))+ else+ render(Saml::Providers::Sections::ConfigurationComponent.new(provider))+ end+ endend%>