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

Better table columns

Oliver Günthera4c9860730af
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 60a5ca6177b..f7488e61583 100644
--- a/app/components/op_primer/border_box_table_component.html.erb
+++ b/app/components/op_primer/border_box_table_component.html.erb
@@ -49,7 +49,7 @@ See COPYRIGHT and LICENSE files for more details.
render_blank_slate
else
rows.each do |row|
- render(row_class.new(row:, table: self))
+ concat render(row_class.new(row:, table: self))
end
end
end
diff --git a/modules/auth_saml/app/components/saml/providers/row_component.rb b/modules/auth_saml/app/components/saml/providers/row_component.rb
index ef5ef2f5eb4..d76e40b5f18 100644
--- a/modules/auth_saml/app/components/saml/providers/row_component.rb
+++ b/modules/auth_saml/app/components/saml/providers/row_component.rb
@@ -11,12 +11,12 @@ module Saml
href: url_for(action: :show, id: provider.id)
)) { provider.display_name || provider.name }
- if provider.idp_sso_target_url
+ if provider.idp_sso_service_url
concat render(Primer::Beta::Text.new(
tag: :p,
font_size: :small,
color: :subtle
- )) { provider.idp_sso_target_url }
+ )) { provider.idp_sso_service_url }
end
end
@@ -33,7 +33,15 @@ module Saml
end
def users
- "1234"
+ User.where("identity_url LIKE ?", "%#{provider.slug}%").count.to_s
+ end
+
+ def creator
+ helpers.avatar(provider.creator, size: :mini, hide_name: false)
+ end
+
+ def created_at
+ helpers.format_time provider.created_at
end
def delete_link
diff --git a/modules/auth_saml/app/components/saml/providers/table_component.rb b/modules/auth_saml/app/components/saml/providers/table_component.rb
index fde31d890db..564072dc3dc 100644
--- a/modules/auth_saml/app/components/saml/providers/table_component.rb
+++ b/modules/auth_saml/app/components/saml/providers/table_component.rb
@@ -1,7 +1,7 @@
module Saml
module Providers
class TableComponent < ::OpPrimer::BorderBoxTableComponent
- columns :name, :users
+ columns :name, :users, :creator, :created_at
def initial_sort
%i[id asc]
@@ -18,7 +18,9 @@ module Saml
def headers
[
['name', { caption: I18n.t('attributes.name') }],
- ['users', { caption: I18n.t(:label_user_plural) }]
+ ['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) }]
]
end
diff --git a/modules/auth_saml/app/models/saml/provider.rb b/modules/auth_saml/app/models/saml/provider.rb
index abc2e786405..ff5db3dbd16 100644
--- a/modules/auth_saml/app/models/saml/provider.rb
+++ b/modules/auth_saml/app/models/saml/provider.rb
@@ -9,6 +9,9 @@ module Saml
store_attribute :options, :metadata_url, :string
store_attribute :options, :metadata_xml, :string
+ store_attribute :options, :idp_sso_service_url, :string
+ store_attribute :options, :idp_slo_service_url, :string
+
store_attribute :options, :mapping_login, :json
store_attribute :options, :mapping_mail, :json
store_attribute :options, :mapping_firstname, :json