@@ -31,7 +31,9 @@ var TutorialInfo = (function (_super) {
3131 __extends ( TutorialInfo , _super ) ;
3232 function TutorialInfo ( props ) {
3333 _super . call ( this , props ) ;
34- this . state = this . props . packageJson ;
34+ this . state = {
35+ pj : this . props . packageJson
36+ } ;
3537 }
3638 TutorialInfo . prototype . handleText = function ( prop , event ) {
3739 this . handleChange ( prop , event . target . value ) ;
@@ -42,18 +44,18 @@ var TutorialInfo = (function (_super) {
4244 TutorialInfo . prototype . handleChange = function ( prop , val ) {
4345 var obj = { } ;
4446 obj [ prop ] = val ;
45- this . setState ( Object . assign ( { } , this . state , obj ) ) ;
47+ this . setState ( { pj : Object . assign ( { } , this . state , obj ) } ) ;
4648 } ;
4749 TutorialInfo . prototype . save = function ( ) {
48- this . props . save ( this . state ) ;
50+ this . props . save ( this . state . pj ) ;
4951 } ;
5052 TutorialInfo . prototype . render = function ( ) {
51- return ( React . createElement ( Card_1 . Card , { style : styles } , React . createElement ( Card_1 . CardHeader , { title : 'Tutorial Info' } ) , React . createElement ( TextField_1 . default , { floatingLabelText : 'Title' , defaultValue : this . state . name , onChange : this . handleText . bind ( this , 'name' ) } ) , React . createElement ( "br" , null ) , React . createElement ( TextField_1 . default , { floatingLabelText : 'Description' , defaultValue : this . state . description , onChange : this . handleText . bind ( this , 'description' ) } ) , React . createElement ( "br" , null ) , React . createElement ( TextField_1 . default , { floatingLabelText : 'Version' , defaultValue : this . state . version . join ( '.' ) , disabled : true , onChange : this . handleText . bind ( this , 'version' ) } ) , React . createElement ( "br" , null ) , React . createElement ( TextField_1 . default , { floatingLabelText : 'Keywords' , defaultValue : this . state . keywords . join ( ', ' ) , multiLine : true , onChange : this . handleText . bind ( this , 'keywords' ) } ) , React . createElement ( "br" , null ) , React . createElement ( RaisedButton_1 . default , { style : buttonStyles , label : 'Save' , primary : true , onTouchTap : this . save . bind ( this ) } ) , React . createElement ( RaisedButton_1 . default , { style : buttonStyles , label : 'Continue' , secondary : true , onTouchTap : this . props . routeToTutorial . bind ( this ) } ) ) ) ;
53+ return ( React . createElement ( Card_1 . Card , { style : styles } , React . createElement ( Card_1 . CardHeader , { title : 'Tutorial Info' } ) , React . createElement ( TextField_1 . default , { floatingLabelText : 'Title' , defaultValue : this . state . pj . name , onChange : this . handleText . bind ( this , 'name' ) } ) , React . createElement ( "br" , null ) , React . createElement ( TextField_1 . default , { floatingLabelText : 'Description' , defaultValue : this . state . pj . description , onChange : this . handleText . bind ( this , 'description' ) } ) , React . createElement ( "br" , null ) , React . createElement ( TextField_1 . default , { floatingLabelText : 'Version' , defaultValue : this . state . pj . version , disabled : true , onChange : this . handleText . bind ( this , 'version' ) } ) , React . createElement ( "br" , null ) , React . createElement ( TextField_1 . default , { floatingLabelText : 'Keywords' , defaultValue : this . state . pj . keywords . join ( ', ' ) , multiLine : true , onChange : this . handleText . bind ( this , 'keywords' ) } ) , React . createElement ( "br" , null ) , React . createElement ( RaisedButton_1 . default , { style : buttonStyles , label : 'Save' , primary : true , onTouchTap : this . save . bind ( this ) } ) , React . createElement ( RaisedButton_1 . default , { style : buttonStyles , label : 'Continue' , secondary : true , onTouchTap : this . props . routeToTutorial . bind ( this ) } ) ) ) ;
5254 } ;
5355 TutorialInfo = __decorate ( [
5456 react_redux_1 . connect ( null , function ( dispatch ) {
5557 return {
56- save : function ( config ) { return dispatch ( tutorialConfigSave ( config ) ) ; } ,
58+ save : function ( pj ) { return dispatch ( actions_1 . pjSave ( pj ) ) ; } ,
5759 routeToTutorial : function ( ) { return dispatch ( actions_1 . routeSet ( 'page' ) ) ; }
5860 } ;
5961 } ) ,
0 commit comments