refs #master Fix small bugsfor details panel and dialog project update
[arvados.git] / src / views-components / create-collection-dialog-with-selected / create-collection-dialog-with-selected.tsx
index 53464022b79745a2351e4d9846072dda658e5fca..fb5f094b68ffad5e9c458aa60f4d1355b78a46c5 100644 (file)
@@ -2,29 +2,28 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { Dispatch, compose } from "redux";
+import { Dispatch } from "redux";
 import { reduxForm, reset, startSubmit, stopSubmit } from "redux-form";
 import { withDialog } from "~/store/dialog/with-dialog";
 import { dialogActions } from "~/store/dialog/dialog-actions";
 import { DialogCollectionCreateWithSelected } from "../dialog-create/dialog-collection-create-selected";
-import { loadProjectTreePickerProjects } from "../project-tree-picker/project-tree-picker";
+import { resetPickerProjectTree } from "~/store/project-tree-picker/project-tree-picker-actions";
 
 export const DIALOG_COLLECTION_CREATE_WITH_SELECTED = 'dialogCollectionCreateWithSelected';
 
 export const createCollectionWithSelected = () =>
     (dispatch: Dispatch) => {
         dispatch(reset(DIALOG_COLLECTION_CREATE_WITH_SELECTED));
-        dispatch<any>(loadProjectTreePickerProjects(''));
+        dispatch<any>(resetPickerProjectTree());
         dispatch(dialogActions.OPEN_DIALOG({ id: DIALOG_COLLECTION_CREATE_WITH_SELECTED, data: {} }));
     };
 
-
-export const DialogCollectionCreateWithSelectedFile = compose(
-    withDialog(DIALOG_COLLECTION_CREATE_WITH_SELECTED),
-    reduxForm({
+export const [DialogCollectionCreateWithSelectedFile] = [DialogCollectionCreateWithSelected]
+    .map(withDialog(DIALOG_COLLECTION_CREATE_WITH_SELECTED))
+    .map(reduxForm({
         form: DIALOG_COLLECTION_CREATE_WITH_SELECTED,
         onSubmit: (data, dispatch) => {
             dispatch(startSubmit(DIALOG_COLLECTION_CREATE_WITH_SELECTED));
             setTimeout(() => dispatch(stopSubmit(DIALOG_COLLECTION_CREATE_WITH_SELECTED, { name: 'Invalid name' })), 2000);
         }
-    }))(DialogCollectionCreateWithSelected);
+    }));