mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
732611c356
Summary: A floating formula editor is available by default and in the basic setup allows just formula modification. AI assistant is now an optional component of the floating editor and it is controlled by OPENAPI_KEY presence. Env variable GRIST_FORMULA_ASSISTANT was removed, new feature flag HAS_FORMULA_ASSISTANT is derived from the presence of OPENAPI_KEY. Also updated anonymous signup nudge. By default it displays only info that this feature is only for logged in users. Test Plan: updated Reviewers: georgegevoian Reviewed By: georgegevoian Differential Revision: https://phab.getgrist.com/D3987
23 lines
703 B
TypeScript
23 lines
703 B
TypeScript
import {getGristConfig} from 'app/common/urlUtils';
|
|
import {get as getBrowserGlobals} from 'app/client/lib/browserGlobals';
|
|
import {localStorageBoolObs} 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);
|
|
}
|