mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
move getTemplateOrg method; enable template org in docker tests (#602)
* move getTemplateOrg method; enable template org in docker tests This moves the `getTemplateOrg` method to a neutral venue for the convenience of `grist-static`, otherwise a lot of awkward dependencies get pulled in needlessly in new parts of the app. This also fixes docker tests using the template org.
This commit is contained in:
@@ -3,10 +3,10 @@ import {isAffirmative} from 'app/common/gutil';
|
||||
import {getTagManagerSnippet} from 'app/common/tagManager';
|
||||
import {Document} from 'app/common/UserAPI';
|
||||
import {SUPPORT_EMAIL} from 'app/gen-server/lib/HomeDBManager';
|
||||
import {appSettings} from 'app/server/lib/AppSettings';
|
||||
import {isAnonymousUser, isSingleUserMode, RequestWithLogin} from 'app/server/lib/Authorizer';
|
||||
import {RequestWithOrg} from 'app/server/lib/extractOrg';
|
||||
import {GristServer} from 'app/server/lib/GristServer';
|
||||
import {getTemplateOrg} from 'app/server/lib/gristSettings';
|
||||
import {getSupportedEngineChoices} from 'app/server/lib/serverUtils';
|
||||
import {readLoadedLngs, readLoadedNamespaces} from 'app/server/localization';
|
||||
import * as express from 'express';
|
||||
@@ -154,18 +154,6 @@ export function makeSendAppPage(opts: {
|
||||
};
|
||||
}
|
||||
|
||||
export function getTemplateOrg() {
|
||||
let org = appSettings.section('templates').flag('org').readString({
|
||||
envVar: 'GRIST_TEMPLATE_ORG',
|
||||
});
|
||||
if (!org) { return null; }
|
||||
|
||||
if (process.env.GRIST_ID_PREFIX) {
|
||||
org += `-${process.env.GRIST_ID_PREFIX}`;
|
||||
}
|
||||
return org;
|
||||
}
|
||||
|
||||
function shouldSupportAnon() {
|
||||
// Enable UI for anonymous access if a flag is explicitly set in the environment
|
||||
return process.env.GRIST_SUPPORT_ANON === "true";
|
||||
|
||||
Reference in New Issue
Block a user