mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Add GRIST_UI_FEATURES env variable
Summary: Tutorials are now hidden by default in grist-core and grist-ee, and can be re-enabled via a new env variable, GRIST_UI_FEATURES, which accepts a comma-separated list of UI features to enable. Test Plan: Browser tests. Reviewers: jarek Reviewed By: jarek Subscribers: jarek Differential Revision: https://phab.getgrist.com/D3885
This commit is contained in:
@@ -584,8 +584,8 @@ export interface GristLoadConfig {
|
||||
|
||||
activation?: Activation;
|
||||
|
||||
// Parts of the UI to hide
|
||||
hideUiElements?: IHideableUiElement[];
|
||||
// List of enabled features.
|
||||
features?: IFeature[];
|
||||
|
||||
// String to append to the end of the HTML document.title
|
||||
pageTitleSuffix?: string;
|
||||
@@ -612,12 +612,19 @@ export interface GristLoadConfig {
|
||||
userLocale?: string;
|
||||
}
|
||||
|
||||
export const HideableUiElements = StringUnion("helpCenter", "billing", "templates", "multiSite", "multiAccounts",
|
||||
"sendToDrive");
|
||||
export type IHideableUiElement = typeof HideableUiElements.type;
|
||||
export const Features = StringUnion(
|
||||
"helpCenter",
|
||||
"billing",
|
||||
"templates",
|
||||
"multiSite",
|
||||
"multiAccounts",
|
||||
"sendToDrive",
|
||||
"tutorials",
|
||||
);
|
||||
export type IFeature = typeof Features.type;
|
||||
|
||||
export function shouldHideUiElement(elem: IHideableUiElement): boolean {
|
||||
return (getGristConfig().hideUiElements || []).includes(elem);
|
||||
export function isFeatureEnabled(feature: IFeature): boolean {
|
||||
return (getGristConfig().features || []).includes(feature);
|
||||
}
|
||||
|
||||
export function getPageTitleSuffix(config?: GristLoadConfig) {
|
||||
|
||||
Reference in New Issue
Block a user