mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-03 02:21:33 +00:00
DRY Flipper UI config
This commit is contained in:
@@ -2,13 +2,6 @@ require "flipper"
|
||||
require "flipper/adapters/active_record"
|
||||
require "open_food_network/feature_toggle"
|
||||
|
||||
if Rails.env.production?
|
||||
Flipper::UI.configure do |config|
|
||||
config.banner_text = '⚠️ Production environment: be aware that the changes have an impact on the application. Please, read the how-to before: https://github.com/openfoodfoundation/openfoodnetwork/wiki/Feature-toggle-with-Flipper'
|
||||
config.banner_class = 'danger'
|
||||
end
|
||||
end
|
||||
|
||||
Flipper.register(:admins) { |actor| actor.respond_to?(:admin?) && actor.admin? }
|
||||
|
||||
Flipper::UI.configure do |config|
|
||||
@@ -20,6 +13,15 @@ Flipper::UI.configure do |config|
|
||||
# Defaults to false. Set to true to show feature descriptions on the list
|
||||
# page as well as the view page.
|
||||
# config.show_feature_description_in_list = true
|
||||
|
||||
if Rails.env.production?
|
||||
config.banner_text = <<~TEXT
|
||||
⚠️ Production environment: be aware that the changes have an impact on the
|
||||
application. Please read the how-to before:
|
||||
https://github.com/openfoodfoundation/openfoodnetwork/wiki/Feature-toggle-with-Flipper
|
||||
TEXT
|
||||
config.banner_class = 'danger'
|
||||
end
|
||||
end
|
||||
|
||||
# Add known feature toggles. This may fail if the database isn't setup yet.
|
||||
|
||||
Reference in New Issue
Block a user