1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as React from 'react';
6 import { Field, InjectedFormProps } from "redux-form";
7 import { TextField } from "~/components/text-field/text-field";
8 import { StyleRulesCallback, WithStyles, withStyles, Card, CardContent, Button, Typography, Grid, Table, TableHead, TableRow, TableCell, TableBody, Tooltip, IconButton } from '@material-ui/core';
9 import { ArvadosTheme } from '~/common/custom-theme';
10 import { User } from "~/models/user";
12 type CssRules = 'root' | 'gridItem' | 'title';
14 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
24 marginBottom: theme.spacing.unit * 3,
25 color: theme.palette.grey["600"]
29 export interface MyAccountPanelRootActionProps {}
31 export interface MyAccountPanelRootDataProps {
35 export const MY_ACCOUNT_FORM = 'myAccountForm';
37 type MyAccountPanelRootProps = InjectedFormProps<MyAccountPanelRootActionProps> & MyAccountPanelRootDataProps & WithStyles<CssRules>;
39 export const MyAccountPanelRoot = withStyles(styles)(
40 ({ classes, user }: MyAccountPanelRootProps) => {
42 return <Card className={classes.root}>
44 <Typography variant="title" className={classes.title}>User profile</Typography>
45 <Grid container direction="row" spacing={24}>
47 <Grid item className={classes.gridItem}>
56 <Grid item className={classes.gridItem}>
61 value={user!.firstName}
65 <Grid item className={classes.gridItem}>
70 value={user!.identityUrl}
74 <Grid item className={classes.gridItem}>
78 value={user!.prefs.profile!.organization}
82 <Grid item className={classes.gridItem}>
86 value={user!.prefs.profile!.website_url}
90 <Grid item className={classes.gridItem}>
94 value={user!.prefs.profile!.role}
100 <Grid item className={classes.gridItem} />
101 <Grid item className={classes.gridItem}>
105 component={TextField}
106 value={user!.lastName}
110 <Grid item className={classes.gridItem} />
111 <Grid item className={classes.gridItem}>
113 label="E-mail at Organization"
114 name="organizationEmail"
115 value={user!.prefs.profile!.organization_email}
116 component={TextField}