mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Merge pull request #7437 from jibees/7422-add-flipper-banner
Add banner to Flipper UI to warn the admin users
This commit is contained in:
@@ -9,6 +9,14 @@ Flipper.configure do |config|
|
||||
Flipper.new(instrumented, instrumenter: ActiveSupport::Notifications)
|
||||
end
|
||||
end
|
||||
|
||||
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
|
||||
|
||||
Rails.configuration.middleware.use Flipper::Middleware::Memoizer, preload_all: true
|
||||
|
||||
Flipper.register(:admins) { |actor| actor.respond_to?(:admin?) && actor.admin? }
|
||||
|
||||
Reference in New Issue
Block a user