gristlabs_grist-core/app/client/models/features.ts
Jarosław Sadziński 95c0441d84 (core) Form kanban tasks
Summary:
- Open all links in a new tab
- Excluding not filled columns (to fix trigger formulas)
- Fixed Ref/RefList submission
- Removing redundant type definitions for Box
- Adding header menu item
- Default empty values in select control

Test Plan: Updated

Reviewers: georgegevoian

Reviewed By: georgegevoian

Differential Revision: https://phab.getgrist.com/D4166
2024-01-23 22:11:48 +01:00

36 lines
1.1 KiB
TypeScript

import {getGristConfig} from 'app/common/urlUtils';
import {get as getBrowserGlobals} from 'app/client/lib/browserGlobals';
import {localStorageBoolObs, localStorageJsonObs} from 'app/client/lib/localStorageObs';
import {Observable} from 'grainjs';
/**
* Are comments enabled by feature flag.
*/
export function COMMENTS(): Observable<boolean> {
const G = getBrowserGlobals('document', 'window');
if (!G.window.COMMENTS) {
G.window.COMMENTS = localStorageBoolObs('feature-comments', Boolean(getGristConfig().featureComments));
}
return G.window.COMMENTS;
}
/**
* Does backend supports AI assistant.
*/
export function HAS_FORMULA_ASSISTANT() {
return Boolean(getGristConfig().featureFormulaAssistant);
}
export function WHICH_FORMULA_ASSISTANT() {
return getGristConfig().assistantService;
}
export function PERMITTED_CUSTOM_WIDGETS(): Observable<string[]> {
const G = getBrowserGlobals('document', 'window');
if (!G.window.PERMITTED_CUSTOM_WIDGETS) {
G.window.PERMITTED_CUSTOM_WIDGETS =
localStorageJsonObs('PERMITTED_CUSTOM_WIDGETS', getGristConfig().permittedCustomWidgets || []);
}
return G.window.PERMITTED_CUSTOM_WIDGETS;
}