Skip to content

A platform for community discussion. Free, open, simple.

FEATURE: enable new admin sidebar by default (#26391)

Krzysztof Kotlarek3ce386c22f9d
diff --git a/config/site_settings.yml b/config/site_settings.yml
index f17c60852ac..519879096d6 100644
--- a/config/site_settings.yml
+++ b/config/site_settings.yml
@@ -2361,7 +2361,7 @@ developer:
admin_sidebar_enabled_groups:
type: group_list
list_type: compact
- default: ""
+ default: "1"
allow_any: false
refresh: true
lazy_load_categories_groups:
diff --git a/db/migrate/20240327043323_disable_admin_sidebar_for_existing_sites.rb b/db/migrate/20240327043323_disable_admin_sidebar_for_existing_sites.rb
new file mode 100644
index 00000000000..c64cfc6dd67
--- /dev/null
+++ b/db/migrate/20240327043323_disable_admin_sidebar_for_existing_sites.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class DisableAdminSidebarForExistingSites < ActiveRecord::Migration[7.0]
+ def up
+ # keep old admin menu for existing sites
+ execute <<~SQL if Migration::Helpers.existing_site?
+ INSERT INTO site_settings(name, data_type, value, created_at, updated_at)
+ VALUES('admin_sidebar_enabled_groups', 20, '-1', NOW(), NOW())
+ ON CONFLICT (name) DO NOTHING
+ SQL
+ end
+
+ def down
+ raise ActiveRecord::IrreversibleMigration
+ end
+end