mirror of
				https://github.com/gristlabs/grist-core.git
				synced 2025-06-13 20:53:59 +00:00 
			
		
		
		
	(core) Hide tips in grist-core
Summary: Also fixes a deployment test failure in staging due to a test util throwing a (harmless) error. Test Plan: Tested manually. Reviewers: jarek Reviewed By: jarek Differential Revision: https://phab.getgrist.com/D3740
This commit is contained in:
		
							parent
							
								
									e52e15591d
								
							
						
					
					
						commit
						1a4561dbf2
					
				@ -3,6 +3,7 @@ import {AppModel} from 'app/client/models/AppModel';
 | 
			
		||||
import {GristBehavioralPrompts} from 'app/client/ui/GristTooltips';
 | 
			
		||||
import {isNarrowScreen} from 'app/client/ui2018/cssVars';
 | 
			
		||||
import {BehavioralPrompt} from 'app/common/Prefs';
 | 
			
		||||
import {getGristConfig} from 'app/common/urlUtils';
 | 
			
		||||
import {Computed, Disposable, dom} from 'grainjs';
 | 
			
		||||
import {IPopupOptions} from 'popweasel';
 | 
			
		||||
 | 
			
		||||
@ -51,7 +52,18 @@ export class BehavioralPrompts extends Disposable {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  private _queueTip(refElement: Element, prompt: BehavioralPrompt, options: AttachOptions) {
 | 
			
		||||
    if (isNarrowScreen() || this._prefs.get().dontShowTips || this.hasSeenTip(prompt)) {
 | 
			
		||||
    if (
 | 
			
		||||
      // 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 ||
 | 
			
		||||
      // Or on mobile - the design currently isn't mobile-friendly.
 | 
			
		||||
      isNarrowScreen() ||
 | 
			
		||||
      // Or if "Don't show tips" was checked in the past.
 | 
			
		||||
      this._prefs.get().dontShowTips ||
 | 
			
		||||
      // Or if this tip has been shown and dismissed in the past.
 | 
			
		||||
      this.hasSeenTip(prompt)
 | 
			
		||||
    ) {
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -439,7 +439,10 @@ export class HomeUtil {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  private async _toggleTips(enabled: boolean, email: string) {
 | 
			
		||||
    if (this.server.isExternalServer()) { throw new Error('not supported'); }
 | 
			
		||||
    if (this.server.isExternalServer()) {
 | 
			
		||||
      // Unsupported due to lack of access to the database.
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const dbManager = await this.server.getDatabase();
 | 
			
		||||
    const user = await dbManager.getUserByLogin(email);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user