From 3da65940927da45ce3bd426f5b0c240ef34a5111 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Mon, 5 Dec 2022 08:30:14 -0500 Subject: [PATCH] fix for APP_ENABLE_ACCOUNT_LIMITS_ALL --- entrypoint.sh | 4 +++- package-lock.json | 26 ++++++++++++++++---------- src/constants.js | 10 +++++++--- 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 57ea0e7..4606ca4 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,7 +4,9 @@ API_PORT="${API_PORT:-3000}" API_VERSION="${API_VERSION:-v1}" REACT_APP_API_BASE_URL=${REACT_APP_API_BASE_URL:-http://$PUBLIC_IPV4:$API_PORT/$API_VERSION} echo "REACT_APP_API_BASE_URL=${REACT_APP_API_BASE_URL}" > /opt/app/.env +REACT_APP_ENABLE_ACCOUNT_LIMITS_ALL=${REACT_APP_ENABLE_ACCOUNT_LIMITS_ALL:-0} +echo "REACT_APP_ENABLE_ACCOUNT_LIMITS_ALL=${REACT_APP_ENABLE_ACCOUNT_LIMITS_ALL}" >> /opt/app/.env cd /opt/app/ -TAG="" +TAG="" sed -i -e "\@@i\ $TAG" ./build/index.html npm run serve diff --git a/package-lock.json b/package-lock.json index 1ec623a..6715dd9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4795,13 +4795,19 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001299", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001299.tgz", - "integrity": "sha512-iujN4+x7QzqA2NCSrS5VUy+4gLmRd4xv6vbBBsmfVqTx8bLAD8097euLqQgKxSVLvxjSDcvF1T/i9ocgnUFexw==", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - } + "version": "1.0.30001436", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001436.tgz", + "integrity": "sha512-ZmWkKsnC2ifEPoWUvSAIGyOYwT+keAaaWPHiQ9DfMqS1t6tfuyFYoWR78TeZtznkEQ64+vGXH9cZrElwR2Mrxg==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + } + ] }, "node_modules/case-sensitive-paths-webpack-plugin": { "version": "2.4.0", @@ -19618,9 +19624,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001299", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001299.tgz", - "integrity": "sha512-iujN4+x7QzqA2NCSrS5VUy+4gLmRd4xv6vbBBsmfVqTx8bLAD8097euLqQgKxSVLvxjSDcvF1T/i9ocgnUFexw==" + "version": "1.0.30001436", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001436.tgz", + "integrity": "sha512-ZmWkKsnC2ifEPoWUvSAIGyOYwT+keAaaWPHiQ9DfMqS1t6tfuyFYoWR78TeZtznkEQ64+vGXH9cZrElwR2Mrxg==" }, "case-sensitive-paths-webpack-plugin": { "version": "2.4.0", diff --git a/src/constants.js b/src/constants.js index e81e5dc..fa050c6 100644 --- a/src/constants.js +++ b/src/constants.js @@ -1,5 +1,6 @@ const { REACT_APP_API_BASE_URL, REACT_APP_ENABLE_ACCOUNT_LIMITS_ALL } = process.env; export const APP_API_BASE_URL = (window.JAMBONZ) ? window.JAMBONZ.APP_API_BASE_URL : REACT_APP_API_BASE_URL; +export const APP_ENABLE_ACCOUNT_LIMITS_ALL = (window.JAMBONZ) ? window.JAMBONZ.REACT_APP_ENABLE_ACCOUNT_LIMITS_ALL : JSON.parse(REACT_APP_ENABLE_ACCOUNT_LIMITS_ALL); export const LIMITS = [ // { // label: "Max registered devices (0=unlimited)", @@ -14,8 +15,9 @@ export const LIMITS = [ category: "voice_call_session", } ]; - - if (REACT_APP_ENABLE_ACCOUNT_LIMITS_ALL) { + console.log(`REACT_APP_API_BASE_URL: ${REACT_APP_API_BASE_URL}, APP_ENABLE_ACCOUNT_LIMITS_ALL: ${APP_ENABLE_ACCOUNT_LIMITS_ALL}`); + console.log(`typeof APP_ENABLE_ACCOUNT_LIMITS_ALL: ${typeof APP_ENABLE_ACCOUNT_LIMITS_ALL}`); + if (APP_ENABLE_ACCOUNT_LIMITS_ALL || APP_ENABLE_ACCOUNT_LIMITS_ALL === "true") { LIMITS.push({ label: "Licensed calls", category: "voice_call_session_license", @@ -28,4 +30,6 @@ export const LIMITS = [ label: "Licensed minutes", category: "voice_call_minutes_license", }); - } \ No newline at end of file + } + console.log(`LIMITS: ${JSON.stringify(LIMITS)}`); + \ No newline at end of file