X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/b7a4d46fe2b011cdb6e38ed42e9f886fee8290b8..29c0944feb7932889a5b6fcaf208eef9f5864a29:/src/views/my-account-panel/my-account-panel.tsx

diff --git a/src/views/my-account-panel/my-account-panel.tsx b/src/views/my-account-panel/my-account-panel.tsx
index adc2f6947b..bd1f587457 100644
--- a/src/views/my-account-panel/my-account-panel.tsx
+++ b/src/views/my-account-panel/my-account-panel.tsx
@@ -3,23 +3,25 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import { RootState } from '~/store/store';
-import { Dispatch, compose } from 'redux';
-import { reduxForm, reset } from 'redux-form';
+import { compose } from 'redux';
+import { reduxForm, isPristine, isValid } from 'redux-form';
 import { connect } from 'react-redux';
-import { MyAccountPanelRoot, MyAccountPanelRootDataProps, MyAccountPanelRootActionProps, MY_ACCOUNT_FORM } from '~/views/my-account-panel/my-account-panel-root';
+import { saveEditedUser } from '~/store/my-account/my-account-panel-actions';
+import { MyAccountPanelRoot, MyAccountPanelRootDataProps } from '~/views/my-account-panel/my-account-panel-root';
+import { MY_ACCOUNT_FORM } from "~/store/my-account/my-account-panel-actions";
 
 const mapStateToProps = (state: RootState): MyAccountPanelRootDataProps => ({
-    user: state.auth.user
+    isPristine: isPristine(MY_ACCOUNT_FORM)(state),
+    isValid: isValid(MY_ACCOUNT_FORM)(state),
+    initialValues: state.auth.user,
+    localCluster: state.auth.localCluster
 });
 
-const mapDispatchToProps = (dispatch: Dispatch): MyAccountPanelRootActionProps => ({
-
-});
-
-export const MyAccountPanel = compose(connect(mapStateToProps, mapDispatchToProps), reduxForm({
-    form: MY_ACCOUNT_FORM,
-    onSubmit: (data, dispatch) => {
-        // dispatch(moveProject(data));
-
-    }
-}))(MyAccountPanelRoot);
\ No newline at end of file
+export const MyAccountPanel = compose(
+    connect(mapStateToProps),
+    reduxForm({
+        form: MY_ACCOUNT_FORM,
+        onSubmit: (data, dispatch) => {
+            dispatch(saveEditedUser(data));
+        }
+    }))(MyAccountPanelRoot);
