mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Implement new onboarding popups (#18362)
This commit introduces a new framework for building user tutorials as popups using the Tippy JS library. Currently, the new framework is used to replace the old notification spotlight and tips and show a new one related to the topic timeline. All popups follow the same structure and have a title, a description and two buttons for either dismissing just the current tip or all of them at once. The state of all seen popups is stored in a user option. Updating skip_new_user_tips will automatically update the list of seen popups accordingly.
This commit is contained in:
@@ -8,6 +8,20 @@ RSpec.describe SiteSerializer do
|
||||
Site.clear_cache
|
||||
end
|
||||
|
||||
describe '#onboarding_popup_types' do
|
||||
it 'is included if enable_onboarding_popups' do
|
||||
SiteSetting.enable_onboarding_popups = true
|
||||
|
||||
serialized = described_class.new(Site.new(guardian), scope: guardian, root: false).as_json
|
||||
expect(serialized[:onboarding_popup_types]).to eq(OnboardingPopup.types)
|
||||
end
|
||||
|
||||
it 'is not included if enable_onboarding_popups is disabled' do
|
||||
serialized = described_class.new(Site.new(guardian), scope: guardian, root: false).as_json
|
||||
expect(serialized[:onboarding_popup_types]).to eq(nil)
|
||||
end
|
||||
end
|
||||
|
||||
it "includes category custom fields only if its preloaded" do
|
||||
category.custom_fields["enable_marketplace"] = true
|
||||
category.save_custom_fields
|
||||
|
||||
Reference in New Issue
Block a user