diff --git a/app/client/ui/WelcomeQuestions.ts b/app/client/ui/WelcomeQuestions.ts index 5db8c0a8..4adc17e9 100644 --- a/app/client/ui/WelcomeQuestions.ts +++ b/app/client/ui/WelcomeQuestions.ts @@ -5,10 +5,11 @@ import {IconName} from 'app/client/ui2018/IconList'; import {ISaveModalOptions, saveModal} from 'app/client/ui2018/modals'; import {BaseAPI} from 'app/common/BaseAPI'; import {UserPrefs} from 'app/common/Prefs'; +import {getGristConfig} from 'app/common/urlUtils'; import {dom, input, Observable, styled, subscribeElem} from 'grainjs'; export function showWelcomeQuestions(userPrefsObs: Observable) { - if (!userPrefsObs.get()?.showNewUserQuestions) { + if (!(getGristConfig().survey && userPrefsObs.get()?.showNewUserQuestions)) { return null; } diff --git a/app/common/gristUrls.ts b/app/common/gristUrls.ts index 95490154..70421d04 100644 --- a/app/common/gristUrls.ts +++ b/app/common/gristUrls.ts @@ -479,6 +479,9 @@ export interface GristLoadConfig { // If custom widget list is available. enableWidgetRepository?: boolean; + + // Whether there is somewhere for survey data to go. + survey?: boolean; } // Acceptable org subdomains are alphanumeric (hyphen also allowed) and of diff --git a/app/server/lib/FlexServer.ts b/app/server/lib/FlexServer.ts index 7d526d56..48735a1e 100644 --- a/app/server/lib/FlexServer.ts +++ b/app/server/lib/FlexServer.ts @@ -76,8 +76,9 @@ const HEALTH_CHECK_LOG_SHOW_FIRST_N = 10; // And we show every Nth health check: const HEALTH_CHECK_LOG_SHOW_EVERY_N = 100; -// DocID of Grist doc to collect the Welcome questionnaire responses. -const DOC_ID_NEW_USER_INFO = process.env.DOC_ID_NEW_USER_INFO || 'GristNewUserInfo'; +// DocID of Grist doc to collect the Welcome questionnaire responses, such +// as "GristNewUserInfo". +const DOC_ID_NEW_USER_INFO = process.env.DOC_ID_NEW_USER_INFO; export interface FlexServerOptions { dataDir?: string; @@ -1593,6 +1594,8 @@ export class FlexServer implements GristServer { private async _recordNewUserInfo(row: object) { const urlId = DOC_ID_NEW_USER_INFO; + // If nowhere to record data, return immediately. + if (!urlId) { return; } let body: string|undefined; let permitKey: string|undefined; try { diff --git a/app/server/lib/sendAppPage.ts b/app/server/lib/sendAppPage.ts index 99a0b204..24d4b287 100644 --- a/app/server/lib/sendAppPage.ts +++ b/app/server/lib/sendAppPage.ts @@ -46,6 +46,7 @@ export function makeGristConfig(homeUrl: string|null, extra: Partial