mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Add Support Grist page and nudge
Summary: Adds a new Support Grist page (accessible only in grist-core), containing options to opt in to telemetry and sponsor Grist Labs on GitHub. A nudge is also shown in the doc menu, which can be collapsed or permanently dismissed. Test Plan: Browser and server tests. Reviewers: paulfitz, dsagal Reviewed By: paulfitz Subscribers: jarek, dsagal Differential Revision: https://phab.getgrist.com/D3926
This commit is contained in:
@@ -83,21 +83,7 @@ export class BehavioralPromptsManager extends Disposable {
|
||||
}
|
||||
|
||||
private _queueTip(refElement: Element, prompt: BehavioralPrompt, options: AttachOptions) {
|
||||
if (
|
||||
this._isDisabled ||
|
||||
// Don't show tips if surveying is disabled.
|
||||
// TODO: Move this into a dedicated variable - this is only a short-term fix for hiding
|
||||
// tips in grist-core.
|
||||
(!getGristConfig().survey && prompt !== 'rickRow') ||
|
||||
// Or if this tip shouldn't be shown on mobile.
|
||||
(isNarrowScreen() && !options.showOnMobile) ||
|
||||
// Or if "Don't show tips" was checked in the past.
|
||||
(this._prefs.get().dontShowTips && !options.forceShow) ||
|
||||
// Or if this tip has been shown and dismissed in the past.
|
||||
this.hasSeenTip(prompt)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
if (!this._shouldQueueTip(prompt, options)) { return; }
|
||||
|
||||
this._queuedTips.push({prompt, refElement, options});
|
||||
if (this._queuedTips.length > 1) {
|
||||
@@ -156,4 +142,26 @@ export class BehavioralPromptsManager extends Disposable {
|
||||
this._prefs.set({...this._prefs.get(), dontShowTips: true});
|
||||
this._queuedTips = [];
|
||||
}
|
||||
|
||||
private _shouldQueueTip(prompt: BehavioralPrompt, options: AttachOptions) {
|
||||
if (
|
||||
this._isDisabled ||
|
||||
(isNarrowScreen() && !options.showOnMobile) ||
|
||||
(this._prefs.get().dontShowTips && !options.forceShow) ||
|
||||
this.hasSeenTip(prompt)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const {deploymentType} = getGristConfig();
|
||||
const {deploymentTypes} = GristBehavioralPrompts[prompt];
|
||||
if (
|
||||
deploymentTypes !== '*' &&
|
||||
(!deploymentType || !deploymentTypes.includes(deploymentType))
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user