@@ -18,12 +18,12 @@ var react_redux_1 = require('react-redux');
18
18
var Card_1 = require ( 'material-ui/Card' ) ;
19
19
var Tabs_1 = require ( 'material-ui/Tabs' ) ;
20
20
var Task_1 = require ( '../Task' ) ;
21
- var TasksComplete_1 = require ( '../TasksComplete' ) ;
22
21
var Tests_1 = require ( '../Tests' ) ;
23
22
var TaskActions_1 = require ( '../TaskActions' ) ;
24
23
var Hints_1 = require ( '../Hints' ) ;
25
24
var AddButton_1 = require ( '../AddButton' ) ;
26
25
var actions_1 = require ( '../../../actions' ) ;
26
+ var selectors_1 = require ( '../../../selectors' ) ;
27
27
var styles = {
28
28
card : {
29
29
margin : '5px' ,
@@ -54,11 +54,13 @@ var Tasks = (function (_super) {
54
54
}
55
55
Tasks . prototype . render = function ( ) {
56
56
var _this = this ;
57
- var _a = this . props , tasks = _a . tasks , page = _a . page , config = _a . config , taskAdd = _a . taskAdd , markdownOpen = _a . markdownOpen , pagePosition = _a . pagePosition ;
58
- return ( React . createElement ( "div" , null , tasks . map ( function ( task , index ) { return ( React . createElement ( Card_1 . Card , { key : index . toString ( ) , 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 ( "div" , { onClick : markdownOpen . bind ( _this , task . 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 } ) ) ) ;
57
+ var _a = this . props , tasks = _a . tasks , taskAdd = _a . taskAdd , markdownOpen = _a . markdownOpen ;
58
+ return ( React . createElement ( "div" , null , tasks . map ( function ( task , index ) { return ( React . createElement ( Card_1 . Card , { key : index . toString ( ) , 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 } ) ) , 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 ( "div" , { onClick : markdownOpen . bind ( _this , task . 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 } ) ) ) ;
59
59
} ;
60
60
Tasks = __decorate ( [
61
- react_redux_1 . connect ( null , function ( dispatch ) { return ( {
61
+ react_redux_1 . connect ( function ( state ) { return ( {
62
+ tasks : selectors_1 . tasksSelector ( state ) ,
63
+ } ) ; } , function ( dispatch ) { return ( {
62
64
taskAdd : function ( ) { return dispatch ( actions_1 . tutorialTaskAdd ( ) ) ; } ,
63
65
markdownOpen : function ( content ) {
64
66
dispatch ( actions_1 . editorMarkdownOpen ( null , content ) ) ;
0 commit comments