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
Common section show component
Oliver Güntheracce81ad2e78
diff --git a/modules/auth_saml/app/components/saml/providers/sections/configuration_component.html.erb b/modules/auth_saml/app/components/saml/providers/sections/configuration_component.html.erbdeleted file mode 100644index e8c01321fd7..00000000000--- a/modules/auth_saml/app/components/saml/providers/sections/configuration_component.html.erb+++ /dev/null@@ -1,36 +0,0 @@-<%=- grid_layout('op-saml-view-row', tag: :div, align_items: :center) do |grid|- grid.with_area(:title, mr: 3) do- concat render(Primer::Beta::Text.new(font_weight: :bold)) { t("saml.providers.label_configuration_details") }- if provider.configured?- concat render(Primer::Beta::Label.new(scheme: :success, ml: 1)) { t(:label_completed) }- elsif provider.persisted?- concat render(Primer::Beta::Label.new(scheme: :attention, ml: 1)) { t(:label_incomplete) }- end- end-- grid.with_area(:description) do- render(Primer::Beta::Text.new(tag: :p, font_size: :small, color: :subtle)) do- t("saml.providers.section_texts.configuration")- end- end-- if provider.persisted?- grid.with_area(:action) do- flex_layout(justify_content: :flex_end) do |icons_container|- icons_container.with_column do- render(- Primer::Beta::IconButton.new(- icon: :pencil,- tag: :a,- scheme: :invisible,- href: edit_saml_provider_path(provider, edit_state: :configuration),- aria: { label: I18n.t(:label_edit) }- )- )- end- end- end- end- end-%>diff --git a/modules/auth_saml/app/components/saml/providers/sections/configuration_component.rb b/modules/auth_saml/app/components/saml/providers/sections/configuration_component.rbdeleted file mode 100644index 8d7c13d4bb2..00000000000--- a/modules/auth_saml/app/components/saml/providers/sections/configuration_component.rb+++ /dev/null@@ -1,34 +0,0 @@-# 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::Sections- class ConfigurationComponent < SectionComponent- end-enddiff --git a/modules/auth_saml/app/components/saml/providers/sections/encryption_component.html.erb b/modules/auth_saml/app/components/saml/providers/sections/encryption_component.html.erbdeleted file mode 100644index 0f269019421..00000000000--- a/modules/auth_saml/app/components/saml/providers/sections/encryption_component.html.erb+++ /dev/null@@ -1,36 +0,0 @@-<%=- grid_layout('op-saml-view-row', tag: :div, align_items: :center) do |grid|- grid.with_area(:title, mr: 3) do- concat render(Primer::Beta::Text.new(font_weight: :bold)) { t("saml.providers.label_configuration_encryption") }- if provider.configured?- concat render(Primer::Beta::Label.new(scheme: :success, ml: 1)) { t(:label_completed) }- elsif provider.persisted?- concat render(Primer::Beta::Label.new(scheme: :attention, ml: 1)) { t(:label_incomplete) }- end- end-- grid.with_area(:description) do- render(Primer::Beta::Text.new(tag: :p, font_size: :small, color: :subtle)) do- t("saml.providers.section_texts.encryption")- end- end-- if provider.persisted?- grid.with_area(:action) do- flex_layout(justify_content: :flex_end) do |icons_container|- icons_container.with_column do- render(- Primer::Beta::IconButton.new(- icon: :pencil,- tag: :a,- scheme: :invisible,- href: edit_saml_provider_path(provider, edit_state: :encryption),- aria: { label: I18n.t(:label_edit) }- )- )- end- end- end- end- end-%>diff --git a/modules/auth_saml/app/components/saml/providers/sections/encryption_component.rb b/modules/auth_saml/app/components/saml/providers/sections/encryption_component.rbdeleted file mode 100644index d863aa41499..00000000000--- a/modules/auth_saml/app/components/saml/providers/sections/encryption_component.rb+++ /dev/null@@ -1,34 +0,0 @@-# 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::Sections- class EncryptionComponent < SectionComponent- end-enddiff --git a/modules/auth_saml/app/components/saml/providers/sections/mapping_component.html.erb b/modules/auth_saml/app/components/saml/providers/sections/mapping_component.html.erbdeleted file mode 100644index 11c93ab2f2f..00000000000--- a/modules/auth_saml/app/components/saml/providers/sections/mapping_component.html.erb+++ /dev/null@@ -1,31 +0,0 @@-<%=- grid_layout('op-saml-view-row', tag: :div, align_items: :center) do |grid|- grid.with_area(:title, mr: 3) do- concat render(Primer::Beta::Text.new(font_weight: :bold)) { t("saml.providers.label_mapping") }- end-- grid.with_area(:description) do- render(Primer::Beta::Text.new(tag: :p, font_size: :small, color: :subtle)) do- t("saml.providers.section_texts.mapping")- end- end-- if provider.persisted?- grid.with_area(:action) do- flex_layout(justify_content: :flex_end) do |icons_container|- icons_container.with_column do- render(- Primer::Beta::IconButton.new(- icon: :pencil,- tag: :a,- scheme: :invisible,- href: edit_saml_provider_path(provider, edit_state: :mapping),- aria: { label: I18n.t(:label_edit) }- )- )- end- end- end- end- end-%>diff --git a/modules/auth_saml/app/components/saml/providers/sections/metadata_component.html.erb b/modules/auth_saml/app/components/saml/providers/sections/metadata_component.html.erbdeleted file mode 100644index 61ac7fb6f06..00000000000--- a/modules/auth_saml/app/components/saml/providers/sections/metadata_component.html.erb+++ /dev/null@@ -1,36 +0,0 @@-<%=- grid_layout('op-saml-view-row', tag: :div, align_items: :center) do |grid|- grid.with_area(:title, mr: 3) do- concat render(Primer::Beta::Text.new(font_weight: :bold)) { t("saml.providers.label_metadata") }- if provider.has_metadata?- concat render(Primer::Beta::Label.new(scheme: :success, ml: 1)) { t(:label_completed) }- elsif provider.persisted?- concat render(Primer::Beta::Label.new(scheme: :secondary, ml: 1)) { t(:label_not_configured) }- end- end-- grid.with_area(:description) do- render(Primer::Beta::Text.new(tag: :p, font_size: :small, color: :subtle)) do- t("saml.providers.section_texts.metadata")- end- end-- if provider.persisted?- grid.with_area(:action) do- flex_layout(justify_content: :flex_end) do |icons_container|- icons_container.with_column do- render(- Primer::Beta::IconButton.new(- icon: :pencil,- tag: :a,- scheme: :invisible,- href: edit_saml_provider_path(provider, edit_state: :metadata),- aria: { label: I18n.t(:label_edit) }- )- )- end- end- end- end- end-%>diff --git a/modules/auth_saml/app/components/saml/providers/sections/metadata_component.rb b/modules/auth_saml/app/components/saml/providers/sections/metadata_component.rbdeleted file mode 100644index 601e831e185..00000000000--- a/modules/auth_saml/app/components/saml/providers/sections/metadata_component.rb+++ /dev/null@@ -1,34 +0,0 @@-# 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::Sections- class MetadataComponent < SectionComponent- end-enddiff --git a/modules/auth_saml/app/components/saml/providers/sections/name_component.html.erb b/modules/auth_saml/app/components/saml/providers/sections/name_component.html.erbdeleted file mode 100644index 9564ef43050..00000000000--- a/modules/auth_saml/app/components/saml/providers/sections/name_component.html.erb+++ /dev/null@@ -1,30 +0,0 @@-<%=- grid_layout('op-saml-view-row', tag: :div, align_items: :center) do |grid|- grid.with_area(:title, mr: 3) do- concat render(Primer::Beta::Text.new(font_weight: :bold)) { t("saml.providers.singular") }- concat render(Primer::Beta::Label.new(scheme: :success, ml: 1)) { t(:label_completed) }- end-- grid.with_area(:description) do- render(Primer::Beta::Text.new(tag: :p, font_size: :small, color: :subtle)) do- t("saml.providers.section_texts.display_name")- end- end-- grid.with_area(:action) do- flex_layout(justify_content: :flex_end) do |icons_container|- icons_container.with_column do- render(- Primer::Beta::IconButton.new(- icon: :pencil,- tag: :a,- scheme: :invisible,- href: edit_saml_provider_path(provider, edit_state: :name),- aria: { label: I18n.t(:label_edit) }- )- )- end- end- end- end-%>diff --git a/modules/auth_saml/app/components/saml/providers/sections/name_component.rb b/modules/auth_saml/app/components/saml/providers/sections/name_component.rbdeleted file mode 100644index d7ea52c9b49..00000000000--- a/modules/auth_saml/app/components/saml/providers/sections/name_component.rb+++ /dev/null@@ -1,34 +0,0 @@-# 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::Sections- class NameComponent < SectionComponent- end-enddiff --git a/modules/auth_saml/app/components/saml/providers/sections/request_attributes_component.rb b/modules/auth_saml/app/components/saml/providers/sections/request_attributes_component.rbdeleted file mode 100644index 578831c8c50..00000000000--- a/modules/auth_saml/app/components/saml/providers/sections/request_attributes_component.rb+++ /dev/null@@ -1,34 +0,0 @@-# 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::Sections- class RequestAttributesComponent < SectionComponent- end-enddiff --git a/modules/auth_saml/app/components/saml/providers/sections/request_attributes_component.html.erb b/modules/auth_saml/app/components/saml/providers/sections/show_component.html.erbsimilarity index 83%rename from modules/auth_saml/app/components/saml/providers/sections/request_attributes_component.html.erbrename to modules/auth_saml/app/components/saml/providers/sections/show_component.html.erbindex 8cf99919e83..1d0734ca694 100644--- a/modules/auth_saml/app/components/saml/providers/sections/request_attributes_component.html.erb+++ b/modules/auth_saml/app/components/saml/providers/sections/show_component.html.erb@@ -1,12 +1,15 @@<%=grid_layout('op-saml-view-row', tag: :div, align_items: :center) do |grid|grid.with_area(:title, mr: 3) do- concat render(Primer::Beta::Text.new(font_weight: :bold)) { t("saml.providers.requested_attributes") }+ concat render(Primer::Beta::Text.new(font_weight: :bold)) { @heading }+ if @label+ concat render(Primer::Beta::Label.new(scheme: @label_scheme, ml: 1)) { @label }+ endendgrid.with_area(:description) dorender(Primer::Beta::Text.new(tag: :p, font_size: :small, color: :subtle)) do- t("saml.providers.section_texts.requested_attributes")+ @descriptionendend@@ -19,7 +22,7 @@icon: :pencil,tag: :a,scheme: :invisible,- href: edit_saml_provider_path(provider, edit_state: :requested_attributes),+ href: edit_saml_provider_path(provider, edit_state: @edit_state),aria: { label: I18n.t(:label_edit) }))diff --git a/modules/auth_saml/app/components/saml/providers/sections/mapping_component.rb b/modules/auth_saml/app/components/saml/providers/sections/show_component.rbsimilarity index 80%rename from modules/auth_saml/app/components/saml/providers/sections/mapping_component.rbrename to modules/auth_saml/app/components/saml/providers/sections/show_component.rbindex 572d79b76fe..7ec0b13904e 100644--- a/modules/auth_saml/app/components/saml/providers/sections/mapping_component.rb+++ b/modules/auth_saml/app/components/saml/providers/sections/show_component.rb@@ -29,6 +29,15 @@#++#module Saml::Providers::Sections- class MappingComponent < SectionComponent+ class ShowComponent < SectionComponent+ def initialize(provider, edit_state:, heading:, description:, label: nil, label_scheme: :attention)+ super(provider)++ @edit_state = edit_state+ @heading = heading+ @description = description+ @label = label+ @label_scheme = label_scheme+ endendenddiff --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 703a20aac5d..ac6410c16f8 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@@ -8,7 +8,12 @@if edit_state == :namerender(Saml::Providers::Sections::NameFormComponent.new(provider))else- render(Saml::Providers::Sections::NameComponent.new(provider))+ render(Saml::Providers::Sections::ShowComponent.new(+ provider,+ edit_state: :name,+ heading: t("saml.providers.singular"),+ description: t("saml.providers.section_texts.display_name")+ ))endend@@ -20,7 +25,14 @@if edit_state == :metadatarender(Saml::Providers::Sections::MetadataFormComponent.new(provider))else- render(Saml::Providers::Sections::MetadataComponent.new(provider))+ render(Saml::Providers::Sections::ShowComponent.new(+ provider,+ edit_state: :metadata,+ heading: t("saml.providers.label_metadata"),+ description: t("saml.providers.section_texts.metadata"),+ label: provider.has_metadata? ? t(:label_completed) : t(:label_not_configured),+ label_scheme: provider.has_metadata? ? :success : :secondary+ ))endend@@ -32,7 +44,13 @@if edit_state == :configurationrender(Saml::Providers::Sections::ConfigurationFormComponent.new(provider))else- render(Saml::Providers::Sections::ConfigurationComponent.new(provider))+ render(Saml::Providers::Sections::ShowComponent.new(+ provider,+ edit_state: :configuration,+ heading: t("saml.providers.label_configuration_details"),+ description: t("saml.providers.section_texts.configuration"),+ label: (provider.persisted? && !provider.configured?) ? t(:label_incomplete) : nil,+ ))endend@@ -40,7 +58,12 @@if edit_state == :encryptionrender(Saml::Providers::Sections::EncryptionFormComponent.new(provider))else- render(Saml::Providers::Sections::EncryptionComponent.new(provider))+ render(Saml::Providers::Sections::ShowComponent.new(+ provider,+ edit_state: :configuration,+ heading: t("saml.providers.label_configuration_encryption"),+ description: t("saml.providers.section_texts.encryption")+ ))endend@@ -52,14 +75,24 @@if edit_state == :mappingrender(Saml::Providers::Sections::MappingFormComponent.new(provider))else- render(Saml::Providers::Sections::MappingComponent.new(provider))+ render(Saml::Providers::Sections::ShowComponent.new(+ provider,+ edit_state: :configuration,+ heading: t("saml.providers.label_mapping"),+ description: t("saml.providers.section_texts.mapping")+ ))endendcomponent.with_row(scheme: :default) doif edit_state == :requested_attributesrender(Saml::Providers::Sections::RequestAttributesFormComponent.new(provider))else- render(Saml::Providers::Sections::RequestAttributesComponent.new(provider))+ render(Saml::Providers::Sections::ShowComponent.new(+ provider,+ edit_state: :configuration,+ heading: t("saml.providers.requested_attributes"),+ description: t("saml.providers.section_texts.requested_attributes")+ ))endendenddiff --git a/modules/auth_saml/app/forms/saml/providers/encryption_form.rb b/modules/auth_saml/app/forms/saml/providers/encryption_form.rbindex c9efb9d9d4c..52d3507ccd5 100644--- a/modules/auth_saml/app/forms/saml/providers/encryption_form.rb+++ b/modules/auth_saml/app/forms/saml/providers/encryption_form.rb@@ -36,6 +36,18 @@ module Samlcaption: I18n.t("saml.instructions.authn_requests_signed"),required: true)+ f.check_box(+ name: :want_assertions_signed,+ label: I18n.t("activemodel.attributes.saml/provider.want_assertions_signed"),+ caption: I18n.t("saml.instructions.want_assertions_signed"),+ required: true+ )+ f.check_box(+ name: :want_assertions_encrypted,+ label: I18n.t("activemodel.attributes.saml/provider.want_assertions_encrypted"),+ caption: I18n.t("saml.instructions.want_assertions_encrypted"),+ required: true+ )f.text_area(name: :sp_certificate,rows: 10,@@ -45,27 +57,10 @@ module Samlinput_width: :large)f.text_area(- name: :sp_certificate,+ name: :sp_private_key,rows: 10,- label: I18n.t("activemodel.attributes.saml/provider.sp_certificate"),- caption: I18n.t("saml.instructions.idp_cert"),- required: false,- input_width: :large- )- f.select_list(- name: "name_identifier_format",- label: I18n.t("activemodel.attributes.saml/provider.name_identifier_format"),- input_width: :large,- caption: I18n.t("saml.instructions.name_identifier_format")- ) do |list|- Saml::Defaults::NAME_IDENTIFIER_FORMATS.each do |format|- list.option(label: format, value: format)- end- end- f.check_box(- name: :limit_self_registration,- label: I18n.t("activemodel.attributes.saml/provider.limit_self_registration"),- caption: I18n.t("saml.instructions.limit_self_registration"),+ label: I18n.t("activemodel.attributes.saml/provider.sp_private_key"),+ caption: I18n.t("saml.instructions.sp_private_key"),required: false,input_width: :large)diff --git a/modules/auth_saml/config/locales/en.yml b/modules/auth_saml/config/locales/en.ymlindex b8c4489de49..c94f7741fb0 100644--- a/modules/auth_saml/config/locales/en.yml+++ b/modules/auth_saml/config/locales/en.yml@@ -14,6 +14,10 @@ en:idp_slo_service_url: Identity provider logout endpointidp_cert: Public certificate of identity providerauthn_requests_signed: Sign SAML AuthnRequests+ want_assertions_signed: Require signed responses+ want_assertions_encrypted: Require encrypted responses+ sp_certificate: Certificate used by OpenProject for SAML requests+ sp_private_key: Corresponding private key for OpenProject SAML requestsformat: "Format"saml:menu_title: SAML providers@@ -117,4 +121,9 @@ en:The format of the requested attribute. This is used to specify the format of the attribute in the SAML request.Please see [documentation on configuring requested attributes](docs_url) for more information.authn_requests_signed: >- If enabled, OpenProject will sign the SAML AuthnRequest. You will have to provide a signing certificate and private key using the fields below.+ If checked, OpenProject will sign the SAML AuthnRequest. You will have to provide a signing certificate and private key using the fields below.+ want_assertions_signed: >+ If checked, OpenProject will required signed responses from the identity provider using it's own certificate keypair.+ OpenProject will verify the signature against the certificate from the basic configuration section.+ want_assertions_encrypted: >+ If enabled, require the identity provider to encrypt the assertion response using the certificate pair that you provide.