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

@@ -204,6 +204,13 @@ describe Wizard::StepUpdater do
wizard.create_updater('colors', {}).update
end.to_not change { SiteSetting.default_theme_id }
end
it "should update the color scheme of the default theme" do
updater = wizard.create_updater('colors', theme_previews: 'Neutral')
expect { updater.update }.not_to change { Theme.count }
theme.reload
expect(theme.color_scheme.base_scheme_id).to eq('Neutral')
end
end
context "without an existing theme" do
@@ -257,8 +264,6 @@ describe Wizard::StepUpdater do
theme = Theme.find_by(id: SiteSetting.default_theme_id)
expect(theme.color_scheme_id).to eq(color_scheme.id)
expect(Theme.where(user_selectable: true).count).to eq(2)
end
end
end