Inventory is disabled by default

It will be enabled on release for existing Enterprises, we can use the
added group "enterprise_created_before_2025_07_04" to do so.
This commit is contained in:
Gaetan Craig-Riou
2025-07-04 14:31:26 +10:00
parent 681eee9309
commit b28e30cb6c
3 changed files with 6 additions and 6 deletions

View File

@@ -25,6 +25,12 @@ end
Flipper.register(:new_2024_07_03) do |actor|
actor.respond_to?(:created_at?) && actor.created_at >= "2024-07-03".to_time
end
Flipper.register(:enterprise_created_before_2025_07_04) do |actor|
# This group applies to enterprises only, so we return false if the actor is not an Enterprise
next false unless actor.actor.instance_of? Enterprise
actor.respond_to?(:created_at?) && actor.created_at < "2025-07-04".to_time
end
Flipper::UI.configure do |config|
config.descriptions_source = ->(_keys) do

View File

@@ -76,9 +76,6 @@ module OpenFoodNetwork
"admin_style_v3" => <<~DESC,
Test the work-in-progress design updates.
DESC
"inventory" => <<~DESC,
Enable the inventory.
DESC
}.freeze
def self.setup!

View File

@@ -158,9 +158,6 @@ RSpec.configure do |config|
config.before(:each) do
Flipper.features.each(&:remove)
OpenFoodNetwork::FeatureToggle.setup!
# Inventory is currently enabled by default, but we enventually when to disable it by default.
# Disabling it here allows us to test inventory specific code path
Flipper.disable(:inventory)
end
config.before(:each, :feature) do |example|