From 4b2d65c44c0ad95e54bb7187122d5f7dc7bbf816 Mon Sep 17 00:00:00 2001 From: Cindy Nguyen Date: Fri, 27 Oct 2023 15:29:33 -0400 Subject: [PATCH 1/2] fix: use getConfig not process.env Co-authored-by: Mena Hassan --- public/index.html | 11 -------- src/App.jsx | 28 +++++++++++++++---- src/App.test.jsx | 8 ++++-- src/__snapshots__/App.test.jsx.snap | 12 ++++++++ .../LearnerDashboardHeader/BrandLogo.jsx | 4 +-- .../components/ProductCardHeader.jsx | 3 +- .../ProductRecommendations/optimizely.js | 4 ++- .../ProductRecommendations/optimizely.test.js | 4 +++ 8 files changed, 51 insertions(+), 23 deletions(-) diff --git a/public/index.html b/public/index.html index cfe5611c..e1a12ed6 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 722298cc..56869fa9 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