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

Same button layout as saml

Oliver Günther19eab3bfd5ad
diff --git a/modules/openid_connect/app/components/openid_connect/providers/sections/form_component.rb b/modules/openid_connect/app/components/openid_connect/providers/sections/form_component.rb
index e1da600bae5..28ac2a6880a 100644
--- a/modules/openid_connect/app/components/openid_connect/providers/sections/form_component.rb
+++ b/modules/openid_connect/app/components/openid_connect/providers/sections/form_component.rb
@@ -68,10 +68,12 @@ module OpenIDConnect::Providers::Sections
end
def button_label
- if edit_mode
- I18n.t(:button_continue)
+ return I18n.t(:button_save) unless edit_mode
+
+ if next_edit_state.nil?
+ I18n.t(:button_finish_setup)
else
- I18n.t(:button_update)
+ I18n.t(:button_continue)
end
end
end
diff --git a/modules/openid_connect/app/components/openid_connect/providers/sections/metadata_form_component.rb b/modules/openid_connect/app/components/openid_connect/providers/sections/metadata_form_component.rb
index 74e4ed983db..b8ea2f88a11 100644
--- a/modules/openid_connect/app/components/openid_connect/providers/sections/metadata_form_component.rb
+++ b/modules/openid_connect/app/components/openid_connect/providers/sections/metadata_form_component.rb
@@ -30,8 +30,5 @@
#
module OpenIDConnect::Providers::Sections
class MetadataFormComponent < FormComponent
- def initialize(provider, edit_mode: nil)
- super(provider, edit_state: :metadata, edit_mode:, form_class: nil, heading: nil)
- end
end
end
diff --git a/modules/openid_connect/app/components/openid_connect/providers/view_component.html.erb b/modules/openid_connect/app/components/openid_connect/providers/view_component.html.erb
index 2db8e067f9f..e6edcae4289 100644
--- a/modules/openid_connect/app/components/openid_connect/providers/view_component.html.erb
+++ b/modules/openid_connect/app/components/openid_connect/providers/view_component.html.erb
@@ -134,7 +134,11 @@
if edit_state == :metadata
render(ns::Sections::MetadataFormComponent.new(
provider,
+ form_class: nil,
+ heading: nil,
+ edit_state:,
edit_mode:,
+ next_edit_state: :metadata_details
))
else
render(ns::Sections::ShowComponent.new(
@@ -159,7 +163,7 @@
provider,
form_class: ns::MetadataDetailsForm,
edit_state:,
- next_edit_state: :attribute_mapping,
+ next_edit_state: :client_details,
edit_mode:,
banner: provider.metadata_configured? ? t("openid_connect.providers.section_texts.configuration_metadata") : nil,
banner_scheme: :default,
@@ -179,47 +183,46 @@
end
component.with_row(scheme: :default) do
- if edit_state == :attribute_mapping
+ if edit_state == :client_details
render(ns::Sections::FormComponent.new(
provider,
- form_class: ns::AttributeMappingForm,
+ form_class: ns::ClientDetailsForm,
edit_state:,
- next_edit_state: :client_details,
+ next_edit_state: :attribute_mapping,
edit_mode:,
heading: nil
))
else
render(ns::Sections::ShowComponent.new(
provider,
- target_state: :attribute_mapping,
+ target_state: :client_details,
view_mode:,
- heading: t("openid_connect.providers.label_attribute_mapping"),
- description: t("openid_connect.providers.section_texts.attribute_mapping"),
- label: provider.metadata_configured? ? t(:label_completed) : nil,
- label_scheme: provider.metadata_configured? ? :success : :secondary
+ heading: t("openid_connect.providers.label_client_details"),
+ description: t("openid_connect.providers.client_details_description"),
+ label: provider.advanced_details_configured? ? t(:label_completed) : t(:label_not_configured),
+ label_scheme: provider.advanced_details_configured? ? :success : :secondary
))
end
end
component.with_row(scheme: :default) do
- if edit_state == :client_details
+ if edit_state == :attribute_mapping
render(ns::Sections::FormComponent.new(
provider,
- form_class: ns::ClientDetailsForm,
+ form_class: ns::AttributeMappingForm,
edit_state:,
- next_edit_state: :mapping,
edit_mode:,
heading: nil
))
else
render(ns::Sections::ShowComponent.new(
provider,
- target_state: :client_details,
+ target_state: :attribute_mapping,
view_mode:,
- heading: t("openid_connect.providers.label_client_details"),
- description: t("openid_connect.providers.client_details_description"),
- label: provider.advanced_details_configured? ? t(:label_completed) : t(:label_not_configured),
- label_scheme: provider.advanced_details_configured? ? :success : :secondary
+ heading: t("openid_connect.providers.label_attribute_mapping"),
+ description: t("openid_connect.providers.section_texts.attribute_mapping"),
+ label: provider.metadata_configured? ? t(:label_completed) : nil,
+ label_scheme: provider.metadata_configured? ? :success : :secondary
))
end
end