From caaa9d7f611b0b2b0cab3719ff2ad6602ee4e4f4 Mon Sep 17 00:00:00 2001 From: Cindy Nguyen Date: Fri, 27 Oct 2023 15:29:33 -0400 Subject: [PATCH] fix: use getConfig not process.env Co-authored-by: Mena Hassan --- .env | 2 +- .env.development | 2 +- .env.test | 2 +- public/index.html | 11 -------- src/App.jsx | 28 +++++++++++++++---- .../LearnerDashboardHeader/BrandLogo.jsx | 4 +-- .../components/ProductCardHeader.jsx | 3 +- .../ProductRecommendations/optimizely.js | 4 ++- 8 files changed, 32 insertions(+), 24 deletions(-) diff --git a/.env b/.env index 2291ec64e..53e570e18 100644 --- a/.env +++ b/.env @@ -41,4 +41,4 @@ ACCOUNT_PROFILE_URL='' ENABLE_NOTICES='' CAREER_LINK_URL='' OPTIMIZELY_FULL_STACK_SDK_KEY='' -EXPERIMENT_08_23_VAN_PAINTED_DOOR=true +EXPERIMENT_08_23_VAN_PAINTED_DOOR=true \ No newline at end of file diff --git a/.env.development b/.env.development index 78e4c40a9..e566a709f 100644 --- a/.env.development +++ b/.env.development @@ -47,4 +47,4 @@ ACCOUNT_SETTINGS_URL='http://localhost:1997' ACCOUNT_PROFILE_URL='http://localhost:1995' ENABLE_NOTICES='' CAREER_LINK_URL='' -OPTIMIZELY_FULL_STACK_SDK_KEY='' +OPTIMIZELY_FULL_STACK_SDK_KEY='' \ No newline at end of file diff --git a/.env.test b/.env.test index 09cf4b36f..c75cfb550 100644 --- a/.env.test +++ b/.env.test @@ -47,4 +47,4 @@ ACCOUNT_PROFILE_URL='http://account-profile-url.test' ENABLE_NOTICES='' CAREER_LINK_URL='' OPTIMIZELY_FULL_STACK_SDK_KEY='SDK Key' -EXPERIMENT_08_23_VAN_PAINTED_DOOR=true +EXPERIMENT_08_23_VAN_PAINTED_DOOR=true \ No newline at end of file diff --git a/public/index.html b/public/index.html index cfe5611ca..e1a12ed66 100755 --- a/public/index.html +++ b/public/index.html @@ -1,19 +1,8 @@ - Learner Dashboard | <%= process.env.SITE_NAME %> - - <% if (process.env.OPTIMIZELY_URL) { %> - - <% } else if (process.env.OPTIMIZELY_PROJECT_ID) { %> - - <% } %>
diff --git a/src/App.jsx b/src/App.jsx index 722298cc9..56869fa98 100755 --- a/src/App.jsx +++ b/src/App.jsx @@ -27,6 +27,7 @@ import fakeData from 'data/services/lms/fakeData/courses'; import AppWrapper from 'containers/WidgetContainers/AppWrapper'; import LearnerDashboardHeader from 'containers/LearnerDashboardHeader'; +import { getConfig } from '@edx/frontend-platform'; import messages from './messages'; import './App.scss'; @@ -41,8 +42,21 @@ export const App = () => { const { supportEmail } = reduxHooks.usePlatformSettingsData(); const loadData = reduxHooks.useLoadData(); + const optimizelyScript = () => { + if (getConfig().OPTIMIZELY_URL) { + return