2020-08-19 03:08:58 +00:00
|
|
|
import {StringUnion} from 'app/common/StringUnion';
|
|
|
|
|
|
|
|
export const SortPref = StringUnion("name", "date");
|
|
|
|
export type SortPref = typeof SortPref.type;
|
|
|
|
|
|
|
|
export const ViewPref = StringUnion("list", "icons");
|
|
|
|
export type ViewPref = typeof ViewPref.type;
|
|
|
|
|
2020-08-04 15:52:56 +00:00
|
|
|
// A collection of preferences related to a user or org (or combination).
|
|
|
|
export interface Prefs {
|
2022-01-14 02:55:55 +00:00
|
|
|
// A dummy field used only in tests.
|
2020-08-04 15:52:56 +00:00
|
|
|
placeholder?: string;
|
|
|
|
}
|
|
|
|
|
2022-01-14 02:55:55 +00:00
|
|
|
// A collection of preferences related to a user or org (or combination).
|
|
|
|
export interface UserPrefs extends Prefs {
|
|
|
|
// Whether to ask the user to fill out a form about their use-case, on opening the DocMenu page.
|
|
|
|
// Set to true on first login, then reset when the form is closed, so that it only shows once.
|
|
|
|
showNewUserQuestions?: boolean;
|
2022-03-11 20:35:29 +00:00
|
|
|
// Whether to record a new sign-up event via Google Tag Manager. Set to true on first login, then
|
|
|
|
// reset on first page load (after the event is sent), so that it's only recorded once.
|
|
|
|
recordSignUpEvent?: boolean;
|
2022-01-14 02:55:55 +00:00
|
|
|
}
|
2020-08-19 03:08:58 +00:00
|
|
|
|
|
|
|
export interface UserOrgPrefs extends Prefs {
|
|
|
|
docMenuSort?: SortPref;
|
|
|
|
docMenuView?: ViewPref;
|
2020-09-10 02:48:11 +00:00
|
|
|
|
|
|
|
// List of example docs that the user has seen and dismissed the welcome card for.
|
|
|
|
// The numbers are the `id` from IExampleInfo in app/client/ui/ExampleInfo.
|
|
|
|
// By living in UserOrgPrefs, this applies only to the examples-containing org.
|
|
|
|
seenExamples?: number[];
|
2021-07-27 16:03:35 +00:00
|
|
|
|
2021-07-30 15:16:33 +00:00
|
|
|
// Whether the user should see the onboarding tour of Grist. False by default, since existing
|
|
|
|
// users should not see it. New users get this set to true when the user is created. This
|
|
|
|
// applies to the personal org only; the tour is currently only shown there.
|
|
|
|
showGristTour?: boolean;
|
|
|
|
|
2021-07-27 16:03:35 +00:00
|
|
|
// List of document IDs where the user has seen and dismissed the document tour.
|
|
|
|
seenDocTours?: string[];
|
2020-08-19 03:08:58 +00:00
|
|
|
}
|
|
|
|
|
2020-08-04 15:52:56 +00:00
|
|
|
export type OrgPrefs = Prefs;
|