@@ -31,20 +31,26 @@ var PublishOptionsModal = (function (_super) {
3131 }
3232 PublishOptionsModal . prototype . publish = function ( type ) {
3333 this . props . tutorialPublish ( type ) ;
34+ this . props . handleClose ( ) ;
3435 } ;
3536 PublishOptionsModal . prototype . render = function ( ) {
37+ var _a = this . props , open = _a . open , handleClose = _a . handleClose , version = _a . version , updated = _a . updated ;
3638 return ( React . createElement ( "div" , null ,
37- React . createElement ( Dialog_1 . default , { title : 'Dialog With Actions' , modal : true , open : this . props . open , onRequestClose : this . props . handleClose } ,
38- "Select version change:" ,
39- React . createElement ( FlatButton_1 . default , { label : 'Patch' , primary : true , disabled : false , onTouchTap : this . publish . bind ( this , 'patch' ) } ) ,
40- React . createElement ( FlatButton_1 . default , { label : 'Minor' , disabled : false , onTouchTap : this . publish . bind ( this , 'minor' ) } ) ,
41- React . createElement ( FlatButton_1 . default , { label : 'Major' , disabled : false , onTouchTap : this . publish . bind ( this , 'major' ) } ) ,
39+ React . createElement ( Dialog_1 . default , { title : "Current Version: " + version , modal : true , open : open , onRequestClose : handleClose } ,
40+ ! updated ? React . createElement ( "p" , null , "Tutorial has not changed." ) : null ,
41+ "Select next version change:" ,
42+ React . createElement ( FlatButton_1 . default , { label : 'Patch' , primary : true , disabled : ! updated , onTouchTap : this . publish . bind ( this , 'patch' ) } ) ,
43+ React . createElement ( FlatButton_1 . default , { label : 'Minor' , disabled : ! updated , onTouchTap : this . publish . bind ( this , 'minor' ) } ) ,
44+ React . createElement ( FlatButton_1 . default , { label : 'Major' , disabled : ! updated , onTouchTap : this . publish . bind ( this , 'major' ) } ) ,
4245 React . createElement ( "br" , null ) ,
43- React . createElement ( RaisedButton_1 . default , { style : styles . cancel , label : 'Cancel' , secondary : true , onTouchTap : this . props . handleClose } ) )
46+ React . createElement ( RaisedButton_1 . default , { style : styles . cancel , label : 'Cancel' , secondary : true , onTouchTap : handleClose } ) )
4447 ) ) ;
4548 } ;
4649 PublishOptionsModal = __decorate ( [
47- react_redux_1 . connect ( null , { tutorialPublish : actions_1 . tutorialPublish } ) ,
50+ react_redux_1 . connect ( function ( state ) { return ( {
51+ version : state . packageJson . version || 'ERROR' ,
52+ updated : state . updated ,
53+ } ) ; } , { tutorialPublish : actions_1 . tutorialPublish } ) ,
4854 __metadata ( 'design:paramtypes' , [ ] )
4955 ] , PublishOptionsModal ) ;
5056 return PublishOptionsModal ;
0 commit comments