Merge branch '13694-Data-operations-Project-creation'
[arvados.git] / src / views-components / dialog-create / dialog-project-create.tsx
index 475f83714d53db86307fde45656d0ed5f41c28dd..ef07ea2f4a7d8608bbd2aa523018dca88c8033d8 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,13 +73,20 @@ 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>
     );
   }
 
+  handleSubmit = () => {
+    this.props.onSubmit({
+      name: this.state.name,
+      description: this.state.description
+    });
+  }
+
   handleProjectName(e: any) {
     this.setState({
       name: e.target.value,