import { History, Location } from 'history';
import { RootStore } from '~/store/store';
-import { matchProcessRoute, matchProcessLogRoute, matchProjectRoute, matchCollectionRoute, matchFavoritesRoute, matchTrashRoute, matchRootRoute, matchSharedWithMeRoute, matchRunProcessRoute, matchWorkflowRoute, matchSearchResultsRoute, matchSshKeysRoute, matchRepositoriesRoute, matchMyAccountRoute } from './routes';
-import { loadProject, loadCollection, loadFavorites, loadTrash, loadProcess, loadProcessLog, loadSshKeys, loadRepositories, loadMyAccount } from '~/store/workbench/workbench-actions';
-import { matchProcessRoute, matchProcessLogRoute, matchProjectRoute, matchCollectionRoute, matchFavoritesRoute, matchTrashRoute, matchRootRoute, matchSharedWithMeRoute, matchRunProcessRoute, matchWorkflowRoute, matchSearchResultsRoute, matchSshKeysRoute, matchRepositoriesRoute, matchVirtualMachineRoute } from './routes';
-import { loadProject, loadCollection, loadFavorites, loadTrash, loadProcess, loadProcessLog, loadSshKeys, loadRepositories, loadVirtualMachines } from '~/store/workbench/workbench-actions';
+import { matchProcessRoute, matchProcessLogRoute, matchProjectRoute, matchCollectionRoute, matchFavoritesRoute, matchTrashRoute, matchRootRoute, matchSharedWithMeRoute, matchRunProcessRoute, matchWorkflowRoute, matchSearchResultsRoute, matchSshKeysRoute, matchRepositoriesRoute, matchMyAccountRoute, matchVirtualMachineRoute } from './routes';
+import { loadProject, loadCollection, loadFavorites, loadTrash, loadProcess, loadProcessLog, loadSshKeys, loadRepositories, loadMyAccount, loadVirtualMachines } from '~/store/workbench/workbench-actions';
import { navigateToRootProject } from '~/store/navigation/navigation-action';
import { loadSharedWithMe, loadRunProcess, loadWorkflow, loadSearchResults } from '~//store/workbench/workbench-actions';
// SPDX-License-Identifier: AGPL-3.0
import * as React from 'react';
-import { StyleRulesCallback, WithStyles, withStyles, Card, CardContent, TextField, Button, Typography, Grid, Table, TableHead, TableRow, TableCell, TableBody, Tooltip, IconButton } from '@material-ui/core';
+import { Field, InjectedFormProps } from "redux-form";
+import { TextField } from "~/components/text-field/text-field";
+import { StyleRulesCallback, WithStyles, withStyles, Card, CardContent, Button, Typography, Grid, Table, TableHead, TableRow, TableCell, TableBody, Tooltip, IconButton } from '@material-ui/core';
import { ArvadosTheme } from '~/common/custom-theme';
import { User } from "~/models/user";
overflow: 'auto'
},
gridItem: {
- minHeight: 45,
+ height: 45,
marginBottom: 20
},
title: {
user?: User;
}
-type MyAccountPanelRootProps = MyAccountPanelRootActionProps & MyAccountPanelRootDataProps & WithStyles<CssRules>;
+export const MY_ACCOUNT_FORM = 'myAccountForm';
+
+type MyAccountPanelRootProps = InjectedFormProps<MyAccountPanelRootActionProps> & MyAccountPanelRootDataProps & WithStyles<CssRules>;
export const MyAccountPanelRoot = withStyles(styles)(
({ classes, user }: MyAccountPanelRootProps) => {
<Grid container direction="row" spacing={24}>
<Grid item xs={6}>
<Grid item className={classes.gridItem}>
- <TextField
+ <Field
label="E-mail"
name="email"
- fullWidth
+ component={TextField}
value={user!.email}
disabled
/>
</Grid>
<Grid item className={classes.gridItem}>
- <TextField
+ <Field
label="First name"
name="firstName"
- fullWidth
+ component={TextField}
value={user!.firstName}
disabled
/>
</Grid>
<Grid item className={classes.gridItem}>
- <TextField
+ <Field
label="Identity URL"
name="identityUrl"
- fullWidth
+ component={TextField}
value={user!.identityUrl}
disabled
/>
</Grid>
<Grid item className={classes.gridItem}>
- <TextField
+ <Field
label="Organization"
name="organization"
value={user!.prefs.profile!.organization}
- fullWidth
+ component={TextField}
/>
</Grid>
<Grid item className={classes.gridItem}>
- <TextField
+ <Field
label="Website"
name="website"
value={user!.prefs.profile!.website_url}
- fullWidth
+ component={TextField}
/>
</Grid>
<Grid item className={classes.gridItem}>
- <TextField
+ <Field
label="Role"
name="role"
value={user!.prefs.profile!.role}
- fullWidth
+ component={TextField}
/>
</Grid>
</Grid>
<Grid item xs={6}>
<Grid item className={classes.gridItem} />
<Grid item className={classes.gridItem}>
- <TextField
+ <Field
label="Last name"
name="lastName"
- fullWidth
+ component={TextField}
value={user!.lastName}
disabled
/>
</Grid>
<Grid item className={classes.gridItem} />
<Grid item className={classes.gridItem}>
- <TextField
+ <Field
label="E-mail at Organization"
name="organizationEmail"
value={user!.prefs.profile!.organization_email}
- fullWidth
+ component={TextField}
/>
</Grid>
</Grid>
// SPDX-License-Identifier: AGPL-3.0
import { RootState } from '~/store/store';
-import { Dispatch } from 'redux';
+import { Dispatch, compose } from 'redux';
+import { reduxForm, reset } from 'redux-form';
import { connect } from 'react-redux';
-import { MyAccountPanelRoot, MyAccountPanelRootDataProps, MyAccountPanelRootActionProps } from '~/views/my-account-panel/my-account-panel-root';
+import { MyAccountPanelRoot, MyAccountPanelRootDataProps, MyAccountPanelRootActionProps, MY_ACCOUNT_FORM } from '~/views/my-account-panel/my-account-panel-root';
const mapStateToProps = (state: RootState): MyAccountPanelRootDataProps => ({
user: state.auth.user
});
-export const MyAccountPanel = connect(mapStateToProps, mapDispatchToProps)(MyAccountPanelRoot);
\ No newline at end of file
+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