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 e19ab6b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 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
7 changes: 4 additions & 3 deletions app/controllers/youth/event/register_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 people_managers_and_self_service_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 e19ab6b

Please sign in to comment.