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
Confirm provider creation to user at end of OIDC provider wizard
Jan Sandbrinkd563ea4070dd
diff --git a/modules/openid_connect/app/components/openid_connect/providers/sections/form_component.html.erb b/modules/openid_connect/app/components/openid_connect/providers/sections/form_component.html.erbindex 292727ea5de..c3ac6a7cbc2 100644--- a/modules/openid_connect/app/components/openid_connect/providers/sections/form_component.html.erb+++ b/modules/openid_connect/app/components/openid_connect/providers/sections/form_component.html.erb@@ -34,7 +34,7 @@form,provider:,submit_button_options: { label: button_label },- cancel_button_options: { hidden: edit_mode }+ cancel_button_options: { hidden: new_mode }))enddiff --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.rbindex f8afc277d75..afde385540f 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@@ -30,7 +30,7 @@module OpenIDConnect::Providers::Sectionsclass FormComponent < ::Saml::Providers::Sections::SectionComponent- attr_reader :edit_state, :next_edit_state, :edit_mode, :fetch_metadata+ attr_reader :edit_state, :next_edit_state, :new_mode, :fetch_metadatadelegate :form_data, to: :@form_class@@ -41,13 +41,13 @@ module OpenIDConnect::Providers::Sectionsbanner: nil,banner_scheme: :default,next_edit_state: nil,- edit_mode: nil,+ new_mode: nil,fetch_metadata: false)super(provider)@edit_state = edit_state@next_edit_state = next_edit_state- @edit_mode = edit_mode+ @new_mode = new_mode@form_class = form_class@heading = heading@banner = banner@@ -64,8 +64,8 @@ module OpenIDConnect::Providers::Sectionsenddef form_url_params- if edit_mode- { edit_state:, fetch_metadata:, edit_mode:, next_edit_state: }+ if new_mode+ { edit_state:, fetch_metadata:, new_mode:, next_edit_state: }else{ edit_state:, fetch_metadata: }end@@ -80,7 +80,7 @@ module OpenIDConnect::Providers::Sectionsenddef button_label- return I18n.t(:button_save) unless edit_mode+ return I18n.t(:button_save) unless new_modeif next_edit_state.nil?I18n.t(:button_finish_setup)diff --git a/modules/openid_connect/app/components/openid_connect/providers/sections/metadata_form_component.html.erb b/modules/openid_connect/app/components/openid_connect/providers/sections/metadata_form_component.html.erbindex 0ae04be9c21..b7a477e4286 100644--- a/modules/openid_connect/app/components/openid_connect/providers/sections/metadata_form_component.html.erb+++ b/modules/openid_connect/app/components/openid_connect/providers/sections/metadata_form_component.html.erb@@ -11,7 +11,7 @@method: :put) do |form|flex_layout do |flex|- unless edit_mode+ unless new_modeflex.with_row dorender(Primer::Alpha::Banner.new(mb: 2, scheme: :warning, icon: :alert)) dot("openid_connect.providers.section_texts.metadata_form_banner")@@ -49,7 +49,7 @@form,provider:,submit_button_options: { label: button_label },- cancel_button_options: { hidden: edit_mode },+ cancel_button_options: { hidden: new_mode },state: :metadata))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.erbindex 257d611510f..3b27a2bd36b 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@@ -21,7 +21,7 @@form_class: OpenIDConnect::Providers::NameInputForm,edit_state:,next_edit_state: :client_details,- edit_mode:,+ new_mode:,heading: nil,fetch_metadata: true)@@ -44,7 +44,7 @@provider,form_class: OpenIDConnect::Providers::ClientDetailsForm,edit_state:,- edit_mode:,+ new_mode:,heading: nil,fetch_metadata: true)@@ -71,7 +71,7 @@form_class: OpenIDConnect::Providers::NameInputAndTenantForm,edit_state:,next_edit_state: :client_details,- edit_mode:,+ new_mode:,heading: nil,fetch_metadata: true)@@ -94,7 +94,7 @@provider,form_class: OpenIDConnect::Providers::ClientDetailsForm,edit_state:,- edit_mode:,+ new_mode:,heading: nil,fetch_metadata: true)@@ -122,7 +122,7 @@form_class: OpenIDConnect::Providers::NameInputForm,edit_state:,next_edit_state: :metadata,- edit_mode:,+ new_mode:,heading: nil)else@@ -149,7 +149,7 @@form_class: nil,heading: nil,edit_state:,- edit_mode:,+ new_mode:,next_edit_state: :metadata_details,fetch_metadata: true)@@ -181,7 +181,7 @@form_class: OpenIDConnect::Providers::MetadataDetailsForm,edit_state:,next_edit_state: :client_details,- edit_mode:,+ new_mode:,banner: provider.metadata_url.present? ? t("openid_connect.providers.section_texts.configuration_metadata") : nil,banner_scheme: :default,heading: nil@@ -210,7 +210,7 @@form_class: OpenIDConnect::Providers::ClientDetailsForm,edit_state:,next_edit_state: :attribute_mapping,- edit_mode:,+ new_mode:,heading: nil))@@ -241,7 +241,7 @@form_class: OpenIDConnect::Providers::AttributeMappingForm,edit_state:,next_edit_state: OpenProject::FeatureDecisions.oidc_group_sync_active? ? :group_mapping : :claims,- edit_mode:,+ new_mode:,heading: nil))@@ -269,7 +269,7 @@form_class: OpenIDConnect::Providers::GroupMappingForm,edit_state:,next_edit_state: :claims,- edit_mode:,+ new_mode:,heading: nil))@@ -294,7 +294,7 @@provider,form_class: OpenIDConnect::Providers::ClaimsForm,edit_state:,- edit_mode:,+ new_mode:,heading: nil))diff --git a/modules/openid_connect/app/components/openid_connect/providers/view_component.rb b/modules/openid_connect/app/components/openid_connect/providers/view_component.rbindex c4cc698435c..1f7fd3b4b55 100644--- a/modules/openid_connect/app/components/openid_connect/providers/view_component.rb+++ b/modules/openid_connect/app/components/openid_connect/providers/view_component.rb@@ -34,7 +34,7 @@ module OpenIDConnectinclude OpTurbo::Streamableinclude OpPrimer::ComponentHelpers- options :view_mode, :edit_state, :edit_mode+ options :view_mode, :edit_state, :new_modealias_method :provider, :modelenddiff --git a/modules/openid_connect/app/controllers/openid_connect/providers_controller.rb b/modules/openid_connect/app/controllers/openid_connect/providers_controller.rbindex 82454d33362..4ffa5cef1cf 100644--- a/modules/openid_connect/app/controllers/openid_connect/providers_controller.rb+++ b/modules/openid_connect/app/controllers/openid_connect/providers_controller.rb@@ -81,7 +81,7 @@ module OpenIDConnectformat.turbo_stream docomponent = OpenIDConnect::Providers::ViewComponent.new(@provider,view_mode: :edit,- edit_mode: @edit_mode,+ new_mode: @new_mode,edit_state: @edit_state)update_via_turbo_stream(component:)scroll_into_view_via_turbo_stream("openid-connect-providers-edit-form", behavior: :instant)@@ -145,12 +145,17 @@ module OpenIDConnectenddef successful_save_response+ if @new_mode && !@next_edit_state+ flash[:notice] = I18n.t("openid_connect.providers.notice_created")+ return redirect_to openid_connect_provider_path(@provider)+ end+respond_to do |format|format.turbo_stream doupdate_via_turbo_stream(component: OpenIDConnect::Providers::ViewComponent.new(@provider,- edit_mode: @edit_mode,+ new_mode: @new_mode,edit_state: @next_edit_state,view_mode: :show)@@ -158,13 +163,13 @@ module OpenIDConnectrender turbo_stream: turbo_streamsendformat.html do- flash[:notice] = I18n.t(:notice_successful_update) unless @edit_mode- if @edit_mode && @next_edit_state+ if @next_edit_stateredirect_to edit_openid_connect_provider_path(@provider,anchor: "openid-connect-providers-edit-form",- edit_mode: true,+ new_mode: @new_mode,edit_state: @next_edit_state)else+ flash[:notice] = I18n.t(:notice_successful_update) unless @new_moderedirect_to openid_connect_provider_path(@provider)endend@@ -177,7 +182,7 @@ module OpenIDConnectupdate_via_turbo_stream(component: OpenIDConnect::Providers::ViewComponent.new(@provider,- edit_mode: @edit_mode,+ new_mode: @new_mode,edit_state: @edit_state,view_mode: :show)@@ -192,7 +197,7 @@ module OpenIDConnectdef set_edit_state@edit_state = params[:edit_state].to_sym if params.key?(:edit_state)- @edit_mode = ActiveRecord::Type::Boolean.new.cast(params[:edit_mode])+ @new_mode = ActiveRecord::Type::Boolean.new.cast(params[:new_mode])@next_edit_state = params[:next_edit_state].to_sym if params.key?(:next_edit_state)enddiff --git a/modules/openid_connect/app/views/openid_connect/providers/edit.html.erb b/modules/openid_connect/app/views/openid_connect/providers/edit.html.erbindex 52f4e74f109..2466afe64ce 100644--- a/modules/openid_connect/app/views/openid_connect/providers/edit.html.erb+++ b/modules/openid_connect/app/views/openid_connect/providers/edit.html.erb@@ -34,7 +34,7 @@OpenIDConnect::Providers::ViewComponent.new(@provider,view_mode: :edit,- edit_mode: @edit_mode,+ new_mode: @new_mode,edit_state: @edit_state))diff --git a/modules/openid_connect/app/views/openid_connect/providers/new.html.erb b/modules/openid_connect/app/views/openid_connect/providers/new.html.erbindex c00fdc39a40..7c4ae448b32 100644--- a/modules/openid_connect/app/views/openid_connect/providers/new.html.erb+++ b/modules/openid_connect/app/views/openid_connect/providers/new.html.erb@@ -12,4 +12,4 @@end%>-<%= render(OpenIDConnect::Providers::ViewComponent.new(@provider, edit_mode: true, edit_state: :name)) %>+<%= render(OpenIDConnect::Providers::ViewComponent.new(@provider, new_mode: true, edit_state: :name)) %>diff --git a/modules/openid_connect/config/locales/en.yml b/modules/openid_connect/config/locales/en.ymlindex 0c6b90c4b7d..c3f9d0338f1 100644--- a/modules/openid_connect/config/locales/en.yml+++ b/modules/openid_connect/config/locales/en.yml@@ -133,6 +133,7 @@ en:label_configuration_details: Metadatalabel_client_details: Client detailslabel_attribute_mapping: Attribute mapping+ notice_created: A new OpenID provider was successfully created.client_details_description: Configuration details of OpenProject as an OIDC clientno_results_table: No providers have been defined yet.plural: OpenID providers