@@ -39,6 +39,7 @@ var TutorialPublish = (function (_super) {
3939 }
4040 TutorialPublish . prototype . componentWillMount = function ( ) {
4141 this . props . pjLoad ( ) ;
42+ this . props . open ;
4243 } ;
4344 TutorialPublish . prototype . componentDidMount = function ( ) {
4445 var _this = this ;
@@ -60,17 +61,20 @@ var TutorialPublish = (function (_super) {
6061 }
6162 } ;
6263 TutorialPublish . prototype . onSubmit = function ( values ) {
63- var description = values . description , version = values . version , keywords = values . keywords ;
64- this . props . save ( Object . assign ( { } , this . props . packageJson , {
65- description : description , version : version ,
66- keywords : ( keywords . length ? ', ' + keywords : '' ) . split ( ', ' )
64+ var description = values . description , version = values . version , author = values . author , keywords = values . keywords ;
65+ this . props . pjSave ( Object . assign ( { } , this . props . packageJson , {
66+ description : description , version : version , author : author ,
6767 } ) ) ;
6868 } ;
6969 TutorialPublish . prototype . render = function ( ) {
7070 var _a = this . props , pristine = _a . pristine , submitting = _a . submitting , handleSubmit = _a . handleSubmit , invalid = _a . invalid ;
7171 return ( React . createElement ( Card_1 . Card , { style : styles . card } ,
7272 React . createElement ( Card_1 . CardHeader , { title : 'Tutorial Info' } ) ,
7373 React . createElement ( "form" , { onSubmit : handleSubmit ( this . onSubmit . bind ( this ) ) } ,
74+ React . createElement ( redux_form_1 . Field , { name : 'author' , component : textField_1 . default . bind ( null , {
75+ hintText : 'Shawn McKay <my@email.com>' ,
76+ floatingLabelText : 'Author <email>' ,
77+ } ) , tabIndex : '1' } ) ,
7478 React . createElement ( redux_form_1 . Field , { name : 'description' , component : textField_1 . default . bind ( null , {
7579 hintText : 'Tutorial description' ,
7680 floatingLabelText : 'Description' ,
@@ -80,21 +84,13 @@ var TutorialPublish = (function (_super) {
8084 floatingLabelText : 'Version' ,
8185 disabled : true ,
8286 } ) , tabIndex : '2' } ) ,
83- React . createElement ( redux_form_1 . Field , { name : 'keywords' , component : textField_1 . default . bind ( null , {
84- hintText : 'coderoad, react, js, etc' ,
85- floatingLabelText : 'Keywords' ,
86- } ) , tabIndex : '3' } ) ,
8787 React . createElement ( RaisedButton_1 . default , { type : 'submit' , style : styles . button , label : 'Save' , primary : true , disabled : invalid } ) ,
8888 React . createElement ( RaisedButton_1 . default , { style : styles . button , label : 'Publish' , secondary : true , disabled : invalid , onTouchTap : function ( ) { return alert ( 'Publish not yet implemented' ) ; } } ) ) ) ) ;
8989 } ;
9090 TutorialPublish = __decorate ( [
9191 react_redux_1 . connect ( function ( state ) { return ( {
9292 packageJson : state . packageJson ,
93- } ) ; } , function ( dispatch ) { return ( {
94- pjLoad : function ( ) { dispatch ( actions_1 . pjLoad ( ) ) ; } ,
95- save : function ( pj ) { dispatch ( actions_1 . pjSave ( pj ) ) ; } ,
96- routeToTutorial : function ( ) { dispatch ( actions_1 . routeSet ( 'page' ) ) ; }
97- } ) ; } ) ,
93+ } ) ; } , { pjLoad : actions_1 . pjLoad , pjSave : actions_1 . pjSave } ) ,
9894 __metadata ( 'design:paramtypes' , [ ] )
9995 ] , TutorialPublish ) ;
10096 return TutorialPublish ;
0 commit comments