2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-10-03 17:21:20 +08:00

FEATURE: Enable system Horizon (#33374)

Enable Horizon theme for everyone.
This commit is contained in:
Krzysztof Kotlarek 2025-06-30 07:23:02 +08:00 committed by GitHub
parent 5ddc23b030
commit 912c4f855a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 13 additions and 1 deletions

View file

@ -4045,7 +4045,7 @@ experimental:
default: false
experimental_system_themes:
type: list
default: ""
default: "horizon"
hidden: true
allow_any: false
choices:

View file

@ -0,0 +1,10 @@
# frozen_string_literal: true
class EnableHorizonForExistingSites < ActiveRecord::Migration[7.2]
def change
execute <<~SQL if Migration::Helpers.existing_site?
INSERT INTO site_settings(name, data_type, value, created_at, updated_at)
VALUES('experimental_system_themes', 8, 'horizon', NOW(), NOW())
ON CONFLICT (name) DO NOTHING
SQL
end
end

View file

@ -33,6 +33,7 @@ RSpec.describe Admin::ColorSchemesController do
end

it "filters colors belonging to experimental system themes" do
SiteSetting.experimental_system_themes = ""
get "/admin/color_schemes.json"
expect(response.status).to eq(200)
scheme_names = response.parsed_body.map { |scheme| scheme["name"] }

View file

@ -478,6 +478,7 @@ RSpec.describe Admin::ThemesController do
end

it "filters experimental system themes" do
SiteSetting.experimental_system_themes = ""
get "/admin/themes.json"
expect(response.status).to eq(200)
theme_names = response.parsed_body["themes"].map { |theme| theme[:name] }