From d57c3f068d60f988db8a14a9b75e6a6c4c37f898 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jordi=20Guti=C3=A9rrez=20Hermoso?= Date: Mon, 22 Jul 2024 09:45:12 -0400 Subject: [PATCH] configCore: default to enterprise edition if TEST_ENABLE_ACTIVATION is truthy This will ensure that the grist-ee image will have a consistent config setting when created from the default value. --- app/server/lib/configCore.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/server/lib/configCore.ts b/app/server/lib/configCore.ts index 58ddf627..99c3770b 100644 --- a/app/server/lib/configCore.ts +++ b/app/server/lib/configCore.ts @@ -4,7 +4,8 @@ import { fileConfigAccessorFactory, IWritableConfigValue } from "./config"; -import { convertToCoreFileContents, IGristCoreConfigFileLatest } from "./configCoreFileFormats"; +import {convertToCoreFileContents, IGristCoreConfigFileLatest} from "./configCoreFileFormats"; +import {isAffirmative} from 'app/common/gutil'; export type Edition = "core" | "enterprise"; @@ -23,6 +24,9 @@ export function loadGristCoreConfigFile(configPath?: string): IGristCoreConfig { export function loadGristCoreConfig(fileConfig?: FileConfig): IGristCoreConfig { const fileConfigValue = fileConfigAccessorFactory(fileConfig); return { - edition: createConfigValue("core", fileConfigValue("edition")) + edition: createConfigValue( + isAffirmative(process.env.TEST_ENABLE_ACTIVATION) ? "enterprise" : "core", + fileConfigValue("edition") + ) }; }