11"use strict" ;
2+ var __extends = ( this && this . __extends ) || function ( d , b ) {
3+ for ( var p in b ) if ( b . hasOwnProperty ( p ) ) d [ p ] = b [ p ] ;
4+ function __ ( ) { this . constructor = d ; }
5+ d . prototype = b === null ? Object . create ( b ) : ( __ . prototype = b . prototype , new __ ( ) ) ;
6+ } ;
7+ var __decorate = ( this && this . __decorate ) || function ( decorators , target , key , desc ) {
8+ var c = arguments . length , r = c < 3 ? target : desc === null ? desc = Object . getOwnPropertyDescriptor ( target , key ) : desc , d ;
9+ if ( typeof Reflect === "object" && typeof Reflect . decorate === "function" ) r = Reflect . decorate ( decorators , target , key , desc ) ;
10+ else for ( var i = decorators . length - 1 ; i >= 0 ; i -- ) if ( d = decorators [ i ] ) r = ( c < 3 ? d ( r ) : c > 3 ? d ( target , key , r ) : d ( target , key ) ) || r ;
11+ return c > 3 && r && Object . defineProperty ( target , key , r ) , r ;
12+ } ;
13+ var __metadata = ( this && this . __metadata ) || function ( k , v ) {
14+ if ( typeof Reflect === "object" && typeof Reflect . metadata === "function" ) return Reflect . metadata ( k , v ) ;
15+ } ;
216var React = require ( 'react' ) ;
17+ var react_redux_1 = require ( 'react-redux' ) ;
318var Card_1 = require ( 'material-ui/Card' ) ;
419var Tabs_1 = require ( 'material-ui/Tabs' ) ;
520var Task_1 = require ( '../Task' ) ;
@@ -8,6 +23,7 @@ var Tests_1 = require('../Tests');
823var TaskActions_1 = require ( '../TaskActions' ) ;
924var Hints_1 = require ( '../Hints' ) ;
1025var AddButton_1 = require ( '../AddButton' ) ;
26+ var actions_1 = require ( '../../../actions' ) ;
1127var styles = {
1228 card : {
1329 margin : '5px' ,
@@ -31,9 +47,24 @@ var styles = {
3147 marginLeft : '10px' ,
3248 } ,
3349} ;
34- var Tasks = function ( _a ) {
35- var tasks = _a . tasks , page = _a . page , config = _a . config ;
36- return ( React . createElement ( "div" , null , tasks . map ( function ( task , index ) { return ( React . createElement ( Card_1 . Card , { style : styles . card , initiallyExpanded : index === 0 } , React . createElement ( Card_1 . CardHeader , { actAsExpander : true , showExpandableButton : true } , React . createElement ( "span" , { style : styles . title } , "Task " , index + 1 ) , React . createElement ( Tests_1 . default , { style : styles . test , tests : task . tests , config : config } ) ) , React . createElement ( Card_1 . CardText , { expandable : true , style : styles . cardContent } , React . createElement ( Tabs_1 . Tabs , { tabItemContainerStyle : styles . tabBar } , React . createElement ( Tabs_1 . Tab , { label : 'Description' } , React . createElement ( Task_1 . default , { key : index . toString ( ) , index : index , task : task } ) ) , React . createElement ( Tabs_1 . Tab , { label : 'Actions' } , React . createElement ( TaskActions_1 . default , { actions : task . actions , taskPosition : index } ) ) , React . createElement ( Tabs_1 . Tab , { label : 'Hints' } , React . createElement ( Hints_1 . default , { hints : task . hints , taskPosition : index } ) ) ) ) ) ) ; } ) , React . createElement ( AddButton_1 . default , null ) , React . createElement ( TasksComplete_1 . default , { page : page } ) ) ) ;
37- } ;
50+ var Tasks = ( function ( _super ) {
51+ __extends ( Tasks , _super ) ;
52+ function Tasks ( ) {
53+ _super . apply ( this , arguments ) ;
54+ }
55+ Tasks . prototype . render = function ( ) {
56+ var _a = this . props , tasks = _a . tasks , page = _a . page , config = _a . config , taskAdd = _a . taskAdd ;
57+ return ( React . createElement ( "div" , null , tasks . map ( function ( task , index ) { return ( React . createElement ( Card_1 . Card , { style : styles . card , initiallyExpanded : index === 0 } , React . createElement ( Card_1 . CardHeader , { actAsExpander : true , showExpandableButton : true } , React . createElement ( "span" , { style : styles . title } , "Task " , index + 1 ) , React . createElement ( Tests_1 . default , { style : styles . test , tests : task . tests , config : config } ) ) , React . createElement ( Card_1 . CardText , { expandable : true , style : styles . cardContent } , React . createElement ( Tabs_1 . Tabs , { tabItemContainerStyle : styles . tabBar } , React . createElement ( Tabs_1 . Tab , { label : 'Description' } , React . createElement ( Task_1 . default , { key : index . toString ( ) , index : index , task : task } ) ) , React . createElement ( Tabs_1 . Tab , { label : 'Actions' } , React . createElement ( TaskActions_1 . default , { actions : task . actions , taskPosition : index } ) ) , React . createElement ( Tabs_1 . Tab , { label : 'Hints' } , React . createElement ( Hints_1 . default , { hints : task . hints , taskPosition : index } ) ) ) ) ) ) ; } ) , React . createElement ( AddButton_1 . default , { callback : taskAdd } ) , React . createElement ( TasksComplete_1 . default , { page : page } ) ) ) ;
58+ } ;
59+ Tasks = __decorate ( [
60+ react_redux_1 . connect ( null , function ( dispatch ) {
61+ return {
62+ taskAdd : function ( ) { return dispatch ( actions_1 . tutorialTaskAdd ( ) ) ; }
63+ } ;
64+ } ) ,
65+ __metadata ( 'design:paramtypes' , [ ] )
66+ ] , Tasks ) ;
67+ return Tasks ;
68+ } ( React . Component ) ) ;
3869Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
3970exports . default = Tasks ;
0 commit comments