discourse/spec/fabricators/site_setting_group_fabricator.rb
Martin Brennan 2fdc9af28e
FEATURE: Add upcoming change CSS classes to <body> (#36586)
This commit introduces automatic CSS classes added to
the <body> based on the upcoming changes the current visitor
(logged in or anon user) is affected by. This allows
designers and theme developers to easily style the UI
based on upcoming changes.

For example a change called `enable_chat_channel_starring`
would be `uc-enable-chat-channel-starring` on the body.

This commit also refactors the way we send upcoming change
data to the UI for the current user, because it also needs
to work for anon users. Only upcoming changes enabled for
Everyone will be added to the <body> for anon users. Logged
in in users will get classes for all upcoming changes
they are affected by based on their groups or changes enabled
for Everyone.
2025-12-11 11:09:09 +10:00

8 lines
195 B
Ruby

# frozen_string_literal: true
Fabricator(:site_setting_group) do
after_create do |site_setting_group|
SiteSetting.refresh_site_setting_group_ids!
SiteSetting.notify_changed!
end
end