import { Field, InjectedFormProps, WrappedFieldProps } from "redux-form";
import { TextField } from "~/components/text-field/text-field";
import { NativeSelectField } from "~/components/select-field/select-field";
-import { DetailsAttribute } from '~/components/details-attribute/details-attribute';
import {
StyleRulesCallback,
WithStyles,
import { User } from "~/models/user";
import { MY_ACCOUNT_VALIDATION } from "~/validators/validators";
-type CssRules = 'root' | 'gridItem' | 'label' | 'title' | 'actions' | 'link';
+type CssRules = 'root' | 'gridItem' | 'label' | 'title' | 'actions';
const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
root: {
marginBottom: theme.spacing.unit * 3,
color: theme.palette.grey["600"]
},
- link: {
- lineHeight:'2.1',
- whiteSpace: 'nowrap',
- fontSize: '1rem',
- color: theme.palette.primary.main,
- '&:hover': {
- cursor: 'pointer'
- }
- },
actions: {
display: 'flex',
justifyContent: 'flex-end'
}
});
-export interface MyAccountPanelRootActionProps {
- openLinkAccount: () => void;
- }
+export interface MyAccountPanelRootActionProps { }
export interface MyAccountPanelRootDataProps {
isPristine: boolean;
{ key: 'Other', value: 'Other' }
];
-type MyAccountPanelRootProps = InjectedFormProps & MyAccountPanelRootActionProps & MyAccountPanelRootDataProps & WithStyles<CssRules>;
+type MyAccountPanelRootProps = InjectedFormProps<MyAccountPanelRootActionProps> & MyAccountPanelRootDataProps & WithStyles<CssRules>;
type LocalClusterProp = { localCluster: string };
const renderField: React.ComponentType<WrappedFieldProps & LocalClusterProp> = ({ input, localCluster }) => (
);
export const MyAccountPanelRoot = withStyles(styles)(
- ({ classes, isValid, handleSubmit, reset, isPristine, invalid, submitting, localCluster, openLinkAccount}: MyAccountPanelRootProps) => {
+ ({ classes, isValid, handleSubmit, reset, isPristine, invalid, submitting, localCluster }: MyAccountPanelRootProps) => {
return <Card className={classes.root}>
<CardContent>
- <Grid container spacing={24}>
- <Grid item className={classes.gridItem}>
- <Typography variant="title" className={classes.title}>
- Logged in as <Field name="uuid" component={renderField} localCluster={localCluster} />
- </Typography>
- </Grid>
- <Grid item className={classes.gridItem}>
- <span onClick={() => openLinkAccount()}>
- <DetailsAttribute classLabel={classes.link} label='Link account' />
- </span>
- </Grid>
- </Grid>
+ <Typography variant="title" className={classes.title}>
+ Logged in as <Field name="uuid" component={renderField} localCluster={localCluster} />
+ </Typography>
<form onSubmit={handleSubmit}>
<Grid container spacing={24}>
<Grid item className={classes.gridItem} sm={6} xs={12}>
// SPDX-License-Identifier: AGPL-3.0
import { RootState } from '~/store/store';
-import { Dispatch } from 'redux';
import { compose } from 'redux';
import { reduxForm, isPristine, isValid } from 'redux-form';
import { connect } from 'react-redux';
-import { saveEditedUser, openLinkAccount } from '~/store/my-account/my-account-panel-actions';
-import { MyAccountPanelRoot, MyAccountPanelRootDataProps, MyAccountPanelRootActionProps } 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 => ({
localCluster: state.auth.localCluster
});
-const mapDispatchToProps = (dispatch: Dispatch): MyAccountPanelRootActionProps => ({
- openLinkAccount: () => dispatch<any>(openLinkAccount())
-});
-
export const MyAccountPanel = compose(
- connect(mapStateToProps, mapDispatchToProps),
+ connect(mapStateToProps),
reduxForm({
form: MY_ACCOUNT_FORM,
onSubmit: (data, dispatch) => {