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:
Bianca Nenciu
2022-10-12 18:38:45 +03:00
committed by GitHub
parent 1eaa1fee2d
commit 7611fec0da
21 changed files with 376 additions and 36 deletions

View File

@@ -525,6 +525,20 @@ RSpec.describe UserUpdater do
end
end
context 'when skip_new_user_tips is edited' do
it 'updates all fields' do
UserUpdater.new(Discourse.system_user, user).update(skip_new_user_tips: true)
expect(user.user_option.skip_new_user_tips).to eq(true)
expect(user.user_option.seen_popups).to eq(OnboardingPopup.types.values)
UserUpdater.new(Discourse.system_user, user).update(skip_new_user_tips: false)
expect(user.user_option.skip_new_user_tips).to eq(false)
expect(user.user_option.seen_popups).to eq(nil)
end
end
it "logs the action" do
user = Fabricate(:user, name: 'Billy Bob')