From eaf5e66e4d655dc9709c34c04addcbe7b330f4fc Mon Sep 17 00:00:00 2001 From: Kai Vandivier Date: Wed, 28 Aug 2024 18:04:58 +0200 Subject: [PATCH] fix: use strings for 'boolean' env vars --- cli/src/lib/env/getEnv.js | 4 ++-- shell/src/App.jsx | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cli/src/lib/env/getEnv.js b/cli/src/lib/env/getEnv.js index 2635a4dc..773cf2a4 100644 --- a/cli/src/lib/env/getEnv.js +++ b/cli/src/lib/env/getEnv.js @@ -33,12 +33,12 @@ const getShellEnv = (config) => { const shellEnv = { name: config.title, version: config.version, - loginApp: config.type === 'login_app' || undefined, + loginApp: config.type === 'login_app' ? 'true' : undefined, direction: config.direction, // NB: 'IS_PLUGIN' is added by string replacement in // compiler/entrypoints.js, since env is shared between app and plugin requiredProps: config.requiredProps?.join(), - skipPluginLogic: config.skipPluginLogic, + skipPluginLogic: config.skipPluginLogic ? 'true' : undefined, ...getPWAEnvVars(config), } diff --git a/shell/src/App.jsx b/shell/src/App.jsx index bad13521..dfdff99c 100644 --- a/shell/src/App.jsx +++ b/shell/src/App.jsx @@ -33,7 +33,8 @@ const parseRequiredProps = (propsEnvVariable) => { // via string replacement in cli/src/lib/compiler/entrypoints.js const isPlugin = self.__IS_PLUGIN -const skipPluginLogic = process.env.REACT_APP_DHIS2_APP_SKIPPLUGINLOGIC +const skipPluginLogic = + process.env.REACT_APP_DHIS2_APP_SKIPPLUGINLOGIC === 'true' const requiredPluginProps = parseRequiredProps( process.env.REACT_APP_DHIS2_APP_REQUIREDPROPS )