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
available state
Oliver Günther0fdc9ab3d85d
diff --git a/modules/auth_saml/app/components/saml/providers/row_component.rb b/modules/auth_saml/app/components/saml/providers/row_component.rbindex debdc4ec768..50005ef9858 100644--- a/modules/auth_saml/app/components/saml/providers/row_component.rb+++ b/modules/auth_saml/app/components/saml/providers/row_component.rb@@ -19,7 +19,7 @@ module Samlhref: url_for(action: :show, id: provider.id))) { provider.display_name || provider.name }- unless provider.configured?+ unless provider.available?concat render(Primer::Beta::Label.new(ml: 2, scheme: :attention, size: :medium)) { t(:label_incomplete) }enddiff --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 dfd0cff379f..69078ba90f0 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@@ -104,7 +104,9 @@target_state: :mapping,view_mode:,heading: t("saml.providers.label_mapping"),- description: t("saml.providers.section_texts.mapping")+ description: t("saml.providers.section_texts.mapping"),+ label: provider.mapping_configured? ? t(:label_completed) : t(:label_incomplete),+ label_scheme: provider.mapping_configured? ? :success : :attention))endenddiff --git a/modules/auth_saml/app/controllers/saml/providers_controller.rb b/modules/auth_saml/app/controllers/saml/providers_controller.rbindex 66d2388ae7e..69b0000c466 100644--- a/modules/auth_saml/app/controllers/saml/providers_controller.rb+++ b/modules/auth_saml/app/controllers/saml/providers_controller.rb@@ -8,7 +8,7 @@ module Samlbefore_action :find_provider, only: %i[show edit import_metadata update destroy]def index- @providers = Saml::Provider.all+ @providers = Saml::Provider.all.order(display_name: "ASC")enddef edit@@ -38,6 +38,7 @@ module Samlflash[:notice] = I18n.t(:notice_successful_create)redirect_to edit_saml_provider_path(call.result, edit_state: :metadata)else+ flash[:error] = call.message@provider = call.resultrender action: :newenddiff --git a/modules/auth_saml/app/models/saml/provider.rb b/modules/auth_saml/app/models/saml/provider.rbindex 8b65ce198b2..b908f89dbb0 100644--- a/modules/auth_saml/app/models/saml/provider.rb+++ b/modules/auth_saml/app/models/saml/provider.rb@@ -57,7 +57,16 @@ module Samlenddef configured?- sp_entity_id.present? && idp_sso_service_url.present? && certificate_configured?+ sp_entity_id.present? &&+ idp_sso_service_url.present? &&+ certificate_configured?+ end++ def mapping_configured?+ mapping_login.present? &&+ mapping_mail.present? &&+ mapping_firstname.present? &&+ mapping_lastname.present?enddef loaded_certificatediff --git a/modules/auth_saml/app/services/saml/providers/set_attributes_service.rb b/modules/auth_saml/app/services/saml/providers/set_attributes_service.rbindex 9218a761676..0386a8b5b05 100644--- a/modules/auth_saml/app/services/saml/providers/set_attributes_service.rb+++ b/modules/auth_saml/app/services/saml/providers/set_attributes_service.rb@@ -36,6 +36,14 @@ module Samlupdate_options(params.delete(:options)) if params.key?(:options)super++ update_available_state+ end++ def update_available_state+ model.change_by_system do+ model.available = model.configured? && model.mapping_configured?+ endenddef update_options(options)