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

Sidepanel

Oliver Günther82f9571206db
diff --git a/modules/auth_saml/app/components/saml/providers/side_panel/metadata_component.html.erb b/modules/auth_saml/app/components/saml/providers/side_panel/metadata_component.html.erb
new file mode 100644
index 00000000000..51d7f2b7e18
--- /dev/null
+++ b/modules/auth_saml/app/components/saml/providers/side_panel/metadata_component.html.erb
@@ -0,0 +1,14 @@
+<%=
+ render(Primer::OpenProject::SidePanel::Section.new) do |section|
+ section.with_title { I18n.t("saml.providers.label_metadata_endpoint") }
+ section.with_description { I18n.t("saml.instructions.sp_metadata_endpoint") }
+
+ component_wrapper do
+ render(Primer::Beta::Link.new(
+ href: metadata_endpoint,
+ classes: "-break-word",
+ target: :_blank
+ )) { metadata_endpoint }
+ end
+ end
+%>
diff --git a/modules/auth_saml/app/components/saml/providers/side_panel/metadata_component.rb b/modules/auth_saml/app/components/saml/providers/side_panel/metadata_component.rb
new file mode 100644
index 00000000000..b04fd9e7709
--- /dev/null
+++ b/modules/auth_saml/app/components/saml/providers/side_panel/metadata_component.rb
@@ -0,0 +1,47 @@
+#-- copyright
+# OpenProject is an open source project management software.
+# Copyright (C) 2012-2024 the OpenProject GmbH
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License version 3.
+#
+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+# Copyright (C) 2006-2013 Jean-Philippe Lang
+# Copyright (C) 2010-2013 the ChiliProject Team
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# See COPYRIGHT and LICENSE files for more details.
+#++
+
+module Saml::Providers
+ module SidePanel
+ class MetadataComponent < ApplicationComponent
+ include ApplicationHelper
+ include OpTurbo::Streamable
+ include OpPrimer::ComponentHelpers
+
+ def initialize(provider:)
+ super()
+
+ @provider = provider
+ end
+
+ def metadata_endpoint
+ URI.join(helpers.root_url, "/auth/#{@provider.slug}/metadata").to_s
+ end
+ end
+ end
+end
diff --git a/modules/auth_saml/app/components/saml/providers/side_panel_component.html.erb b/modules/auth_saml/app/components/saml/providers/side_panel_component.html.erb
new file mode 100644
index 00000000000..d2182f1a908
--- /dev/null
+++ b/modules/auth_saml/app/components/saml/providers/side_panel_component.html.erb
@@ -0,0 +1,11 @@
+<%=
+ component_wrapper do
+ render(Primer::OpenProject::SidePanel.new(spacious: true)) do |panel|
+ [
+ Saml::Providers::SidePanel::MetadataComponent.new(provider: @provider),
+ ].each do |component|
+ panel.with_section(component)
+ end
+ end
+ end
+%>
diff --git a/modules/auth_saml/app/components/saml/providers/side_panel_component.rb b/modules/auth_saml/app/components/saml/providers/side_panel_component.rb
new file mode 100644
index 00000000000..6c7328908b2
--- /dev/null
+++ b/modules/auth_saml/app/components/saml/providers/side_panel_component.rb
@@ -0,0 +1,43 @@
+#-- copyright
+# OpenProject is an open source project management software.
+# Copyright (C) 2012-2024 the OpenProject GmbH
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License version 3.
+#
+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+# Copyright (C) 2006-2013 Jean-Philippe Lang
+# Copyright (C) 2010-2013 the ChiliProject Team
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# See COPYRIGHT and LICENSE files for more details.
+#++
+
+module Saml
+ module Providers
+ class SidePanelComponent < ApplicationComponent
+ include ApplicationHelper
+ include OpTurbo::Streamable
+ include OpPrimer::ComponentHelpers
+
+ def initialize(provider)
+ super()
+
+ @provider = provider
+ end
+ end
+ end
+end
diff --git a/modules/auth_saml/app/views/saml/providers/edit.html.erb b/modules/auth_saml/app/views/saml/providers/edit.html.erb
index edaa869215e..414c1d1d508 100644
--- a/modules/auth_saml/app/views/saml/providers/edit.html.erb
+++ b/modules/auth_saml/app/views/saml/providers/edit.html.erb
@@ -3,15 +3,15 @@
<% html_title(t(:label_administration), page_title) -%>
<%= render(Primer::OpenProject::PageHeader.new) do |header| %>
- <% header.with_title { I18n.t(:label_edit_x, x: @provider.display_name) } %>
+ <% header.with_title { @provider.display_name } %>
<% header.with_breadcrumbs([{ href: admin_index_path, text: t("label_administration") },
{ href: saml_providers_path, text: t('saml.providers.plural') },
- I18n.t(:label_edit_x, x: @provider.display_name)]) %>
+ @provider.display_name]) %>
<% header.with_description do %>
<%= link_translate(
- 'saml.instructions.new_description',
+ 'saml.instructions.documentation_link',
links: {
docs_url: ::OpenProject::Static::Links[:sysadmin_docs][:saml][:href],
},
diff --git a/modules/auth_saml/app/views/saml/providers/new.html.erb b/modules/auth_saml/app/views/saml/providers/new.html.erb
index 34ada5f0688..9826181dbdf 100644
--- a/modules/auth_saml/app/views/saml/providers/new.html.erb
+++ b/modules/auth_saml/app/views/saml/providers/new.html.erb
@@ -9,7 +9,7 @@
<% header.with_description do %>
<%= link_translate(
- 'saml.instructions.new_description',
+ 'saml.instructions.documentation_link',
links: {
docs_url: ::OpenProject::Static::Links[:sysadmin_docs][:saml][:href],
},
diff --git a/modules/auth_saml/app/views/saml/providers/show.html.erb b/modules/auth_saml/app/views/saml/providers/show.html.erb
index 1b37c4b7344..d687831a72d 100644
--- a/modules/auth_saml/app/views/saml/providers/show.html.erb
+++ b/modules/auth_saml/app/views/saml/providers/show.html.erb
@@ -27,4 +27,14 @@
<% end %>
-<%= render(Saml::Providers::ViewComponent.new(@provider)) %>
+<%=
+ render(Primer::Alpha::Layout.new(stacking_breakpoint: :md)) do |content|
+ content.with_main do
+ render Saml::Providers::ViewComponent.new(@provider)
+ end
+
+ content.with_sidebar(row_placement: :start, col_placement: :end) do
+ render Saml::Providers::SidePanelComponent.new(@provider)
+ end
+ end
+%>
diff --git a/modules/auth_saml/config/locales/en.yml b/modules/auth_saml/config/locales/en.yml
index 5c57046d79a..d58290f4f18 100644
--- a/modules/auth_saml/config/locales/en.yml
+++ b/modules/auth_saml/config/locales/en.yml
@@ -28,6 +28,7 @@ en:
label_empty_description: "Add a provider to see them here."
label_automatic_configuration: Automatic configuration
label_metadata: Metadata
+ label_metadata_endpoint: Metadata endpoint
label_configuration_details: "Identity provider endpoints and certificates"
label_add_new: New SAML identity provider
label_edit: Edit SAML identity provider %{name}
@@ -57,8 +58,8 @@ en:
metadata_url: "Metadata URL"
metadata_xml: "Metadata XML"
instructions:
- new_description: >
- Add a new SAML provider. Please refer to our [documentation on configuring SAML providers](docs_url).
+ documentation_link: >
+ Please refer to our [documentation on configuring SAML providers](docs_url) for more information on these configuration options.
display_name: >
The name of the provider. This will be displayed as the login button and in the list of providers.
metadata_url: >
@@ -78,3 +79,6 @@ en:
You can enter multiple certificates by separating them with a newline.
name_identifier_format: >
Set the name identifier format to be used for the SAML assertion.
+ sp_metadata_endpoint: >
+ This is the URL where the OpenProject SAML metadata is available.
+ Optionally use it to configure your identity provider.