Code coverage report for src/components/cc-dashboard/chapter.cjsx

Statements: 100% (15 / 15)      Branches: 100% (0 / 0)      Functions: 100% (3 / 3)      Lines: 100% (15 / 15)      Ignored: none     

All files » src/components/cc-dashboard/ » chapter.cjsx
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53                                 37× 38×             37× 37×     37×                            
var BS, CCDashboardStore, ChapterSection, DashboardChapter, React, Section, _, classnames;
 
_ = require('underscore');
 
React = require('react');
 
BS = require('react-bootstrap');
 
classnames = require('classnames');
 
CCDashboardStore = require('../../flux/cc-dashboard').CCDashboardStore;
 
ChapterSection = require('../task-plan/chapter-section');
 
Section = require('./section');
 
DashboardChapter = React.createClass({displayName: "DashboardChapter",
  propTypes: {
    chapter: React.PropTypes.shape({
      id: React.PropTypes.string,
      chapter_section: React.PropTypes.array,
      valid_sections: React.PropTypes.array
    })
  },
  renderSections: function() {
    return _.map(this.props.chapter.valid_sections, function(section, index) {
      return React.createElement(Section, {
        "section": section,
        "key": index
      });
    });
  },
  render: function() {
    var classes;
    classes = classnames('chapter', {
      empty: this.props.chapter.valid_sections
    });
    return React.createElement("div", {
      "className": classes
    }, React.createElement(BS.Row, {
      "className": "name",
      "key": this.props.chapter.id
    }, React.createElement(BS.Col, {
      "xs": 12.
    }, React.createElement(ChapterSection, {
      "section": this.props.chapter.chapter_section
    }), this.props.chapter.title)), this.renderSections());
  }
});
 
module.exports = DashboardChapter;