refactor: Remove unused code for merchandising 2U LOBs (#34230)

This commit is contained in:
Attiya Ishaque
2024-02-20 14:03:10 +05:00
committed by GitHub
parent 9fd5157577
commit 3a05fd20c6
5 changed files with 1 additions and 244 deletions

View File

@@ -6,22 +6,6 @@ from edx_toggles.toggles import WaffleFlag, WaffleSwitch
# Namespace for student waffle flags.
WAFFLE_FLAG_NAMESPACE = 'student'
# Waffle flag to enable 2U Recommendations
# .. toggle_name: student.enable_2u_recommendations
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
# .. toggle_description: Supports rollout of a POC for 2U recommendations.
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2022-09-20
# .. toggle_target_removal_date: None
# .. toggle_warning: None
# .. toggle_tickets: VAN-1094
ENABLE_2U_RECOMMENDATIONS_ON_DASHBOARD = WaffleFlag(f'{WAFFLE_FLAG_NAMESPACE}.enable_2u_recommendations', __name__)
def should_show_2u_recommendations():
return ENABLE_2U_RECOMMENDATIONS_ON_DASHBOARD.is_enabled()
# Waffle flag to enable course enrollment confirmation email.
# .. toggle_name: student.enable_enrollment_confirmation_email

View File

@@ -18,7 +18,6 @@ from django.views.decorators.csrf import ensure_csrf_cookie
from edx_django_utils import monitoring as monitoring_utils
from edx_django_utils.plugins import get_plugins_view_context
from edx_toggles.toggles import WaffleFlag
from ipware.ip import get_client_ip
from opaque_keys.edx.keys import CourseKey
from openedx_filters.learning.filters import DashboardRenderStarted
from pytz import UTC
@@ -53,7 +52,7 @@ from openedx.features.enterprise_support.api import (
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
from common.djangoapps.student.models import (
@@ -787,9 +786,6 @@ def student_dashboard(request): # lint-amnesty, pylint: disable=too-many-statem
if fbe_is_on:
enrollments_fbe_is_on.append(course_key)
ip_address = get_client_ip(request)[0]
country_code = country_code_from_ip(ip_address).upper()
context = {
'urls': urls,
'programs_data': programs_data,
@@ -844,7 +840,6 @@ def student_dashboard(request): # lint-amnesty, pylint: disable=too-many-statem
'course_info': get_dashboard_course_info(user, course_enrollments),
# 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),
}

View File

@@ -5353,13 +5353,6 @@ OUTCOME_SURVEYS_EVENTS_ENABLED = True
######################## Settings for cancel retirement in Support Tools ########################
COOL_OFF_DAYS = 14
URLS_2U_LOBS = {
'executive_education': 'https://www.edx.org/executive-education',
'masters_degree': 'https://www.edx.org/masters',
'bachelors_degree': 'https://www.edx.org/bachelors',
'boot_camps': 'https://www.edx.org/boot-camps',
}
############ Settings for externally hosted executive education courses ############
EXEC_ED_LANDING_PAGE = "https://www.getsmarter.com/account"

View File

@@ -1,214 +0,0 @@
/* global gettext */
import React from 'react';
class Static2UCallouts extends React.Component {
constructor(props) {
super(props);
this.state = {
show2uLobs: false,
};
}
componentDidMount() {
const optimizely = window["optimizely"] || [];
optimizely.push({
"type": "user",
"attributes": {
"isEnterpriseUser": this.props.isEnterpriseUser.toString(),
}
});
optimizely.push({
type: "page",
pageName: "van_1097_merchandise_2u_lobs_on_dashboard"
});
const experimentId = '22164741776';
this.timer = setTimeout(() => {
const selectedVariant = optimizely.get("state").getVariationMap()[experimentId];
if (selectedVariant?.name === 'dashboard_with_2u_lobs'){
this.setState({
show2uLobs: true,
})
}
}, 500 );
}
componentWillUnmount() {
clearTimeout(this.timer);
}
render() {
return (
this.state.show2uLobs && (
<div className="static-callouts-main">
<div className="static-callouts-header">
<div className="static-callouts-heading">
<h2 className="static-callouts-heading-black">
{gettext('More opportunities for you')}
<h2 className="static-callouts-heading-red">{gettext(' to learn')}</h2>
</h2>
</div>
<p className="static-callouts-subheading">
{gettext('We\'ve added 500+ learning opportunities to create one of the world\'s most '
+ 'comprehensive free-to-degree online learning platforms.')}
</p>
</div>
<div className="static-callouts-cards">
<a
href={`${this.props.executiveEducationUrl}?vanguards_click=execed`}
target="_blank"
rel="noopener noreferrer"
className={
this.props.countryCode !== 'US' ? (
'static-callouts-card static-callouts-card-no-bootcamp'
) : 'static-callouts-card'
}
>
<div className="static-callouts-card-badge">
New
</div>
<h3 className="static-callouts-card-heading">
Executive Education
</h3>
<div className="static-callouts-card-description">
Short courses to develop leadership skills
<svg
width="30"
height="20"
viewBox="0 0 20 20"
fill="none"
xmlns="http://www.w3.org/2000/svg"
role="img"
focusable="false"
aria-hidden="true"
>
<path d="M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8-8-8z" fill="currentColor" />
</svg>
</div>
</a>
<div
className={
this.props.countryCode !== 'US' ? (
'static-callouts-cards-divider static-callouts-cards-divider-no-bootcamp'
) : 'static-callouts-cards-divider'
}
>
<svg viewBox="2 0 25 95">
<path d="M 0 120 l 30 -150" stroke="#EAE6E5" strokeWidth="4" fill="none" />
</svg>
</div>
<a
href={`${this.props.mastersDegreeUrl}?vanguards_click=masters`}
target="_blank"
rel="noopener noreferrer"
className={
this.props.countryCode !== 'US' ? (
'static-callouts-card static-callouts-card-no-bootcamp'
) : 'static-callouts-card'
}
>
<div className="static-callouts-card-badge">
New
</div>
<h3 className="static-callouts-card-heading">
Masters Degrees
</h3>
<div className="static-callouts-card-description">
Online degree programs from top universities
<svg
width="30"
height="20"
viewBox="0 0 20 20"
fill="none"
xmlns="http://www.w3.org/2000/svg"
role="img"
focusable="false"
aria-hidden="true"
>
<path d="M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8-8-8z" fill="currentColor" />
</svg>
</div>
</a>
<div
className={
this.props.countryCode !== 'US' ? (
'static-callouts-cards-divider static-callouts-cards-divider-no-bootcamp'
) : 'static-callouts-cards-divider static-callouts-cards-break'
}
>
<svg viewBox="2 0 25 95">
<path d="M 0 120 l 30 -150" stroke="#EAE6E5" strokeWidth="4" fill="none" />
</svg>
</div>
<a
href={`${this.props.bachelorsDegreeUrl}?vanguards_click=bachelors`}
target="_blank" rel="noopener noreferrer"
className={
this.props.countryCode !== 'US' ? (
'static-callouts-card static-callouts-card-no-bootcamp'
) : 'static-callouts-card'
}
>
<div className="static-callouts-card-badge">
New
</div>
<h3 className="static-callouts-card-heading">
Bachelors Degrees
</h3>
<div className="static-callouts-card-description">
Begin or complete a degree; fully online
<svg
width="30"
height="20"
viewBox="0 0 20 20"
fill="none"
xmlns="http://www.w3.org/2000/svg"
role="img"
focusable="false"
aria-hidden="true"
>
<path d="M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8-8-8z" fill="currentColor" />
</svg>
</div>
</a>
{this.props.countryCode === 'US' && (
<div className="static-callouts-cards-divider">
<svg viewBox="2 0 25 95">
<path d="M 0 120 l 30 -150" stroke="#EAE6E5" strokeWidth="4" fill="none" />
</svg>
</div>
)}
{this.props.countryCode === 'US' && (
<a href={`${this.props.bootCampsUrl}?vanguards_click=bootcamps`}
target="_blank"
className="static-callouts-card">
<div className="static-callouts-card-badge">
New
</div>
<h3 className="static-callouts-card-heading">
Boot Camps
</h3>
<div className="static-callouts-card-description">
Intensive, hands-on, project-based training
<svg
width="30"
height="20"
viewBox="0 0 20 20"
fill="none"
xmlns="http://www.w3.org/2000/svg"
role="img"
focusable="false"
aria-hidden="true"
>
<path d="M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8-8-8z" fill="currentColor" />
</svg>
</div>
</a>
)}
</div>
</div>)
);
}
}
export { Static2UCallouts };

View File

@@ -102,7 +102,6 @@ module.exports = Merge.smart({
DemographicsCollectionModal: './lms/static/js/demographics_collection/DemographicsCollectionModal.jsx',
AxiosJwtTokenService: './lms/static/js/jwt_auth/AxiosJwtTokenService.js',
EnterpriseLearnerPortalModal: './lms/static/js/learner_dashboard/EnterpriseLearnerPortalModal.jsx',
Static2UCallouts: './lms/static/js/learner_dashboard/Static2UCallouts.jsx',
// Learner Dashboard
EntitlementFactory: './lms/static/js/learner_dashboard/course_entitlement_factory.js',