- return <Paper className={this.props.classes.root}>
- <Tabs value={this.state.value} onChange={this.handleChange} variant={"fullWidth"}>
- <Tab label={TABS.PROFILE} value={TABS.PROFILE} />
- <Tab label={TABS.GROUPS} value={TABS.GROUPS} />
- {this.props.isAdmin && <Tab label={TABS.ADMIN} value={TABS.ADMIN} />}
- </Tabs>
- {this.state.value === TABS.PROFILE &&
- <CardContent>
- <form onSubmit={this.props.handleSubmit} data-cy="profile-form">
- <Grid container spacing={24}>
- <Grid item className={this.props.classes.gridItem} sm={6} xs={12} data-cy="firstName">
- <Field
- label="First name"
- name="firstName"
- component={ReadOnlyField as any}
- disabled
- />
- </Grid>
- <Grid item className={this.props.classes.gridItem} sm={6} xs={12} data-cy="lastName">
- <Field
- label="Last name"
- name="lastName"
- component={ReadOnlyField as any}
- disabled
- />
- </Grid>
- <Grid item className={this.props.classes.gridItem} sm={6} xs={12} data-cy="email">
- <Field
- label="E-mail"
- name="email"
- component={ReadOnlyField as any}
- disabled
- />
- </Grid>
- <Grid item className={this.props.classes.gridItem} sm={6} xs={12} data-cy="username">
- <Field
- label="Username"
- name="username"
- component={ReadOnlyField as any}
- disabled
- />
- </Grid>
- <Grid item className={this.props.classes.gridItem} sm={6} xs={12}>
- <Field
- label="Organization"
- name="prefs.profile.organization"
- component={TextField as any}
- disabled={!this.props.isAdmin && !this.props.isSelf}
- />
- </Grid>
- <Grid item className={this.props.classes.gridItem} sm={6} xs={12}>
- <Field
- label="E-mail at Organization"
- name="prefs.profile.organization_email"
- component={TextField as any}
- disabled={!this.props.isAdmin && !this.props.isSelf}
- validate={PROFILE_EMAIL_VALIDATION}
- />
- </Grid>
- <Grid item className={this.props.classes.gridItem} sm={6} xs={12}>
- <InputLabel className={this.props.classes.label} htmlFor="prefs.profile.role">Role</InputLabel>
- <Field
- id="prefs.profile.role"
- name="prefs.profile.role"
- component={NativeSelectField as any}
- items={RoleTypes}
- disabled={!this.props.isAdmin && !this.props.isSelf}
- />
+ if (this.props.isInaccessible) {
+ return (
+ <Paper className={this.props.classes.emptyRoot}>
+ <CardContent>
+ <DefaultView icon={DetailsIcon} messages={['This user does not exist or your account does not have permission to view it']} />
+ </CardContent>
+ </Paper>
+ );
+ } else {
+ return <Paper className={this.props.classes.root}>
+ <Tabs value={this.state.value} onChange={this.handleChange} variant={"fullWidth"}>
+ <Tab label={TABS.PROFILE} value={TABS.PROFILE} />
+ <Tab label={TABS.GROUPS} value={TABS.GROUPS} />
+ </Tabs>
+ {this.state.value === TABS.PROFILE &&
+ <CardContent>
+ <Grid container justify="space-between">
+ <Grid item>
+ <Typography className={this.props.classes.title}>
+ {this.props.userUuid}
+ <CopyToClipboardSnackbar value={this.props.userUuid} />
+ </Typography>