merge-conflicts
[arvados.git] / src / views-components / dialog-create / dialog-project-create.tsx
index 475f83714d53db86307fde45656d0ed5f41c28dd..89deea6f86d8bfc94a7c36859c15a30b73c1faa8 100644 (file)
@@ -15,6 +15,7 @@ import Validator from '../../utils/dialog-validator';
 interface ProjectCreateProps {
   open: boolean;
   handleClose: () => void;
+  onSubmit: (data: { name: string, description: string }) => void;
 }
 
 interface DialogState {
@@ -72,20 +73,27 @@ class DialogProjectCreate extends React.Component<ProjectCreateProps & WithStyle
           </DialogContent>
           <DialogActions>
             <Button onClick={handleClose} className={classes.button} color="primary">CANCEL</Button>
-            <Button onClick={handleClose} className={classes.lastButton} color="primary" disabled={!this.state.isNameValid || (!this.state.isDescriptionValid && description.length > 0)} variant="raised">CREATE A PROJECT</Button>
+            <Button onClick={this.handleSubmit} className={classes.lastButton} color="primary" disabled={!this.state.isNameValid || (!this.state.isDescriptionValid && description.length > 0)} variant="raised">CREATE A PROJECT</Button>
           </DialogActions>
         </div>
       </Dialog>
     );
   }
 
-  handleProjectName(e: any) {
+  handleSubmit = () => {
+    this.props.onSubmit({
+      name: this.state.name,
+      description: this.state.description
+    });
+  }
+
+  handleProjectName(e: React.ChangeEvent<HTMLInputElement>) {
     this.setState({
       name: e.target.value,
     });
   }
 
-  handleDescriptionValue(e: any) {
+  handleDescriptionValue(e: React.ChangeEvent<HTMLInputElement>) {
     this.setState({
       description: e.target.value,
     });