@@ -20,6 +20,9 @@ var Card_1 = require('material-ui/Card');
2020var RaisedButton_1 = require ( 'material-ui/RaisedButton' ) ;
2121var actions_1 = require ( '../../actions' ) ;
2222var TopPanel_1 = require ( '../TopPanel' ) ;
23+ var error_1 = require ( 'material-ui/svg-icons/alert/error' ) ;
24+ var warning_1 = require ( 'material-ui/svg-icons/alert/warning' ) ;
25+ var colors_1 = require ( 'material-ui/styles/colors' ) ;
2326var styles = {
2427 card : {
2528 margin : '10px' ,
@@ -41,9 +44,14 @@ var TutorialPublish = (function (_super) {
4144 } ;
4245 TutorialPublish . prototype . componentDidMount = function ( ) {
4346 TopPanel_1 . topElement . toggle ( false ) ;
47+ this . validate ( ) ;
48+ } ;
49+ TutorialPublish . prototype . validate = function ( ) {
50+ this . props . pjLoad ( ) ;
51+ this . props . validatePj ( ) ;
4452 } ;
4553 TutorialPublish . prototype . render = function ( ) {
46- var _a = this . props , validation = _a . validation , validatePj = _a . validatePj ;
54+ var validation = this . props . validation ;
4755 return ( React . createElement ( Card_1 . Card , { style : styles . card } ,
4856 React . createElement ( Card_1 . CardHeader , { title : 'Tutorial Info' } ) ,
4957 React . createElement ( Table_1 . Table , { fixedHeader : true , selectable : false } ,
@@ -55,20 +63,24 @@ var TutorialPublish = (function (_super) {
5563 ) ,
5664 React . createElement ( Table_1 . TableBody , { displayRowCheckbox : false } ,
5765 validation . errors . map ( function ( field , index ) { return ( React . createElement ( Table_1 . TableRow , { key : index } ,
58- React . createElement ( Table_1 . TableRowColumn , null , "Error" ) ,
66+ React . createElement ( Table_1 . TableRowColumn , null ,
67+ React . createElement ( error_1 . default , { color : colors_1 . pink500 } )
68+ ) ,
5969 React . createElement ( Table_1 . TableRowColumn , null , field . name ) ,
6070 React . createElement ( Table_1 . TableRowColumn , null , field . example ) ) ) ; } ) ,
6171 validation . warnings . map ( function ( field , index ) { return ( React . createElement ( Table_1 . TableRow , { key : index } ,
62- React . createElement ( Table_1 . TableRowColumn , null , "Warning" ) ,
72+ React . createElement ( Table_1 . TableRowColumn , null ,
73+ React . createElement ( warning_1 . default , { color : colors_1 . amber500 } )
74+ ) ,
6375 React . createElement ( Table_1 . TableRowColumn , null , field . name ) ,
6476 React . createElement ( Table_1 . TableRowColumn , null , field . example ) ) ) ; } ) ) ) ,
65- React . createElement ( RaisedButton_1 . default , { style : styles . button , label : 'Validate' , primary : true , onTouchTap : validatePj } ) ,
77+ React . createElement ( RaisedButton_1 . default , { style : styles . button , label : 'Validate' , primary : true , onTouchTap : this . validate . bind ( this ) } ) ,
6678 React . createElement ( RaisedButton_1 . default , { style : styles . button , label : 'Publish' , secondary : true , disabled : validation . errors . length === 0 , onTouchTap : function ( ) { return alert ( 'Publish not yet implemented' ) ; } } ) ) ) ;
6779 } ;
6880 TutorialPublish = __decorate ( [
6981 react_redux_1 . connect ( function ( state ) { return ( {
7082 validation : state . validation ,
71- } ) ; } , { pjLoad : actions_1 . pjLoad , pjSave : actions_1 . pjSave , editorPjOpen : actions_1 . editorPjOpen , validatePj : actions_1 . validatePj } ) ,
83+ } ) ; } , { pjLoad : actions_1 . pjLoad , editorPjOpen : actions_1 . editorPjOpen , validatePj : actions_1 . validatePj } ) ,
7284 __metadata ( 'design:paramtypes' , [ ] )
7385 ] , TutorialPublish ) ;
7486 return TutorialPublish ;
0 commit comments