UX: Add Styling step to wizard (#14132)

Refactors three wizard steps (colors, fonts, homepage style) into one new step called Styling.
This commit is contained in:
Penar Musaraj
2021-08-25 17:10:12 -04:00
committed by GitHub
parent cfbf69848a
commit 85b8fea262
28 changed files with 548 additions and 371 deletions
+9 -1
View File
@@ -2,7 +2,7 @@
class WizardFieldSerializer < ApplicationSerializer
attributes :id, :type, :required, :value, :label, :placeholder, :description, :extra_description
attributes :id, :type, :required, :value, :label, :placeholder, :description, :extra_description, :show_in_sidebar
has_many :choices, serializer: WizardFieldChoiceSerializer, embed: :objects
def id
@@ -68,4 +68,12 @@ class WizardFieldSerializer < ApplicationSerializer
extra_description.present?
end
def show_in_sidebar
object.show_in_sidebar
end
def include_show_in_sidebar?
object.show_in_sidebar.present?
end
end
+1 -6
View File
@@ -15,11 +15,6 @@ class WizardSerializer < ApplicationSerializer
def current_color_scheme
color_scheme = Theme.where(id: SiteSetting.default_theme_id).first&.color_scheme
colors = color_scheme ? color_scheme.colors : ColorScheme.base.colors
# The frontend expects the color hexs to start with '#'
colors_with_hash = {}
colors.each { |color| colors_with_hash[color.name] = color.hex_with_hash }
colors_with_hash
color_scheme ? color_scheme.colors_hashes : ColorScheme.base.colors_hashes
end
end