X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/5114536622bd9abf5bd729629b9249ccd11fd3ce..699f7cebc3057ddf22ca3c43c3d3534d605972ec:/src/views-components/create-project-dialog/create-project-dialog.tsx

diff --git a/src/views-components/create-project-dialog/create-project-dialog.tsx b/src/views-components/create-project-dialog/create-project-dialog.tsx
index d97eebcd1c..6b69b79301 100644
--- a/src/views-components/create-project-dialog/create-project-dialog.tsx
+++ b/src/views-components/create-project-dialog/create-project-dialog.tsx
@@ -3,18 +3,32 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import { connect } from "react-redux";
-import { Dispatch } from "../../../node_modules/redux";
+import { Dispatch } from "redux";
 import { RootState } from "../../store/store";
-import DialogProjectCreate from "../../components/dialog-create/dialog-project-create";
-import actions from "../../store/project/project-action";
+import DialogProjectCreate from "../dialog-create/dialog-project-create";
+import actions, { createProject, getProjectList } from "../../store/project/project-action";
+import dataExplorerActions from "../../store/data-explorer/data-explorer-action";
+import { PROJECT_PANEL_ID } from "../../views/project-panel/project-panel";
 
 const mapStateToProps = (state: RootState) => ({
     open: state.projects.creator.opened
 });
 
+const submit = (data: { name: string, description: string }) =>
+    (dispatch: Dispatch, getState: () => RootState) => {
+        const { ownerUuid } = getState().projects.creator;
+        dispatch<any>(createProject(data)).then(() => {
+            dispatch(dataExplorerActions.REQUEST_ITEMS({ id: PROJECT_PANEL_ID }));
+            dispatch<any>(getProjectList(ownerUuid));
+        });
+    };
+
 const mapDispatchToProps = (dispatch: Dispatch) => ({
     handleClose: () => {
         dispatch(actions.CLOSE_PROJECT_CREATOR());
+    },
+    onSubmit: (data: { name: string, description: string }) => {
+        dispatch<any>(submit(data));
     }
 });
 
