UX: Rearrange wizard steps

Reorder steps:
* “Your site is ready” from 3 → 4
* “Logos” from 4 → 5
* “Look and feel” from 5 → 3

So the new order goes “Look and feel”, “Your site is ready”, “Logos”, “Boring legal stuff”
This commit is contained in:
Martin Brennan 2024-12-05 13:43:08 +10:00
parent 641099e720
commit 2ac2c42b06
No known key found for this signature in database
GPG Key ID: BD981EFEEC8F5675
3 changed files with 27 additions and 8 deletions

View File

@ -190,7 +190,7 @@ body.wizard {
}
&__sidebar {
width: 170px;
width: 230px;
box-sizing: border-box;
margin-right: 1em;

View File

@ -9,6 +9,20 @@ class Wizard
def build
return @wizard unless SiteSetting.wizard_enabled? && @wizard.user.try(:staff?)
append_introduction_step
append_privacy_step
append_styling_step
append_ready_step
append_branding_step
append_corporate_step
DiscourseEvent.trigger(:build_wizard, @wizard)
@wizard
end
protected
def append_introduction_step
@wizard.append_step("introduction") do |step|
step.emoji = "wave"
step.description_vars = { base_path: Discourse.base_path }
@ -56,7 +70,9 @@ class Wizard
end
end
end
end
def append_privacy_step
@wizard.append_step("privacy") do |step|
step.emoji = "hugs"
@ -93,12 +109,16 @@ class Wizard
updater.update_setting(:must_approve_users, updater.fields[:must_approve_users] == "yes")
end
end
end
def append_ready_step
@wizard.append_step("ready") do |step|
# no form on this page, just info.
step.emoji = "rocket"
end
end
def append_branding_step
@wizard.append_step("branding") do |step|
step.emoji = "framed_picture"
step.add_field(id: "logo", type: "image", value: SiteSetting.site_logo_url)
@ -112,7 +132,9 @@ class Wizard
end
end
end
end
def append_styling_step
@wizard.append_step("styling") do |step|
step.emoji = "art"
default_theme = Theme.find_by(id: SiteSetting.default_theme_id)
@ -231,7 +253,9 @@ class Wizard
updater.refresh_required = true
end
end
end
def append_corporate_step
@wizard.append_step("corporate") do |step|
step.emoji = "briefcase"
step.description_vars = { base_path: Discourse.base_path }
@ -259,13 +283,8 @@ class Wizard
end
end
end
DiscourseEvent.trigger(:build_wizard, @wizard)
@wizard
end
protected
def replace_setting_value(updater, raw, field_name)
old_value = SiteSetting.get(field_name)
old_value = field_name if old_value.blank?

View File

@ -14,12 +14,12 @@ describe "Wizard", type: :system do
wizard_page.go_to_next_step
expect(wizard_page).to be_on_step("privacy")
wizard_page.go_to_next_step
expect(wizard_page).to be_on_step("styling")
wizard_page.go_to_next_step
expect(wizard_page).to be_on_step("ready")
wizard_page.click_configure_more
expect(wizard_page).to be_on_step("branding")
wizard_page.go_to_next_step
expect(wizard_page).to be_on_step("styling")
wizard_page.go_to_next_step
expect(wizard_page).to be_on_step("corporate")
wizard_page.click_jump_in
expect(page).to have_current_path("/latest")