From 38b0d5832f9fd4a53301f4e08867389db9855866 Mon Sep 17 00:00:00 2001 From: attiyaishaque Date: Wed, 15 Feb 2023 14:00:07 +0500 Subject: [PATCH] fix: [VAN-1292] Remove personalized recommendation cookie --- .env | 1 - .env.development | 1 - src/config/index.js | 1 - .../RecommendationsPanel/components/hooks.js | 19 ------------------- 4 files changed, 22 deletions(-) diff --git a/.env b/.env index ef88b81..660f1ba 100644 --- a/.env +++ b/.env @@ -31,7 +31,6 @@ ENTERPRISE_MARKETING_UTM_SOURCE='' ENTERPRISE_MARKETING_UTM_CAMPAIGN='' ENTERPRISE_MARKETING_FOOTER_UTM_MEDIUM='' LEARNING_BASE_URL='' -PERSONALIZED_RECOMMENDATION_COOKIE_NAME = 'edx-user-personalized-recommendation' ZENDESK_KEY='' HOTJAR_APP_ID='' HOTJAR_VERSION='6' diff --git a/.env.development b/.env.development index 44ed398..99dcc0e 100644 --- a/.env.development +++ b/.env.development @@ -38,7 +38,6 @@ ENTERPRISE_MARKETING_UTM_CAMPAIGN='example.com Referral' ENTERPRISE_MARKETING_FOOTER_UTM_MEDIUM='Footer' LEARNING_BASE_URL='http://localhost:2000' SESSION_COOKIE_DOMAIN='localhost' -PERSONALIZED_RECOMMENDATION_COOKIE_NAME = 'edx-user-personalized-recommendation' ZENDESK_KEY='' HOTJAR_APP_ID='' HOTJAR_VERSION='6' diff --git a/src/config/index.js b/src/config/index.js index 9ada1d1..47cf334 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -10,7 +10,6 @@ const configuration = { SEGMENT_KEY: process.env.SEGMENT_KEY, // ACCESS_TOKEN_COOKIE_NAME: process.env.ACCESS_TOKEN_COOKIE_NAME, LEARNING_BASE_URL: process.env.LEARNING_BASE_URL, - PERSONALIZED_RECOMMENDATION_COOKIE_NAME: process.env.PERSONALIZED_RECOMMENDATION_COOKIE_NAME || '', SESSION_COOKIE_DOMAIN: process.env.SESSION_COOKIE_DOMAIN || '', ZENDESK_KEY: process.env.ZENDESK_KEY, SUPPORT_URL: process.env.SUPPORT_URL || null, diff --git a/src/widgets/RecommendationsPanel/components/hooks.js b/src/widgets/RecommendationsPanel/components/hooks.js index b50b253..47c1eb0 100644 --- a/src/widgets/RecommendationsPanel/components/hooks.js +++ b/src/widgets/RecommendationsPanel/components/hooks.js @@ -1,6 +1,3 @@ -import { configuration } from 'config'; -import { setCookie, getCookie } from 'utils/cookies'; - import track from '../track'; import './index.scss'; @@ -8,22 +5,6 @@ export const useCourseCardData = (course, isControl) => { const handleCourseClick = (e) => { e.preventDefault(); - const cookieName = configuration.PERSONALIZED_RECOMMENDATION_COOKIE_NAME; - let recommendedCourses = getCookie(cookieName); - if (typeof recommendedCourses === 'undefined') { - recommendedCourses = { course_keys: [course.courseKey] }; - } else if (!recommendedCourses.course_keys.includes(course.courseKey)) { - if (recommendedCourses.course_keys.length < 5) { - recommendedCourses.course_keys.push(course.courseKey); - } else { - recommendedCourses.course_keys.shift(); - recommendedCourses.course_keys.push(course.courseKey); - } - } - recommendedCourses.is_control = isControl; - recommendedCourses.is_personalized_recommendation = isControl; - setCookie(cookieName, JSON.stringify(recommendedCourses), 365); - track.recommendedCourseClicked( course.courseKey, isControl,