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
Rename edit_mode to new_mode for SAML as well
Jan Sandbrinkb44bf0dd9661
diff --git a/modules/auth_saml/app/components/saml/providers/sections/form_component.html.erb b/modules/auth_saml/app/components/saml/providers/sections/form_component.html.erbindex 6fc154552fc..325bb35243c 100644--- a/modules/auth_saml/app/components/saml/providers/sections/form_component.html.erb+++ b/modules/auth_saml/app/components/saml/providers/sections/form_component.html.erb@@ -33,7 +33,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/auth_saml/app/components/saml/providers/sections/form_component.rb b/modules/auth_saml/app/components/saml/providers/sections/form_component.rbindex e41841eb531..df3b92dbaa8 100644--- a/modules/auth_saml/app/components/saml/providers/sections/form_component.rb+++ b/modules/auth_saml/app/components/saml/providers/sections/form_component.rb@@ -30,16 +30,16 @@#module Saml::Providers::Sectionsclass FormComponent < SectionComponent- attr_reader :edit_state, :next_edit_state, :edit_mode+ attr_reader :edit_state, :next_edit_state, :new_modedef initialize(provider, edit_state:, form_class:,heading:, banner: nil, banner_scheme: :default,- next_edit_state: nil, edit_mode: nil)+ next_edit_state: nil, new_mode: nil)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@@ -48,9 +48,9 @@ module Saml::Providers::Sectionsdef urlif provider.new_record?- saml_providers_path(edit_state:, edit_mode:, next_edit_state:)+ saml_providers_path(edit_state:, new_mode:, next_edit_state:)else- saml_provider_path(provider, edit_state:, edit_mode:, next_edit_state:)+ saml_provider_path(provider, edit_state:, new_mode:, next_edit_state:)endend@@ -63,7 +63,7 @@ module Saml::Providers::Sectionsenddef button_label- if edit_mode+ if new_modeI18n.t(:button_continue)elseI18n.t(:button_update)diff --git a/modules/auth_saml/app/components/saml/providers/sections/metadata_form_component.html.erb b/modules/auth_saml/app/components/saml/providers/sections/metadata_form_component.html.erbindex 3f15083be5e..e678f1d09ea 100644--- a/modules/auth_saml/app/components/saml/providers/sections/metadata_form_component.html.erb+++ b/modules/auth_saml/app/components/saml/providers/sections/metadata_form_component.html.erb@@ -2,14 +2,14 @@primer_form_with(model: provider,id: "saml-providers-edit-form",- url: import_metadata_saml_provider_path(provider, edit_mode:),+ url: import_metadata_saml_provider_path(provider, new_mode:),data: {controller: "show-when-value-selected"},method: :post) do |form|flex_layout do |flex|- if edit_mode+ if new_modeflex.with_row dorender(Primer::Beta::Text.new(tag: :p, mb: 4, font_size: :small)) dot("saml.providers.section_texts.metadata_form")@@ -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/auth_saml/app/components/saml/providers/sections/metadata_form_component.rb b/modules/auth_saml/app/components/saml/providers/sections/metadata_form_component.rbindex 0572a5ea3be..9ad9793296b 100644--- a/modules/auth_saml/app/components/saml/providers/sections/metadata_form_component.rb+++ b/modules/auth_saml/app/components/saml/providers/sections/metadata_form_component.rb@@ -30,8 +30,8 @@#module Saml::Providers::Sectionsclass MetadataFormComponent < FormComponent- def initialize(provider, edit_mode: nil)- super(provider, edit_state: :metadata, edit_mode:, form_class: nil, heading: nil)+ def initialize(provider, new_mode: nil)+ super(provider, edit_state: :metadata, new_mode:, form_class: nil, heading: nil)endendenddiff --git a/modules/auth_saml/app/components/saml/providers/sections/request_attributes_form_component.rb b/modules/auth_saml/app/components/saml/providers/sections/request_attributes_form_component.rbindex 7e18f5ca67b..cdb7ccd69e5 100644--- a/modules/auth_saml/app/components/saml/providers/sections/request_attributes_form_component.rb+++ b/modules/auth_saml/app/components/saml/providers/sections/request_attributes_form_component.rb@@ -30,16 +30,16 @@#module Saml::Providers::Sectionsclass RequestAttributesFormComponent < FormComponent- def initialize(provider, edit_mode: nil)+ def initialize(provider, new_mode: nil)super(provider,edit_state: :requested_attributes,- edit_mode:,+ new_mode:,form_class: Saml::Providers::RequestAttributesForm,heading: I18n.t("saml.instructions.requested_attributes"))enddef button_label- if edit_mode+ if new_modeI18n.t(:button_finish_setup)elseI18n.t(:button_save)diff --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 41e85061c95..cc9a1bcf251 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@@ -20,7 +20,7 @@form_class: Saml::Providers::NameInputForm,edit_state:,next_edit_state: :metadata,- edit_mode:,+ new_mode:,heading: nil))@@ -46,7 +46,7 @@render(Saml::Providers::Sections::MetadataFormComponent.new(provider,- edit_mode:+ new_mode:))else@@ -76,7 +76,7 @@form_class: Saml::Providers::ConfigurationForm,edit_state:,next_edit_state: :encryption,- edit_mode:,+ new_mode:,banner: provider.last_metadata_update ? t("saml.providers.section_texts.configuration_metadata") : nil,banner_scheme: :default,heading: nil@@ -104,7 +104,7 @@form_class: Saml::Providers::EncryptionForm,edit_state:,next_edit_state: :mapping,- edit_mode:,+ new_mode:,heading: t("saml.providers.section_texts.encryption_form")))@@ -133,7 +133,7 @@form_class: Saml::Providers::MappingForm,edit_state:,next_edit_state: :requested_attributes,- edit_mode:,+ new_mode:,heading: t("saml.instructions.mapping")))@@ -156,7 +156,7 @@render(Saml::Providers::Sections::RequestAttributesFormComponent.new(provider,- edit_mode:+ new_mode:))elsediff --git a/modules/auth_saml/app/components/saml/providers/view_component.rb b/modules/auth_saml/app/components/saml/providers/view_component.rbindex d01b1d0b6cd..fd9402cb7a8 100644--- a/modules/auth_saml/app/components/saml/providers/view_component.rb+++ b/modules/auth_saml/app/components/saml/providers/view_component.rb@@ -33,7 +33,7 @@ module Saml::Providersinclude OpTurbo::Streamableinclude OpPrimer::ComponentHelpers- options :view_mode, :edit_state, :edit_mode+ options :view_mode, :edit_state, :new_modealias_method :provider, :modelenddiff --git a/modules/auth_saml/app/controllers/saml/providers_controller.rb b/modules/auth_saml/app/controllers/saml/providers_controller.rbindex 601d6467016..de4ce849f67 100644--- a/modules/auth_saml/app/controllers/saml/providers_controller.rb+++ b/modules/auth_saml/app/controllers/saml/providers_controller.rb@@ -22,7 +22,7 @@ module Samlformat.turbo_stream docomponent = Saml::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("saml-providers-edit-form", behavior: :instant)@@ -53,10 +53,10 @@ module Saml@provider = call.resultif call.success?- if @edit_mode || @provider.last_metadata_update.present?+ if @new_mode || @provider.last_metadata_update.present?redirect_to edit_saml_provider_path(@provider,anchor: "saml-providers-edit-form",- edit_mode: @edit_mode,+ new_mode: @new_mode,edit_state: :configuration)elseredirect_to saml_provider_path(@provider)@@ -90,7 +90,7 @@ module Saml.call(update_params)if call.success?- flash[:notice] = I18n.t(:notice_successful_update) unless @edit_mode+ flash[:notice] = I18n.t(:notice_successful_update) unless @new_modesuccessful_save_responseelse@provider = call.result@@ -122,7 +122,7 @@ module Samlupdate_via_turbo_stream(component: Saml::Providers::ViewComponent.new(@provider,- edit_mode: @edit_mode,+ new_mode: @new_mode,edit_state: @next_edit_state,view_mode: :show)@@ -130,10 +130,10 @@ module Samlrender turbo_stream: turbo_streamsendformat.html do- if @edit_mode && @next_edit_state+ if @new_mode && @next_edit_stateredirect_to edit_saml_provider_path(@provider,anchor: "saml-providers-edit-form",- edit_mode: true,+ new_mode: @new_mode,edit_state: @next_edit_state)elseredirect_to saml_provider_path(@provider)@@ -187,7 +187,7 @@ module Samldef 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)endenddiff --git a/modules/auth_saml/app/views/saml/providers/edit.html.erb b/modules/auth_saml/app/views/saml/providers/edit.html.erbindex c00e87fdeb6..07c32522ba0 100644--- a/modules/auth_saml/app/views/saml/providers/edit.html.erb+++ b/modules/auth_saml/app/views/saml/providers/edit.html.erb@@ -26,7 +26,7 @@Saml::Providers::ViewComponent.new(@provider,view_mode: :edit,- edit_mode: @edit_mode,+ new_mode: @new_mode,edit_state: @edit_state)) %>diff --git a/modules/auth_saml/app/views/saml/providers/new.html.erb b/modules/auth_saml/app/views/saml/providers/new.html.erbindex 1b0186468a3..58b9fb42d02 100644--- a/modules/auth_saml/app/views/saml/providers/new.html.erb+++ b/modules/auth_saml/app/views/saml/providers/new.html.erb@@ -20,4 +20,4 @@<% end %><% end %>-<%= render(Saml::Providers::ViewComponent.new(@provider, edit_mode: true, edit_state: :name)) %>+<%= render(Saml::Providers::ViewComponent.new(@provider, new_mode: true, edit_state: :name)) %>diff --git a/modules/auth_saml/config/locales/en.yml b/modules/auth_saml/config/locales/en.ymlindex ce8b8eac5ca..a9d7ea30559 100644--- a/modules/auth_saml/config/locales/en.yml+++ b/modules/auth_saml/config/locales/en.yml@@ -54,15 +54,16 @@ en:label_edit: Edit SAML identity provider %{name}label_uid: Internal user idlabel_mapping: Mapping-label_requested_attribute_for: "Requested attribute for: %{attribute}"+no_results_table: No SAML identity providers have been defined yet.+ notice_created: A new SAML identity provider was successfully created.plural: SAML identity providerssingular: SAML identity providerrequested_attributes: Requested attributesattribute_mapping: Attribute mappingattribute_mapping_text: >- The following fields control which attributes provided by the SAML identity provider+ The following fields control which attributes provided by the SAML identity providerare used to provide user attributes in OpenProjectmetadata:dialog: "This is the URL where the OpenProject SAML metadata is available. Optionally use it to configure your identity provider:"@@ -71,7 +72,7 @@ en:description: Connect OpenProject to a SAML identity providerrequest_attributes:title: 'Requested attributes'- legend: >+ legend: >These attributes are added to the SAML XML metadata to signify to the identify provider which attributes OpenProject requires.You may still need to explicitly configure your identity provider to send these attributes. Please refer to your IdP's documentation.name: 'Requested attribute key'