FEATURE: Add chat and sidebar toggles to the setup wizard (#19347)

* FEATURE: Add chat and sidebar toggles to the setup wizard

- Fix css alighnment
- Add Enable Chat Toggle
- Add Enable Sidebar Toggle

* Check for the chat plugin

* Account for new sidebar step

* update chat and sidebar description

* UI: add checkmark as a visual indicator that it is enabled

* use new navigation_memu site setting for enabling the sidebar

* fix tests

* Add tests

* Update lib/wizard/step_updater.rb

Use HEADER_DROPDOWN instead of LEGACY

Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>

* Fix spec. Use HEADER_DROPDOWN instead of LEGACY

Co-authored-by: Ella <ella.estigoy@gmail.com>
Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
This commit is contained in:
Blake Erickson
2022-12-12 14:30:21 -07:00
committed by GitHub
parent a03b2cd469
commit de53cf7657
6 changed files with 75 additions and 6 deletions

View File

@@ -70,10 +70,28 @@ class Wizard
value: SiteSetting.must_approve_users
)
if defined?(::Chat)
step.add_field(
id: 'chat_enabled',
type: 'checkbox',
icon: 'comment',
value: SiteSetting.chat_enabled
)
end
step.add_field(
id: 'enable_sidebar',
type: 'checkbox',
icon: 'bars',
value: SiteSetting.navigation_menu == NavigationMenuSiteSetting::SIDEBAR
)
step.on_update do |updater|
updater.update_setting(:login_required, updater.fields[:login_required])
updater.update_setting(:invite_only, updater.fields[:invite_only])
updater.update_setting(:must_approve_users, updater.fields[:must_approve_users])
updater.update_setting(:chat_enabled, updater.fields[:chat_enabled]) if defined?(::Chat)
updater.update_setting(:navigation_menu, updater.fields[:enable_sidebar])
end
end