Code coverage report for src/components/plan-stats/event.cjsx

Statements: 45.83% (11 / 24)      Branches: 0% (0 / 2)      Functions: 0% (0 / 4)      Lines: 45.83% (11 / 24)      Ignored: none     

All files » src/components/plan-stats/ » event.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 54 55 56 57 58 59 60 61                                                                                                    
var BS, Event, EventModalShell, LoadableItem, Markdown, React, Router, TaskPlanStatsActions, TaskPlanStatsStore, _, ref;
 
React = require('react');
 
_ = require('underscore');
 
BS = require('react-bootstrap');
 
Router = require('react-router');
 
ref = require('../../flux/task-plan-stats'), TaskPlanStatsStore = ref.TaskPlanStatsStore, TaskPlanStatsActions = ref.TaskPlanStatsActions;
 
LoadableItem = require('../loadable-item');
 
Markdown = require('../markdown');
 
Event = React.createClass({displayName: "Event",
  propTypes: {
    id: React.PropTypes.string.isRequired
  },
  render: function() {
    var courseId, description, id, periods, periodsNames, plan, ref1;
    ref1 = this.props, id = ref1.id, courseId = ref1.courseId;
    plan = TaskPlanStatsStore.get(id);
    periods = TaskPlanStatsStore.getPeriods(id);
    periodsNames = _.pluck(periods, 'name').join(', ');
    if (plan.description) {
      description = React.createElement(Markdown, {
        "text": plan.description,
        "block": true
      });
    }
    return React.createElement(BS.Panel, {
      "className": 'reading-stats'
    }, React.createElement("h3", null, "For ", React.createElement("strong", null, periodsNames)), description);
  }
});
 
EventModalShell = React.createClass({displayName: "EventModalShell",
  render: function() {
    var id;
    id = this.props.id;
    return React.createElement(LoadableItem, {
      "id": id,
      "store": TaskPlanStatsStore,
      "actions": TaskPlanStatsActions,
      "renderItem": ((function(_this) {
        return function() {
          return React.createElement(Event, React.__spread({}, _this.props));
        };
      })(this))
    });
  }
});
 
module.exports = {
  EventModalShell: EventModalShell,
  Event: Event
};