Skip to content

Commit

Permalink
Also check people_managers feature gate
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-illi committed Dec 4, 2023
1 parent 681f49b commit 2edde40
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 5 additions & 4 deletions app/controllers/youth/event/register_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
4 changes: 2 additions & 2 deletions app/views/event/register/register.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 2edde40

Please sign in to comment.