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

Info component

Oliver Günther16532f70fccb
diff --git a/modules/auth_saml/app/components/saml/providers/forms/general_info_form_component.html.erb b/modules/auth_saml/app/components/saml/providers/forms/general_info_form_component.html.erb
new file mode 100644
index 00000000000..a3454d52b3c
--- /dev/null
+++ b/modules/auth_saml/app/components/saml/providers/forms/general_info_form_component.html.erb
@@ -0,0 +1,24 @@
+<%=
+ primer_form_with(
+ model: provider,
+ url: saml_providers_path,
+ method: :post,
+ ) do |form|
+ flex_layout do |general_info_row|
+ general_info_row.with_row(mb: 3) do
+ render(Saml::Providers::Infocomponent.new(provider))
+ end
+
+ general_info_row.with_row do
+ render(
+ Storages::Admin::SubmitOrCancelForm.new(
+ form,
+ storage:,
+ submit_button_options:,
+ cancel_button_options:
+ )
+ )
+ end
+ end
+ end
+%>
diff --git a/modules/auth_saml/app/components/saml/providers/forms/general_info_form_component.rb b/modules/auth_saml/app/components/saml/providers/forms/general_info_form_component.rb
new file mode 100644
index 00000000000..9d8216c4310
--- /dev/null
+++ b/modules/auth_saml/app/components/saml/providers/forms/general_info_form_component.rb
@@ -0,0 +1,39 @@
+# frozen_string_literal: true
+
+#-- 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::Forms
+ class GeneralInfoFormComponent < ApplicationComponent
+ attr_reader :provider
+
+ def initialize(provider:)
+ @provider = provider
+ end
+ end
+end
diff --git a/modules/auth_saml/app/components/saml/providers/info_component.html.erb b/modules/auth_saml/app/components/saml/providers/info_component.html.erb
new file mode 100644
index 00000000000..8c1957332f5
--- /dev/null
+++ b/modules/auth_saml/app/components/saml/providers/info_component.html.erb
@@ -0,0 +1,3 @@
+<%= render(Primer::Beta::Heading.new(tag: :h4)) { I18n.t('saml.info.title') } %>
+
+<%= render(Primer::Beta::Text.new) { I18n.t('saml.info.description') }%>
diff --git a/modules/auth_saml/app/components/saml/providers/info_component.rb b/modules/auth_saml/app/components/saml/providers/info_component.rb
new file mode 100644
index 00000000000..b1d79afe940
--- /dev/null
+++ b/modules/auth_saml/app/components/saml/providers/info_component.rb
@@ -0,0 +1,7 @@
+module Saml
+ module Providers
+ class InfoComponent < ApplicationComponent
+ alias_method :provider, :model
+ end
+ end
+end
diff --git a/modules/auth_saml/app/forms/saml/providers/provider_name_input_form.rb b/modules/auth_saml/app/forms/saml/providers/provider_name_input_form.rb
new file mode 100644
index 00000000000..e8ed28a62d1
--- /dev/null
+++ b/modules/auth_saml/app/forms/saml/providers/provider_name_input_form.rb
@@ -0,0 +1,44 @@
+#-- 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 ProviderNameInputForm < ApplicationForm
+ form do |storage_form|
+ storage_form.text_field(
+ name: :name,
+ label: I18n.t("activerecord.attributes.storages/storage.name"),
+ required: true,
+ caption: I18n.t("storages.instructions.name"),
+ placeholder: I18n.t("storages.label_file_storage"),
+ input_width: :large
+ )
+ end
+ end
+ end
+end
diff --git a/modules/auth_saml/config/locales/en.yml b/modules/auth_saml/config/locales/en.yml
index 5121b7a28ca..886292f0a10 100644
--- a/modules/auth_saml/config/locales/en.yml
+++ b/modules/auth_saml/config/locales/en.yml
@@ -11,6 +11,10 @@ en:
sp_entity_id: Service entity ID
saml:
menu_title: SAML providers
+ info:
+ title: "SAML Protocol Configuration Parameters"
+ description: >
+ Use these parameters to configure your identity provider connection to OpenProject.
providers:
label_add_new: Add a new SAML provider
label_edit: Edit SAML provider %{name}