Simplify theme and color scheme seeding (#10872)

Now that we have support for user-selectable color schemes, it makes sense
to simplify seeding and theme updates in the wizard. 

We now:

- seed only one theme, named "Default" (previously "Light")
- seed a user-selectable Dark color scheme
- rename the "Themes" wizard step to "Colors"
- update the default theme's color scheme if a default is set
(a new theme is created if there is no default)
This commit is contained in:
Penar Musaraj
2020-10-14 10:18:02 -04:00
committed by GitHub
parent d77e31b7e9
commit 74de7a49f5
8 changed files with 35 additions and 40 deletions

View File

@@ -30,12 +30,9 @@ describe SiteSerializer do
end
it "includes user-selectable color schemes" do
scheme = ColorScheme.create_from_base(name: "Neutral", base_scheme_id: "Neutral")
scheme.user_selectable = true
scheme.save!
# it includes seeded color schemes
serialized = described_class.new(Site.new(guardian), scope: guardian, root: false).as_json
expect(serialized[:user_color_schemes].count).to eq (1)
expect(serialized[:user_color_schemes].count).to eq(1)
dark_scheme = ColorScheme.create_from_base(name: "ADarkScheme", base_scheme_id: "Dark")
dark_scheme.user_selectable = true