feat: activate optimizely experiment (#31035)

activate optimizely experiment manually for only B2C users.

VAN-1097
This commit is contained in:
Mubbshar Anwar
2022-09-26 16:03:42 +05:00
committed by GitHub
parent 4f74d8a16a
commit 3bb45d2547
2 changed files with 14 additions and 0 deletions

View File

@@ -51,6 +51,7 @@ from openedx.features.enterprise_support.api import (
get_dashboard_consent_notification,
get_enterprise_learner_portal_context,
)
from openedx.features.enterprise_support.utils import is_enterprise_learner
from openedx.core.djangoapps.geoinfo.api import country_code_from_ip
from common.djangoapps.student.api import COURSE_DASHBOARD_PLUGIN_VIEW_NAME
from common.djangoapps.student.helpers import cert_info, check_verify_status_by_course, get_resume_urls_for_enrollments
@@ -838,6 +839,8 @@ def student_dashboard(request): # lint-amnesty, pylint: disable=too-many-statem
# TODO START: clean up as part of REVEM-199 (END)
'disable_unenrollment': disable_unenrollment,
'country_code': country_code,
# TODO: clean when experiment(Merchandise 2U LOBs - Dashboard) would be stop. [VAN-1097]
'is_enterprise_user': is_enterprise_learner(user),
}
# Include enterprise learner portal metadata and messaging

View File

@@ -2,6 +2,17 @@
import React from 'react';
class Static2UCallouts extends React.Component {
componentDidMount() {
if (!this.props.isEnterpriseUser){
window['optimizely'] = window['optimizely'] || [];
window['optimizely'].push({
type: "page",
pageName: "merchandise_2u_lobs"
});
}
}
render() {
return (
<div className="static-callouts-main">