From fb387c9633cc6303001ba29be47fecbf3ce2abc6 Mon Sep 17 00:00:00 2001 From: Michael Youngstrom Date: Fri, 12 Jan 2018 14:48:00 -0500 Subject: [PATCH] Revert "jaebradley/learner 3600 upsell modal" --- .../static/common/js/components/Carousel.jsx | 127 ------ .../CourseHomeUpsellExperimentModal.jsx | 52 --- .../js/components/UpsellExperimentModal.jsx | 68 --- lms/envs/common.py | 1 - lms/static/sass/_build-lms-v2.scss | 3 - lms/static/sass/_experiments.scss | 400 ------------------ .../course-home-fragment.html | 11 - package.json | 2 - webpack.common.config.js | 2 - 9 files changed, 666 deletions(-) delete mode 100644 common/static/common/js/components/Carousel.jsx delete mode 100644 common/static/common/js/components/CourseHomeUpsellExperimentModal.jsx delete mode 100644 common/static/common/js/components/UpsellExperimentModal.jsx diff --git a/common/static/common/js/components/Carousel.jsx b/common/static/common/js/components/Carousel.jsx deleted file mode 100644 index c7ec8b995a..0000000000 --- a/common/static/common/js/components/Carousel.jsx +++ /dev/null @@ -1,127 +0,0 @@ -import React from 'react'; -import Slider from 'react-slick'; -import classNames from 'classnames'; -import PropTypes from 'prop-types'; - -function NextArrow(props) { - const {currentSlide, slideCount, onClick, displayedSlides} = props; - const showArrow = slideCount - currentSlide > displayedSlides; - const opts = { - className: classNames('js-carousel-nav', 'carousel-arrow', 'next', 'btn btn-secondary', {'active': showArrow}), - onClick - }; - - if (!showArrow) { - opts.disabled = 'disabled'; - } - - return ( - - ); -} - -function PrevArrow(props) { - const {currentSlide, onClick} = props; - const showArrow = currentSlide > 0; - const opts = { - className: classNames('js-carousel-nav', 'carousel-arrow', 'prev', 'btn btn-secondary', {'active': showArrow}), - onClick - }; - - if (!showArrow) { - opts.disabled = 'disabled'; - } - - return ( - - ); -} - -export default class Carousel extends React.Component { - constructor(props) { - super(props); - - this.state = { - // Default to undefined to not focus on page load - activeIndex: undefined, - }; - - this.carousels = []; - - this.afterChange = this.afterChange.bind(this); - this.getCarouselContent = this.getCarouselContent.bind(this); - } - - afterChange(activeIndex) { - this.setState({ activeIndex }); - } - - componentDidUpdate() { - const { activeIndex } = this.state; - - if (!isNaN(activeIndex)) { - this.carousels[activeIndex].focus(); - } - } - - getCarouselContent() { - return this.props.slides.map((slide, i) => { - const firstIndex = this.state.activeIndex || 0; - const lastIndex = firstIndex + this.props.slides.length; - const tabIndex = (firstIndex <= i && i < lastIndex) ? undefined : '-1'; - const carouselLinkProps = { - ref: (item) => { - this.carousels[i] = item; - }, - tabIndex: tabIndex, - className: 'carousel-item' - } - - return ( -
- { slide } -
- ); - }); - } - - render() { - const carouselSettings = { - accessibility: true, - dots: true, - infinite: false, - speed: 500, - className: 'carousel-wrapper', - nextArrow: , - prevArrow: , - afterChange: this.afterChange, - slidesToShow: 1, - slidesToScroll: 1, - initialSlide: 0, - responsive: [ - { - breakpoint: 540, - settings: 'unslick' - } - ] - }; - - return ( - - {this.getCarouselContent()} - - ); - } -} - -Carousel.propTypes = { - slides: PropTypes.array.isRequired -}; diff --git a/common/static/common/js/components/CourseHomeUpsellExperimentModal.jsx b/common/static/common/js/components/CourseHomeUpsellExperimentModal.jsx deleted file mode 100644 index 3cf34f0862..0000000000 --- a/common/static/common/js/components/CourseHomeUpsellExperimentModal.jsx +++ /dev/null @@ -1,52 +0,0 @@ -import React from 'react'; - -import { UpsellExperimentModal } from './UpsellExperimentModal.jsx'; - -// https://openedx.atlassian.net/browse/LEARNER-3583 - -export class CourseHomeUpsellExperimentModal extends React.Component { - constructor(props) { - super(props); - } - - render() { - // This content will be updated in the future - return ( - - My Stats introduces new personalized views that help you track your progress towards completing your course! -

- With My Stats you will see your: -

-

    -
  • Course Activity Streak (log in every week to keep your streak alive)
  • -
  • Grade Progress (see how you're tracking towards a passing grade)
  • -
  • Discussion Forum Engagements (top learners use the forums - how do you measure up?)
  • -
- ), - (
-
Course Activity Streak
-

- Did you know the learners most likely to complete a course log in every week? Let us help you track your weekly streak - log in every week and learn something new! You can also see how many of the other learners in your course logged in this week. -

), - (
-
Grade Progress
-

- Wonder how you're doing in the course so far? We can not only show you all your grades, and how much each assignment is worth, but also upcoming graded assignments. This is a great way to track what you might need to work on for a final exam. -

), - (
-
Discussion engagements
-

- A large percentage of successful learners are engaged on the discussion forums. Compare your forum stats to previous graduates! -

), - ]} - modalTitle="My Stats" - buttonLabel="Upgrade ($100 USD)" - buttonDisplay="Upgrade ($100 USD)" - buttonDestinationURL='https://edx.org' - /> - ) - } -} - diff --git a/common/static/common/js/components/UpsellExperimentModal.jsx b/common/static/common/js/components/UpsellExperimentModal.jsx deleted file mode 100644 index dcd24de90c..0000000000 --- a/common/static/common/js/components/UpsellExperimentModal.jsx +++ /dev/null @@ -1,68 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import { Modal, Button } from '@edx/paragon/static'; - -import Carousel from './Carousel.jsx'; - -// https://openedx.atlassian.net/browse/LEARNER-3583 - -export class UpsellExperimentModal extends React.Component { - constructor(props) { - super(props); - - this.state = { - isOpen: this.props.isOpen, - } - } - - render() { - const { - slides, - modalTitle, - buttonLabel, - buttonDisplay, - buttonDestinationURL, - } = this.props; - const body = ( -
- - -
- ); - return ( - {}} - body={body} - buttons={[ - (