mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Enable auto triggering of Welcome Tour, and various improvements.
Summary: - Add showGristTour preference, and trigger tour automatically. - Tour is only triggered for new and anonymous users on a personal org, with edit permission. - Automatically open the right panel at tour start. - Don't show tours on mobile, since that's not ready (popups are cut off and can't be dismissed) - Cancel previous tour if a new one is somehow started. - Remove #repeat- trigger hash tags from the URL when the tour starts. - Ensure Help Center popup is positioned even when left panel is collapsed. - Polish up the content of the last two cards in the tour. Test Plan: Added test case for triggering and opening right panel. Reviewers: alexmojaki, paulfitz Reviewed By: alexmojaki Differential Revision: https://phab.getgrist.com/D2955
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
* the caller. Pass an `onFinishCB` to handle when a user dimiss the popups.
|
||||
*/
|
||||
|
||||
import { Disposable, dom, DomElementArg, makeTestId, styled, svg } from "grainjs";
|
||||
import { Disposable, dom, DomElementArg, Holder, makeTestId, styled, svg } from "grainjs";
|
||||
import { createPopper, Placement } from '@popperjs/core';
|
||||
import { FocusLayer } from 'app/client/lib/FocusLayer';
|
||||
import * as Mousetrap from 'app/client/lib/Mousetrap';
|
||||
@@ -71,8 +71,12 @@ export interface IOnBoardingMsg {
|
||||
urlState?: IGristUrlState;
|
||||
}
|
||||
|
||||
// There should only be one tour at a time. Use a holder to dispose the previous tour when
|
||||
// starting a new one.
|
||||
const tourSingleton = Holder.create<OnBoardingPopupsCtl>(null);
|
||||
|
||||
export function startOnBoarding(messages: IOnBoardingMsg[], onFinishCB: () => void) {
|
||||
const ctl = new OnBoardingPopupsCtl(messages, onFinishCB);
|
||||
const ctl = OnBoardingPopupsCtl.create(tourSingleton, messages, onFinishCB);
|
||||
ctl.start().catch(reportError);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user