From 73eba9252764c196aa0a1995b3036bad358f36a3 Mon Sep 17 00:00:00 2001 From: jenniw Date: Thu, 8 Aug 2024 18:43:22 -0400 Subject: [PATCH 1/8] Add to notification and send object back for putting in the gtag --- .../templates/checkout_interstitial.html | 6 ------ .../src/components/NotificationContainer.js | 4 ++++ frontend/public/src/components/TopBar.js | 2 +- frontend/public/src/lib/notificationsApi.js | 21 ++++++++++++++++++- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/ecommerce/templates/checkout_interstitial.html b/ecommerce/templates/checkout_interstitial.html index 6706435a9..af309783c 100644 --- a/ecommerce/templates/checkout_interstitial.html +++ b/ecommerce/templates/checkout_interstitial.html @@ -15,12 +15,6 @@

Redirecting to the payment processor...

{% endfor %} - {% if ga_purchase_flag %} - {{ ga_purchase_payload | json_script:"ga-purchase-payload" }} - - {% endif %} diff --git a/frontend/public/src/components/NotificationContainer.js b/frontend/public/src/components/NotificationContainer.js index e1a013680..d83022432 100644 --- a/frontend/public/src/components/NotificationContainer.js +++ b/frontend/public/src/components/NotificationContainer.js @@ -5,6 +5,7 @@ import { compose } from "redux" import { partial } from "ramda" // $FlowFixMe import { Alert } from "reactstrap" +import ga from "react-ga" import { removeUserNotification } from "../actions" import { @@ -15,6 +16,7 @@ import { } from "../lib/util" import { getNotificationAlertProps } from "../lib/notificationsApi" import { notificationTypeMap, TextNotification } from "./notifications" +import { checkFeatureFlag } from "../lib/util" import type { UserNotificationMapping } from "../reducers/notifications" @@ -58,6 +60,8 @@ export class NotificationContainer extends React.Component { const { userNotifications } = this.props const { hiddenNotifications } = this.state + const ga_feature_flag = checkFeatureFlag("", ) + return (
{Object.keys(userNotifications).map((notificationKey, i) => { diff --git a/frontend/public/src/components/TopBar.js b/frontend/public/src/components/TopBar.js index 789e7a2db..14fbdd0b9 100644 --- a/frontend/public/src/components/TopBar.js +++ b/frontend/public/src/components/TopBar.js @@ -31,7 +31,7 @@ const TopBar = ({ currentUser }: Props) => { return (
{showComponent ? ( - + ) : null}