@@ -146,21 +139,17 @@ function OutlineTab({ intl }) {
/>
- { /** [MM-P2P] Experiment (the conditional) */ }
- { !MMP2P.state.isEnabled
- && (
-
- )}
- {isSelfPaced && hasDeadlines && !MMP2P.state.isEnabled && (
+
+ {isSelfPaced && hasDeadlines && (
<>
@@ -203,28 +192,20 @@ function OutlineTab({ intl }) {
/>
)}
- { /** [MM-P2P] Experiment (conditional) */ }
- { MMP2P.state.isEnabled
- ?
- : (
-
- )}
-
+
)}
diff --git a/src/course-home/outline-tab/widgets/CourseDates.jsx b/src/course-home/outline-tab/widgets/CourseDates.jsx
index fbce0955..5604e00a 100644
--- a/src/course-home/outline-tab/widgets/CourseDates.jsx
+++ b/src/course-home/outline-tab/widgets/CourseDates.jsx
@@ -1,6 +1,5 @@
import React from 'react';
import { useSelector } from 'react-redux';
-import PropTypes from 'prop-types';
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
@@ -10,8 +9,6 @@ import { useModel } from '../../../generic/model-store';
function CourseDates({
intl,
- /** [MM-P2P] Experiment */
- mmp2p,
}) {
const {
courseId,
@@ -40,8 +37,6 @@ function CourseDates({
key={courseDateBlock.title + courseDateBlock.date}
dateBlock={courseDateBlock}
userTimezone={userTimezone}
- /** [MM-P2P] Experiment */
- mmp2p={mmp2p}
/>
))}
@@ -55,13 +50,6 @@ function CourseDates({
CourseDates.propTypes = {
intl: intlShape.isRequired,
- /** [MM-P2P] Experiment */
- mmp2p: PropTypes.shape({}),
-};
-
-CourseDates.defaultProps = {
- /** [MM-P2P] Experiment */
- mmp2p: {},
};
export default injectIntl(CourseDates);
diff --git a/src/courseware/course/Course.jsx b/src/courseware/course/Course.jsx
index ed8cec28..480bf8a5 100644
--- a/src/courseware/course/Course.jsx
+++ b/src/courseware/course/Course.jsx
@@ -18,9 +18,6 @@ import SidebarTriggers from './sidebar/SidebarTriggers';
import { useModel } from '../../generic/model-store';
import { getSessionStorage, setSessionStorage } from '../../data/sessionStorage';
-/** [MM-P2P] Experiment */
-import { initCoursewareMMP2P, MMP2PBlockModal } from '../../experiments/mm-p2p';
-
function Course({
courseId,
sequenceId,
@@ -71,9 +68,6 @@ function Course({
}
}
- /** [MM-P2P] Experiment */
- const MMP2P = initCoursewareMMP2P(courseId, sequenceId, unitId);
-
return (
@@ -86,8 +80,6 @@ function Course({
sequenceId={sequenceId}
isStaff={isStaff}
unitId={unitId}
- //* * [MM-P2P] Experiment */
- mmp2p={MMP2P}
/>
{shouldDisplayTriggers && (
@@ -102,8 +94,6 @@ function Course({
unitNavigationHandler={unitNavigationHandler}
nextSequenceHandler={nextSequenceHandler}
previousSequenceHandler={previousSequenceHandler}
- //* * [MM-P2P] Experiment */
- mmp2p={MMP2P}
/>
setWeeklyGoalCelebrationOpen(false)}
/>
- { /** [MM-P2P] Experiment */ }
- { MMP2P.meta.modalLock && }
);
}
diff --git a/src/courseware/course/CourseBreadcrumbs.jsx b/src/courseware/course/CourseBreadcrumbs.jsx
index 3e30be12..a90aff5f 100644
--- a/src/courseware/course/CourseBreadcrumbs.jsx
+++ b/src/courseware/course/CourseBreadcrumbs.jsx
@@ -8,8 +8,6 @@ import { useSelector } from 'react-redux';
import { SelectMenu } from '@edx/paragon';
import { Link } from 'react-router-dom';
import { useModel, useModels } from '../../generic/model-store';
-/** [MM-P2P] Experiment */
-import { MMP2PFlyoverTrigger } from '../../experiments/mm-p2p';
import JumpNavMenuItem from './JumpNavMenuItem';
function CourseBreadcrumb({
@@ -87,8 +85,6 @@ export default function CourseBreadcrumbs({
sequenceId,
unitId,
isStaff,
- /** [MM-P2P] Experiment */
- mmp2p,
}) {
const course = useModel('coursewareMeta', courseId);
const courseStatus = useSelector(state => state.courseware.courseStatus);
@@ -152,10 +148,6 @@ export default function CourseBreadcrumbs({
isStaff={isStaff}
/>
))}
- {/** [MM-P2P] Experiment */}
- {mmp2p.state && mmp2p.state.isEnabled && (
-
- )}
);
@@ -167,12 +159,6 @@ CourseBreadcrumbs.propTypes = {
sequenceId: PropTypes.string,
unitId: PropTypes.string,
isStaff: PropTypes.bool,
- /** [MM-P2P] Experiment */
- mmp2p: PropTypes.shape({
- state: PropTypes.shape({
- isEnabled: PropTypes.bool.isRequired,
- }),
- }),
};
CourseBreadcrumbs.defaultProps = {
@@ -180,6 +166,4 @@ CourseBreadcrumbs.defaultProps = {
sequenceId: null,
unitId: null,
isStaff: null,
- /** [MM-P2P] Experiment */
- mmp2p: {},
};
diff --git a/src/courseware/course/sequence/Sequence.jsx b/src/courseware/course/sequence/Sequence.jsx
index b326c463..73738256 100644
--- a/src/courseware/course/sequence/Sequence.jsx
+++ b/src/courseware/course/sequence/Sequence.jsx
@@ -26,10 +26,6 @@ import HiddenAfterDue from './hidden-after-due';
import { SequenceNavigation, UnitNavigation } from './sequence-navigation';
import SequenceContent from './SequenceContent';
-/** [MM-P2P] Experiment */
-import { isMobile } from '../../../experiments/mm-p2p/utils';
-import { MMP2PFlyover, MMP2PFlyoverMobile } from '../../../experiments/mm-p2p';
-
function Sequence({
unitId,
sequenceId,
@@ -38,7 +34,6 @@ function Sequence({
nextSequenceHandler,
previousSequenceHandler,
intl,
- mmp2p,
}) {
const course = useModel('coursewareMeta', courseId);
const {
@@ -155,8 +150,6 @@ function Sequence({
sequenceId={sequenceId}
unitId={unitId}
className="mb-4"
- /** [MM-P2P] Experiment */
- mmp2p={mmp2p}
nextSequenceHandler={() => {
logEvent('edx.ui.lms.sequence.next_selected', 'top');
handleNext();
@@ -180,8 +173,6 @@ function Sequence({
sequenceId={sequenceId}
unitId={unitId}
unitLoadedHandler={handleUnitLoaded}
- /** [MM-P2P] Experiment */
- mmp2p={mmp2p}
/>
{unitHasLoaded && (
}
);
}
@@ -105,22 +100,11 @@ SequenceNavigation.propTypes = {
nextSequenceHandler: PropTypes.func.isRequired,
previousSequenceHandler: PropTypes.func.isRequired,
goToCourseExitPage: PropTypes.func.isRequired,
- /** [MM-P2P] Experiment */
- mmp2p: PropTypes.shape({
- state: PropTypes.shape({
- isEnabled: PropTypes.bool.isRequired,
- }),
- }),
};
SequenceNavigation.defaultProps = {
className: null,
unitId: null,
-
- /** [MM-P2P] Experiment */
- mmp2p: {
- state: { isEnabled: false },
- },
};
export default injectIntl(SequenceNavigation);
diff --git a/src/experiments/mm-p2p/BlockModal.jsx b/src/experiments/mm-p2p/BlockModal.jsx
deleted file mode 100644
index 8fd1d8de..00000000
--- a/src/experiments/mm-p2p/BlockModal.jsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import React, { Suspense } from 'react';
-
-import { ModalLayer } from '@edx/paragon';
-
-import PageLoading from '../../generic/PageLoading';
-
-const BlockModalContent = React.lazy(() => import('./BlockModalContent'));
-
-export const BlockModal = () => (
-
{}}
- isBlocking
- >
- )}>
-
-
-
-);
-
-export default BlockModal;
diff --git a/src/experiments/mm-p2p/BlockModal.scss b/src/experiments/mm-p2p/BlockModal.scss
deleted file mode 100644
index dc1f8b63..00000000
--- a/src/experiments/mm-p2p/BlockModal.scss
+++ /dev/null
@@ -1,43 +0,0 @@
-.mmp2p-modal-dialog.modal-content {
- padding: 15px;
- border-radius: 0px;
- .mmp2p-block-modal-wrapper {
- background-color: white;
- text-align: left;
- .bullet-list-item {
- font-size: 18px;
- line-height: 28px;
- font-weight: 400;
- &:not(:last-child) {
- margin-bottom: 20px;
- }
- color: $gray-900;
- .icon-container {
- vertical-align: top;
- display: inline-block;
- margin-right: 7px;
- }
- .bullet-item-content {
- display: inline-block;
- width: calc(100% - 245px);
- }
- }
- .subheader {
- font-size: 18px;
- line-height: 28px;
- font-weight: 500;
- margin-bottom: 15px;
- }
- img.certificate-image {
- position: absolute;
- top: 32px;
- right: 32px;
- width: 184px;
- }
- #mmp2p-modal-explore-btn {
- float: right;
- margin-bottom: 16px;
- margin-right: 16px;
- }
- }
-}
diff --git a/src/experiments/mm-p2p/BlockModalContent.jsx b/src/experiments/mm-p2p/BlockModalContent.jsx
deleted file mode 100644
index 02b6573a..00000000
--- a/src/experiments/mm-p2p/BlockModalContent.jsx
+++ /dev/null
@@ -1,78 +0,0 @@
-import React from 'react';
-import PropTypes from 'prop-types';
-import { Button, ModalLayer } from '@edx/paragon';
-import CertImage from '../../generic/assets/edX_certificate.png';
-
-const BulletList = ({ children }) => (
-
-);
-BulletList.propTypes = {
- children: PropTypes.node.isRequired,
-};
-
-export const BlockModal = () => (
-
{}}
- isBlocking
- >
-
-
-
- Deadline to access full course has passed
-
-
- What does the Verified Track get you?
-
-
-
-
- Earn a verified certificate of completion to showcase on your resumé
-
-
- Unlock unlimited access to all course content and activities,
- including graded assignments, even after the course ends.
-
-
- Support our mission at edx
-
-
-
-

-
-
-
-
-
-);
-
-export default BlockModal;
diff --git a/src/experiments/mm-p2p/Flyover.jsx b/src/experiments/mm-p2p/Flyover.jsx
deleted file mode 100644
index 69314ab2..00000000
--- a/src/experiments/mm-p2p/Flyover.jsx
+++ /dev/null
@@ -1,83 +0,0 @@
-/* eslint-disable no-use-before-define */
-import React from 'react';
-import PropTypes from 'prop-types';
-import classNames from 'classnames';
-
-import Sidecard from './Sidecard';
-
-const Flyover = ({
- isStatic,
- options,
-}) => {
- const handleHideFlyoverKeyPress = (event) => {
- if (event.key === 'Enter') {
- options.flyover.toggle();
- }
- };
- if (!options.access.isAudit || options.state.afterUpgradeDeadline) {
- return null;
- }
- return (
-
- { !isStatic && (
-
-
Notifications
-
-
-
-
-
- )}
-
-
- );
-};
-Flyover.propTypes = {
- isStatic: PropTypes.bool,
- options: PropTypes.shape({
- access: PropTypes.shape({
- isAudit: PropTypes.bool.isRequired,
- }),
- flyover: PropTypes.shape({
- toggle: PropTypes.func.isRequired,
- }),
- state: PropTypes.shape({
- afterUpgradeDeadline: PropTypes.bool.isRequired,
- }),
- }),
-};
-
-Flyover.defaultProps = {
- isStatic: false,
- options: {
- access: {
- isAudit: false,
- },
- flyover: {
- toggle: () => {},
- },
- state: {
- afterUpgradeDeadline: false,
- },
- },
-};
-
-export default Flyover;
diff --git a/src/experiments/mm-p2p/Flyover.scss b/src/experiments/mm-p2p/Flyover.scss
deleted file mode 100644
index 33b0a29e..00000000
--- a/src/experiments/mm-p2p/Flyover.scss
+++ /dev/null
@@ -1,38 +0,0 @@
-@media only screen and (min-width: 600px) {
- .mmp2p-flyover {
- min-width: 315px !important;
- h4 {
- font-size: 16px;
- }
- }
-}
-.mmp2p-flyover {
- &:not(.static) {
- height: 100% !important;
- height: 393px;
- }
- &.static {
- margin-bottom: 20px;
- }
- border: solid 1px #e1dddb;
- width: 330px;
- vertical-align: top;
- margin-left: 20px;
- padding: 0 20px 20px 20px;
- .mmp2p-notification-div {
- margin: 0 -20px 0px;
- padding: 9px 20px 0;
- font-size: 16px;
- }
- .mmp2p-notification-block {
- height: 9px;
- background: #F9F9F9;
- margin: 7px -20px 0;
- border-top: 1px solid rgb(225, 221, 219);
- border-bottom: 1px solid rgb(225, 221, 219);
- }
- svg.mmp2p-flyover-icon {
- float: right;
- margin-top: 5.5px;
- }
-}
diff --git a/src/experiments/mm-p2p/FlyoverMobile.jsx b/src/experiments/mm-p2p/FlyoverMobile.jsx
deleted file mode 100644
index e3c3f794..00000000
--- a/src/experiments/mm-p2p/FlyoverMobile.jsx
+++ /dev/null
@@ -1,86 +0,0 @@
-/* eslint-disable no-use-before-define */
-import React from 'react';
-import PropTypes from 'prop-types';
-
-import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faChevronLeft } from '@fortawesome/free-solid-svg-icons';
-
-import Sidecard from './Sidecard';
-
-export const FlyoverMobile = ({ options }) => {
- const {
- access: { isAudit },
- flyover: { toggle },
- state: { afterUpgradeDeadline },
- } = options;
-
- const handleReturnSpanKeyPress = (event) => {
- if (event.key === 'Enter') {
- toggle();
- }
- };
-
- if (!isAudit || afterUpgradeDeadline) {
- return null;
- }
-
- return (
-
-
-
-
-
- Back to course
-
-
-
-
-
- Notifications
-
-
-
-
-
-
- );
-};
-FlyoverMobile.propTypes = {
- options: PropTypes.shape({
- access: PropTypes.shape({
- isAudit: PropTypes.bool.isRequired,
- }),
- flyover: PropTypes.shape({
- toggle: PropTypes.func.isRequired,
- }),
- state: PropTypes.shape({
- afterUpgradeDeadline: PropTypes.bool.isRequired,
- }),
- }),
-};
-
-FlyoverMobile.defaultProps = {
- options: {
- access: {
- isAudit: false,
- },
- flyover: {
- toggle: () => {},
- },
- state: {
- afterUpgradeDeadline: false,
- },
- },
-};
-
-export default FlyoverMobile;
diff --git a/src/experiments/mm-p2p/FlyoverMobile.scss b/src/experiments/mm-p2p/FlyoverMobile.scss
deleted file mode 100644
index 78d70ce0..00000000
--- a/src/experiments/mm-p2p/FlyoverMobile.scss
+++ /dev/null
@@ -1,37 +0,0 @@
-.mmp2p-flyover-mobile {
- vertical-align: top;
- padding: 0 20px 20px 20px;
- position: fixed;
- background-color: white;
- z-index: 1;
- height: 100%;
- width: 100%;
- top: 0;
- left: 0;
-
- .mmp2p-mobile-return-div {
- margin: 0 -20px;
- padding: 9px 20px 15px;
- font-size: 16px;
- border-bottom: 1px solid rgb(225, 221, 219);
- }
- .mmp2p-mobile-return-span {
- color: #00262B;
- cursor: pointer;
- }
- .mmp2p-notification-div {
- margin: 0 -20px 15px;
- padding: 9px 20px 0;
- font-size: 16px;
- }
- .mmp2p-notification-span {
- color: #00262B;
- }
- .mmp2p-notification-block {
- height: 9px;
- background: #F9F9F9;
- margin: 7px -20px 0;
- border-top: 1px solid rgb(225, 221, 219);
- border-bottom: 1px solid rgb(225, 221, 219);
- }
-}
diff --git a/src/experiments/mm-p2p/FlyoverTrigger.jsx b/src/experiments/mm-p2p/FlyoverTrigger.jsx
deleted file mode 100644
index dd23e57e..00000000
--- a/src/experiments/mm-p2p/FlyoverTrigger.jsx
+++ /dev/null
@@ -1,58 +0,0 @@
-/* eslint-disable no-use-before-define */
-import React from 'react';
-import PropTypes from 'prop-types';
-import classNames from 'classnames';
-
-import FlyoverTriggerIcon from './FlyoverTriggerIcon';
-import { isMobile } from './utils';
-
-export const FlyoverTrigger = ({ options }) => {
- const { isVisible, toggle } = options.flyover;
- if (!options.access.isAudit || options.state.afterUpgradeDeadline) {
- return null;
- }
- return (!isMobile() && (
-
-
-
- ));
-};
-
-FlyoverTrigger.propTypes = {
- options: PropTypes.shape({
- access: PropTypes.shape({
- isAudit: PropTypes.bool.isRequired,
- }),
- flyover: PropTypes.shape({
- isVisible: PropTypes.bool.isRequired,
- toggle: PropTypes.func.isRequired,
- }),
- state: PropTypes.shape({
- afterUpgradeDeadline: PropTypes.bool.isRequired,
- isEnabled: PropTypes.bool.isRequired,
- }),
- }),
-};
-
-FlyoverTrigger.defaultProps = {
- options: {
- access: { isAudit: false },
- flyover: {
- isVisible: false,
- toggle: () => {},
- },
- state: {
- afterUpgradeDeadline: false,
- isEnabled: false,
- },
- },
-};
-
-export default FlyoverTrigger;
diff --git a/src/experiments/mm-p2p/FlyoverTrigger.scss b/src/experiments/mm-p2p/FlyoverTrigger.scss
deleted file mode 100644
index 76f06e99..00000000
--- a/src/experiments/mm-p2p/FlyoverTrigger.scss
+++ /dev/null
@@ -1,8 +0,0 @@
-.mmp2p-toggle-flyover-button {
- margin-left: auto;
- margin-top: 0px !important;
- border-bottom: none;
- &.flyover-visible {
- border-bottom: 2px solid #00262b;
- }
-}
diff --git a/src/experiments/mm-p2p/FlyoverTriggerIcon.jsx b/src/experiments/mm-p2p/FlyoverTriggerIcon.jsx
deleted file mode 100644
index 66ec5ac7..00000000
--- a/src/experiments/mm-p2p/FlyoverTriggerIcon.jsx
+++ /dev/null
@@ -1,48 +0,0 @@
-/* eslint-disable no-use-before-define */
-import React from 'react';
-
-const FlyoverTriggerIcon = () => (
-
-);
-
-export default FlyoverTriggerIcon;
diff --git a/src/experiments/mm-p2p/FlyoverTriggerMobile.jsx b/src/experiments/mm-p2p/FlyoverTriggerMobile.jsx
deleted file mode 100644
index 327ff54b..00000000
--- a/src/experiments/mm-p2p/FlyoverTriggerMobile.jsx
+++ /dev/null
@@ -1,54 +0,0 @@
-/* eslint-disable no-use-before-define */
-import React from 'react';
-import PropTypes from 'prop-types';
-import classNames from 'classnames';
-
-import FlyoverTriggerIcon from './FlyoverTriggerIcon';
-import { isMobile } from './utils';
-
-const FlyoverTriggerMobile = ({ options }) => {
- const { isVisible, toggle } = options.flyover;
- if (!options.access.isAudit || options.state.afterUpgradeDeadline) {
- return null;
- }
- return (isMobile() && (
-
-
-
- ));
-};
-
-FlyoverTriggerMobile.propTypes = {
- options: PropTypes.shape({
- access: PropTypes.shape({
- isAudit: PropTypes.bool.isRequired,
- }),
- flyover: PropTypes.shape({
- isVisible: PropTypes.bool.isRequired,
- toggle: PropTypes.func.isRequired,
- }),
- state: PropTypes.shape({
- afterUpgradeDeadline: PropTypes.bool.isRequired,
- }),
- }),
-};
-
-FlyoverTriggerMobile.defaultProps = {
- options: {
- access: { isAudit: false },
- flyover: {
- isVisible: true,
- toggle: () => {},
- },
- state: { afterUpgradeDeadline: false },
- },
-};
-
-export default FlyoverTriggerMobile;
diff --git a/src/experiments/mm-p2p/FlyoverTriggerMobile.scss b/src/experiments/mm-p2p/FlyoverTriggerMobile.scss
deleted file mode 100644
index 1d073460..00000000
--- a/src/experiments/mm-p2p/FlyoverTriggerMobile.scss
+++ /dev/null
@@ -1,7 +0,0 @@
-.mmp2p-toggle-flyover-button-mobile {
- border-bottom: none;
- margin-left: 10px !important;
- &.flyover-visible {
- border-bottom: 2px solid #00262b;
- }
-}
diff --git a/src/experiments/mm-p2p/LockPaywall.jsx b/src/experiments/mm-p2p/LockPaywall.jsx
deleted file mode 100644
index 2a7af0fc..00000000
--- a/src/experiments/mm-p2p/LockPaywall.jsx
+++ /dev/null
@@ -1,45 +0,0 @@
-import React, { Suspense } from 'react';
-import PropTypes from 'prop-types';
-
-import PageLoading from '../../generic/PageLoading';
-
-const LockPaywallContent = React.lazy(() => import('./LockPaywallContent'));
-
-const LockPaywall = ({ options }) => {
- if (!(options.meta.gradedLock || options.meta.verifiedLock)) {
- return null;
- }
- return (
-
)}
- >
-
-
- );
-};
-LockPaywall.propTypes = {
- options: PropTypes.shape({
- access: PropTypes.shape({
- upgradeUrl: PropTypes.string.isRequired,
- price: PropTypes.string.isRequired,
- }),
- meta: PropTypes.shape({
- gradedLock: PropTypes.bool.isRequired,
- verifiedLock: PropTypes.bool.isRequired,
- }),
- }),
-};
-
-LockPaywall.defaultProps = {
- options: {
- access: {
- upgradeUrl: '',
- price: '$23',
- },
- meta: {
- gradedLock: false,
- verifiedLock: false,
- },
- },
-};
-export default LockPaywall;
diff --git a/src/experiments/mm-p2p/LockPaywallContent.jsx b/src/experiments/mm-p2p/LockPaywallContent.jsx
deleted file mode 100644
index b4fb741e..00000000
--- a/src/experiments/mm-p2p/LockPaywallContent.jsx
+++ /dev/null
@@ -1,73 +0,0 @@
-import React from 'react';
-import PropTypes from 'prop-types';
-import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faLock } from '@fortawesome/free-solid-svg-icons';
-
-import VerifiedCert from '../../generic/assets/edX_certificate.png';
-
-const LockPaywallContent = ({ options }) => (
-
-
-
-

-
-
-);
-LockPaywallContent.propTypes = {
- options: PropTypes.shape({
- access: PropTypes.shape({
- upgradeUrl: PropTypes.string.isRequired,
- price: PropTypes.string.isRequired,
- }),
- meta: PropTypes.shape({
- gradedLock: PropTypes.bool.isRequired,
- verifiedLock: PropTypes.bool.isRequired,
- }),
- }),
-};
-
-LockPaywallContent.defaultProps = {
- options: {
- access: {
- upgradeUrl: '',
- price: '$23',
- },
- meta: {
- gradedLock: false,
- verifiedLock: false,
- },
- },
-};
-export default LockPaywallContent;
diff --git a/src/experiments/mm-p2p/README.md b/src/experiments/mm-p2p/README.md
deleted file mode 100644
index 5bee8b8f..00000000
--- a/src/experiments/mm-p2p/README.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# What is this experiment?
-This is an experiment updating the audit experience for specific micromasters courses, limiting
-available access to content to the 1st 2 weeks of content, and restricting the upgrade deadline.
-
-# What is the audience?
-All students in a small number of specific Micro-Masters courses
-
-# Who owns it?
-Sapana Thomas and the Masters-Grades team
-
-# Who is responsible for cleaning up this code?
-The Masters-Grades team is on-tap for cleaning up this code at the end of the experiment
diff --git a/src/experiments/mm-p2p/Sidecard.jsx b/src/experiments/mm-p2p/Sidecard.jsx
deleted file mode 100644
index f991f454..00000000
--- a/src/experiments/mm-p2p/Sidecard.jsx
+++ /dev/null
@@ -1,42 +0,0 @@
-import React, { Suspense } from 'react';
-import PropTypes from 'prop-types';
-
-import PageLoading from '../../generic/PageLoading';
-
-const SidecardContent = React.lazy(() => import('./SidecardContent'));
-
-const Sidecard = ({ options }) => (
-
)}
- >
-
-
-);
-
-Sidecard.propTypes = {
- options: PropTypes.shape({
- state: PropTypes.shape({
- upgradeDeadline: PropTypes.string.isRequired,
- }),
- access: PropTypes.shape({
- accessExpirationDate: PropTypes.string.isRequired,
- price: PropTypes.string.isRequired,
- upgradeUrl: PropTypes.string.isRequired,
- }),
- }),
-};
-
-Sidecard.defaultProps = {
- options: {
- state: {
- upgradeDeadline: 'Mar 29, 2021 11:59 PM EST',
- },
- access: {
- accessDeadline: 'Mar 21, 2022 11:59 PM EST',
- price: '$23',
- upgradeUrl: '',
- },
- },
-};
-
-export default Sidecard;
diff --git a/src/experiments/mm-p2p/Sidecard.scss b/src/experiments/mm-p2p/Sidecard.scss
deleted file mode 100644
index a6e46e58..00000000
--- a/src/experiments/mm-p2p/Sidecard.scss
+++ /dev/null
@@ -1,53 +0,0 @@
-.mmp2p-sidecard-wrapper {
- padding-top: 15px;
- .cert-link {
- font-weight: 600;
- color: #00688D;
- text-decoration: 'underline',
- }
- .mmp2p-bullet-list-item {
- .icon-container {
- vertical-align: top;
- display: inline-block;
- margin-right: 7px;
- }
- .bullet-item-content {
- display: inline-block;
- width: calc(100% - 26px);
- }
- svg {
- font-size: 14px;
- margin-right: 5px;
- }
- }
- .mmp2p-sidecard-alert {
- margin-left: -20px;
- margin-right: -20px;
- padding-top: 1rem;
- padding-bottom: 1rem;
- margin-top: 15px;
- line-height: 1;
- background-color: #fffadb;
- color: black;
- font-size: 14px;
- border-radius: 0px !important;
- &.danger {
- background-color: #fcf1f4;
- }
- }
-
- .mmp2p-coupon-code {
- border: solid 1px #e1dddb;
- padding: 20px;
- margin: -21px;
- background: #fbfaf9;
- font-size: 14px;
- text-align: center;
- }
- .verification-sock {
- display: none;
- }
- .alert-info {
- display: none;
- }
-}
diff --git a/src/experiments/mm-p2p/SidecardContent.jsx b/src/experiments/mm-p2p/SidecardContent.jsx
deleted file mode 100644
index 181da2c0..00000000
--- a/src/experiments/mm-p2p/SidecardContent.jsx
+++ /dev/null
@@ -1,173 +0,0 @@
-/* eslint-disable no-use-before-define */
-import React from 'react';
-import PropTypes from 'prop-types';
-import classNames from 'classnames';
-
-const AlertBanner = ({ color, children }) => (
-
- {children}
-
-);
-AlertBanner.propTypes = {
- color: PropTypes.string.isRequired,
- children: PropTypes.node.isRequired,
-};
-
-const localizeTime = (date) => date.toLocaleTimeString(
- 'en-US',
- {
- hour: '2-digit', minute: 'numeric', hour12: true, timeZoneName: 'short',
- },
-);
-const localizeDate = (date) => date.toLocaleDateString(
- 'en-US',
- { month: 'long', day: 'numeric' },
-);
-
-const BulletList = ({ children }) => (
-
-);
-BulletList.propTypes = {
- children: PropTypes.node.isRequired,
-};
-
-const Sidecard = ({
- options: {
- state: { upgradeDeadline },
- access: { accessExpirationDate, price, upgradeUrl },
- },
-}) => {
- const dates = {
- upgradeDeadline: new Date(upgradeDeadline),
- accessExpirationDate: new Date(accessExpirationDate),
- now: new Date(),
- };
- const upgradeDeadlineTime = localizeTime(dates.upgradeDeadline);
- const upgradeDeadlineDate = localizeDate(dates.upgradeDeadline);
- const daysUntilDeadline = parseInt((dates.upgradeDeadline - dates.now) / (1000 * 60 * 60 * 24), 10);
- const hoursUntilDeadline = parseInt((dates.upgradeDeadline - dates.now) / (1000 * 60 * 60), 10);
-
- const accessDeadlineDate = localizeDate(dates.accessExpirationDate);
-
- const certLink = (
-
-
- verified certificate
-
-
- );
-
- return (
-
-
- Unlock the full course by {upgradeDeadlineDate} at {upgradeDeadlineTime}
-
-
-
= 7 ? 'yellow' : 'red'}>
- {(daysUntilDeadline > 1) && `${daysUntilDeadline} days left`}
- {(daysUntilDeadline === 1) && '1 day left'}
- {(daysUntilDeadline < 1 && hoursUntilDeadline >= 1) && `${hoursUntilDeadline} hours left`}
- {(daysUntilDeadline < 1 && hoursUntilDeadline < 1) && 'Less than one hour left'}
-
-
-
-
- Unlock your access to all course activities, including
- graded assignments
-
-
- Earn a {certLink} of completion to showcase on your resumé
-
-
- Support our mission at edX
-
-
-
-
- You will lose access to the first two weeks of scheduled content on {accessDeadlineDate}.
-
-
-
-
- );
-};
-
-Sidecard.propTypes = {
- options: PropTypes.shape({
- state: PropTypes.shape({
- upgradeDeadline: PropTypes.string.isRequired,
- }),
- access: PropTypes.shape({
- accessExpirationDate: PropTypes.string.isRequired,
- price: PropTypes.string.isRequired,
- upgradeUrl: PropTypes.string.isRequired,
- }),
- }),
-};
-
-const futureDate = (numDays) => {
- const defaultDate = new Date();
- defaultDate.setDate(defaultDate.getDate() + numDays);
- return defaultDate;
-};
-
-Sidecard.defaultProps = {
- options: {
- state: {
- upgradeDeadline: new Date('Mar 29, 2021 11:59 PM EST'),
- },
- access: {
- accessDeadline: futureDate(24),
- price: '$23',
- upgradeUrl: '',
- },
- },
-};
-
-export default Sidecard;
diff --git a/src/experiments/mm-p2p/index.jsx b/src/experiments/mm-p2p/index.jsx
deleted file mode 100644
index 3b1450cb..00000000
--- a/src/experiments/mm-p2p/index.jsx
+++ /dev/null
@@ -1,272 +0,0 @@
-import { useState } from 'react';
-import { useDispatch } from 'react-redux';
-
-import { useModel } from '../../generic/model-store';
-
-import MMP2PBlockModal from './BlockModal';
-import MMP2PFlyover from './Flyover';
-import MMP2PFlyoverMobile from './FlyoverMobile';
-import MMP2PFlyoverTrigger from './FlyoverTrigger';
-import MMP2PFlyoverTriggerMobile from './FlyoverTriggerMobile';
-import MMP2PLockPaywall from './LockPaywall';
-import MMP2PSidecard from './Sidecard';
-
-import { isMobile, StrictDict } from './utils';
-
-const MMP2PKeys = StrictDict({
- enableFn: 'enable',
- flyoverVisible: 'flyoverVisible',
- state: 'state',
- access: 'access',
- meta: 'meta',
-});
-
-let location;
-const windowKey = (field) => `experiment__mmp2p_${location}_${field}`;
-
-const setWindowVal = (field, val) => {
- window[windowKey(field)] = val;
-};
-
-const windowVal = (field) => window[windowKey(field)];
-const defaultWindowVal = (field, val) => (
- windowVal(field) === undefined ? val : windowVal(field)
-);
-
-const createWindowStateSetter = (stateSetter, key) => (value) => {
- stateSetter(value);
- setWindowVal(key, value);
-};
-
-const externalConfig = {
- runs: [
- {
- upgradeDeadline: 'Mar 29 2021 11:59 PM EST',
- courses: [
- {
- courseRun: 'course-v1:edX+DemoX+Demo_Course',
- subSections: [
- 'block-v1:edX+DemoX+Demo_Course+type@sequential+block@edx_introduction',
- 'block-v1:edX+DemoX+Demo_Course+type@sequential+block@19a30717eff543078a5d94ae9d6c18a5',
- 'block-v1:edX+DemoX+Demo_Course+type@sequential+block@basic_questions',
- 'block-v1:edX+DemoX+Demo_Course+type@sequential+block@simulations',
- 'block-v1:edX+DemoX+Demo_Course+type@sequential+block@graded_simulations',
- 'block-v1:edX+DemoX+Demo_Course+type@sequential+block@175e76c4951144a29d46211361266e0e',
- ],
- },
- ],
- },
- ],
-};
-
-const initDatesMMP2P = () => {
- location = 'dates';
-
- const defaultState = {
- isEnabled: false,
- upgradeDeadline: null,
- };
-
- const [MMP2POptions, setMMP2POptions] = useState(
- defaultWindowVal(MMP2PKeys.state, { ...defaultState }),
- );
-
- setWindowVal(MMP2PKeys.enableFn, (upgradeDeadline) => {
- if (upgradeDeadline === undefined) {
- setMMP2POptions({ ...defaultState });
- } else {
- setMMP2POptions({
- isEnabled: true,
- upgradeDeadline,
- });
- }
- });
-
- return {
- state: MMP2POptions,
- };
-};
-
-const initHomeMMP2P = (courseId) => {
- location = 'home';
-
- const defaultState = {
- isEnabled: false,
- upgradeDeadline: null,
- afterUpgradeDeadline: false,
- };
- const defaultAccess = {
- isAudit: false,
- accessExpirationDate: null,
- upgradeUrl: null,
- price: null,
- };
-
- const [MMP2POptions, _setMMP2POptions] = useState(defaultWindowVal(MMP2PKeys.state, { ...defaultState }));
- const [MMP2PAccess, _setMMP2PAccess] = useState(defaultWindowVal(MMP2PKeys.access, { ...defaultAccess }));
-
- const setMMP2POptions = createWindowStateSetter(_setMMP2POptions, MMP2PKeys.state);
- const setMMP2PAccess = createWindowStateSetter(_setMMP2PAccess, MMP2PKeys.access);
-
- const { accessExpiration, verifiedMode } = useModel('outline', courseId);
-
- const loadAccess = () => {
- if (accessExpiration !== null && accessExpiration !== undefined) {
- setMMP2PAccess({
- isAudit: true,
- accessExpirationDate: accessExpiration.expirationDate,
- upgradeUrl: accessExpiration.upgradeUrl,
- price: ((verifiedMode !== null && verifiedMode !== undefined)
- ? `${verifiedMode.currencySymbol}${verifiedMode.price}`
- : ''
- ),
- });
- }
- };
-
- const enableFunction = (upgradeDeadline) => {
- if (upgradeDeadline === undefined) {
- setMMP2POptions({ ...defaultState });
- setMMP2PAccess({ ...defaultAccess });
- } else {
- setMMP2POptions({
- isEnabled: true,
- upgradeDeadline,
- afterUpgradeDeadline: new Date() > new Date(upgradeDeadline),
- });
- loadAccess();
- }
- };
-
- setWindowVal(MMP2PKeys.enableFn, enableFunction);
-
- return {
- state: MMP2POptions,
- access: MMP2PAccess,
- };
-};
-
-const initCoursewareMMP2P = (courseId, sequenceId, unitId) => {
- location = 'course';
-
- const defaultState = {
- isEnabled: false,
- upgradeDeadline: null,
- afterUpgradeDeadline: false,
- subSections: [],
- isWhitelisted: false,
- };
- const defaultAccess = {
- isAudit: false,
- accessExpirationDate: null,
- upgradeUrl: null,
- price: null,
- };
- const defaultMeta = {
- blockContent: false,
- gradedLock: false,
- modalLock: false,
- showLock: false,
- verifiedLock: false,
- };
-
- const [MMP2POptions, _setMMP2POptions] = useState(defaultWindowVal(MMP2PKeys.state, { ...defaultState }));
- const [MMP2PAccess, _setMMP2PAccess] = useState(defaultWindowVal(MMP2PKeys.access, { ...defaultAccess }));
- const [MMP2PMeta, _setMMP2PMeta] = useState(defaultWindowVal(MMP2PKeys.meta, { ...defaultMeta }));
- const [MMP2PIsFlyoverVisible, setMMP2PIsFlyoverVisible] = useState(
- defaultWindowVal(MMP2PKeys.flyoverVisible, !isMobile()),
- );
-
- const setMMP2POptions = createWindowStateSetter(_setMMP2POptions, MMP2PKeys.state);
- const setMMP2PAccess = createWindowStateSetter(_setMMP2PAccess, MMP2PKeys.access);
- const setMMP2PMeta = createWindowStateSetter(_setMMP2PMeta, MMP2PKeys.meta);
-
- const flyover = {
- isVisible: MMP2PIsFlyoverVisible,
- toggle: () => {
- setMMP2PIsFlyoverVisible(!MMP2PIsFlyoverVisible);
- setWindowVal(MMP2PKeys.flyoverVisible, !MMP2PIsFlyoverVisible);
- },
- };
-
- const loadOptions = (upgradeDeadline, subSections) => (dispatch, getState) => {
- const state = getState();
-
- const options = {
- isEnabled: true,
- upgradeDeadline,
- afterUpgradeDeadline: new Date() > new Date(upgradeDeadline),
- isWhitelisted: subSections.indexOf(sequenceId) > -1,
- };
- setMMP2POptions(options);
-
- const models = {
- coursewareMeta: state.models.coursewareMeta[courseId],
- courseHomeMeta: state.models.courseHomeMeta[courseId],
- units: state.models.units[unitId],
- };
- const { accessExpiration } = models.coursewareMeta;
- const { verifiedMode } = models.courseHomeMeta;
- const graded = models.units !== undefined ? models.units.graded : false;
-
- let access = {};
- if (accessExpiration !== null && accessExpiration !== undefined) {
- access = {
- isAudit: true,
- accessExpirationDate: accessExpiration.expirationDate,
- upgradeUrl: accessExpiration.upgradeUrl,
- price: ((verifiedMode !== null && verifiedMode !== undefined)
- ? `${verifiedMode.currencySymbol}${verifiedMode.price}`
- : ''
- ),
- };
- setMMP2PAccess(access);
- }
- const meta = {
- verifiedLock: (access.isAudit && !options.isWhitelisted),
- gradedLock: (access.isAudit && options.isWhitelisted && graded),
- modalLock: (access.isAudit && !options.isWhitelisted && options.afterUpgradeDeadline),
- };
- meta.showLock = (options.isEnabled && (meta.verifiedLock || meta.gradedLock));
- meta.blockContent = (options.isEnabled && meta.verifiedLock);
- setMMP2PMeta(meta);
- };
-
- const dispatch = useDispatch();
- const enableFunction = (upgradeDeadline, subSections) => {
- if (subSections.length !== undefined && subSections.length > 0) {
- dispatch(loadOptions(upgradeDeadline, subSections));
- } else {
- setMMP2POptions({ ...defaultState });
- setMMP2PAccess({ ...defaultAccess });
- setMMP2PMeta({ ...defaultMeta });
- }
- };
-
- setWindowVal(MMP2PKeys.enableFn, enableFunction);
-
- // testing
- setWindowVal('externalConfig', externalConfig);
-
- const config = {
- access: MMP2PAccess,
- flyover,
- meta: MMP2PMeta,
- state: MMP2POptions,
- };
-
- return config;
-};
-
-export {
- MMP2PBlockModal,
- MMP2PFlyover,
- MMP2PFlyoverMobile,
- MMP2PFlyoverTrigger,
- MMP2PFlyoverTriggerMobile,
- MMP2PLockPaywall,
- MMP2PSidecard,
- initCoursewareMMP2P,
- initHomeMMP2P,
- initDatesMMP2P,
-};
diff --git a/src/experiments/mm-p2p/index.scss b/src/experiments/mm-p2p/index.scss
deleted file mode 100644
index 0b278795..00000000
--- a/src/experiments/mm-p2p/index.scss
+++ /dev/null
@@ -1,6 +0,0 @@
-@import "./BlockModal.scss";
-@import "./Flyover.scss";
-@import "./FlyoverMobile.scss";
-@import "./FlyoverTrigger.scss";
-@import "./FlyoverTriggerMobile.scss";
-@import "./Sidecard.scss";
diff --git a/src/experiments/mm-p2p/utils.jsx b/src/experiments/mm-p2p/utils.jsx
deleted file mode 100644
index 4fc097a2..00000000
--- a/src/experiments/mm-p2p/utils.jsx
+++ /dev/null
@@ -1,48 +0,0 @@
-/* eslint-disable no-console */
-import { useContext } from 'react';
-import { AppContext } from '@edx/frontend-platform/react';
-import util from 'util';
-
-export const isMobile = () => {
- const userAgent = typeof window.navigator === 'undefined' ? '' : navigator.userAgent;
- return Boolean(
- userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile|WPDesktop/i),
- );
-};
-
-export const getUser = () => useContext(AppContext).authenticatedUser;
-
-const staticReturnOptions = [
- 'dict',
- 'inspect',
- Symbol.toStringTag,
- util.inspect.custom,
- Symbol.for('nodejs.util.inspect.custom'),
-];
-
-const strictGet = (target, name) => {
- if (name === Symbol.toStringTag) {
- return target;
- }
- if (name === 'length') {
- return target.length;
- }
- if (staticReturnOptions.indexOf(name) >= 0) {
- return target;
- }
- if (name === Symbol.iterator) {
- return { ...target };
- }
-
- if (name in target || name === '_reactFragment') {
- return target[name];
- }
-
- console.log(name.toString());
- console.error({ target, name });
- const e = Error(`invalid property "${name.toString()}"`);
- console.error(e.stack);
- return undefined;
-};
-
-export const StrictDict = (dict) => new Proxy(dict, { get: strictGet });
diff --git a/src/index.scss b/src/index.scss
index 9f1079d4..b91dfa05 100755
--- a/src/index.scss
+++ b/src/index.scss
@@ -377,6 +377,3 @@
@import "course-home/progress-tab/grades/course-grade/GradeBar.scss";
@import "courseware/course/course-exit/CourseRecommendations";
@import "product-tours/newUserCourseHomeTour/NewUserCourseHomeTourModal.scss";
-
-/** [MM-P2P] Experiment */
-@import "experiments/mm-p2p/index.scss";