From 2edde40f65c1f6120062b0acd920c276ce1bc8dc Mon Sep 17 00:00:00 2001 From: Daniel Illi Date: Mon, 4 Dec 2023 14:12:31 +0100 Subject: [PATCH] Also check people_managers feature gate --- .../participation_contact_data/managed_controller.rb | 3 ++- app/controllers/youth/event/register_controller.rb | 9 +++++---- app/views/event/register/register.html.haml | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/controllers/event/participation_contact_data/managed_controller.rb b/app/controllers/event/participation_contact_data/managed_controller.rb index 4ba01d83..835fee10 100644 --- a/app/controllers/event/participation_contact_data/managed_controller.rb +++ b/app/controllers/event/participation_contact_data/managed_controller.rb @@ -48,6 +48,7 @@ def privacy_policy_param end def assert_feature_enabled - FeatureGate.assert!('people.people_managers.self_service_managed_creation') + FeatureGate.assert!('people.people_managers') && + FeatureGate.assert!('people.people_managers.self_service_managed_creation') end end diff --git a/app/controllers/youth/event/register_controller.rb b/app/controllers/youth/event/register_controller.rb index 3d054c84..d20d17cb 100644 --- a/app/controllers/youth/event/register_controller.rb +++ b/app/controllers/youth/event/register_controller.rb @@ -10,7 +10,7 @@ module Youth::Event::RegisterController extend ActiveSupport::Concern included do - helper_method :manager + helper_method :manager, :self_service_managed_enabled? alias_method_chain :registered_notice, :manager alias_method_chain :contact_data_class, :manager @@ -21,7 +21,7 @@ def registered_notice_with_manager end def manager - @manager ||= true?(params[:manager]) + @manager ||= true?(params[:manager]) && self_service_managed_enabled? end def contact_data_class_with_manager @@ -32,7 +32,8 @@ def contact_data_class_with_manager end end - def feature_enabled? - FeatureGate.enabled?('people.people_managers.self_service_managed_creation') + def self_service_managed_enabled? + FeatureGate.enabled?('people.people_managers') && + FeatureGate.enabled?('people.people_managers.self_service_managed_creation') end end diff --git a/app/views/event/register/register.html.haml b/app/views/event/register/register.html.haml index 9ec0bb06..cf698ce6 100644 --- a/app/views/event/register/register.html.haml +++ b/app/views/event/register/register.html.haml @@ -7,7 +7,7 @@ - title t(".title.#{manager ? 'manager' : 'participant'}") -- unless FeatureGate.enabled?('people.people_managers') +- unless self_service_managed_enabled? = render 'event/participations/step_wizard', step: 1 - return_url = FeatureGate.enabled?('people.people_managers') ? group_event_path(group, event) : new_group_event_participation_path(group, event) @@ -21,7 +21,7 @@ = hidden_field_tag(:manager, manager) = hidden_field_tag(:return_url, return_url) - - if FeatureGate.enabled?('people.people_managers') && manager + - if manager = render 'manager_fields', f: f - else = render 'event/participation_contact_datas/form', f: f