mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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!
|
||||
|
||||
@@ -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|
|
||||
|
||||
Reference in New Issue
Block a user