Code coverage report for src/flux/task-plan-stats.coffee

Statements: 66.67% (8 / 12)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 66.67% (8 / 12)      Ignored: none     

All files » src/flux/ » task-plan-stats.coffee
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                                                    
var CrudConfig, PeriodHelper, TaskPlanStatsConfig, _, actions, extendConfig, makeSimpleStore, ref, ref1, store;
 
ref = require('./helpers'), CrudConfig = ref.CrudConfig, makeSimpleStore = ref.makeSimpleStore, extendConfig = ref.extendConfig;
 
_ = require('underscore');
 
PeriodHelper = require('../helpers/period');
 
TaskPlanStatsConfig = {
  exports: {
    getPeriods: function(id) {
      var periods, plan;
      plan = this._get(id);
      return periods = _.chain(plan.stats).map(function(stat) {
        return {
          id: stat.period_id,
          name: stat.name,
          is_trouble: stat.is_trouble
        };
      }).tap(PeriodHelper.sort).value();
    }
  }
};
 
extendConfig(TaskPlanStatsConfig, new CrudConfig());
 
ref1 = makeSimpleStore(TaskPlanStatsConfig), actions = ref1.actions, store = ref1.store;
 
module.exports = {
  TaskPlanStatsActions: actions,
  TaskPlanStatsStore: store
};