Skip to content
Snippets Groups Projects
Commit 5f857c42 authored by William Enright's avatar William Enright Committed by Larbi Gharib
Browse files

Fixed user profile fields being marked as required

Change-Id: I4b15e1d4dc4641dd997c1ea1a4dfe27c1f30bd21
parent 2f89cea3
No related branches found
No related tags found
No related merge requests found
......@@ -299,14 +299,6 @@ export default function EditCreateUserProfile(props) {
*
* */
const validateFieldInput = fieldinput => {
let error;
if (!fieldinput) {
error = 'Required';
}
return error;
}
const validateUsername = usernamevalue => {
handleUserExists(usernamevalue)
let error;
......@@ -318,10 +310,7 @@ export default function EditCreateUserProfile(props) {
const validateEmail = emailvalue => {
let error;
if (!emailvalue) {
error = 'Required';
}
else if (!/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i.test(emailvalue)) {
if (!/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i.test(emailvalue)) {
error = 'Invalid email address';
}
return error;
......@@ -482,7 +471,7 @@ export default function EditCreateUserProfile(props) {
<Grid item xs={12} sm={12} md={6}>
<FormControl className={classes.margin} fullWidth>
<InputLabel htmlFor="firstname">First Name</InputLabel>
<Field name="firstname" validate={validateFieldInput} >
<Field name="firstname" >
{({field}) => (
<Input
id="firstname"
......@@ -504,7 +493,7 @@ export default function EditCreateUserProfile(props) {
<Grid item xs={12} sm={12} md={6}>
<FormControl className={classes.margin} fullWidth>
<InputLabel htmlFor="lastname">Last Name</InputLabel>
<Field name="lastname" validate={validateFieldInput} >
<Field name="lastname" >
{({field}) => (
<Input
id="lastname"
......@@ -548,7 +537,7 @@ export default function EditCreateUserProfile(props) {
<Grid item xs={12} sm={12} md={6}>
<FormControl className={classes.margin} fullWidth>
<InputLabel htmlFor="organization">Organisation</InputLabel>
<Field name="organization" validate={validateFieldInput} >
<Field name="organization" >
{({field}) => (
<Input
id="organization"
......@@ -570,7 +559,7 @@ export default function EditCreateUserProfile(props) {
<Grid item xs={12} sm={12} md={6}>
<FormControl className={classes.margin} fullWidth>
<InputLabel htmlFor="phonenumber">Phone Number</InputLabel>
<Field name="phonenumber" validate={validateFieldInput} >
<Field name="phonenumber" >
{({field}) => (
<Input
id="phonenumber"
......@@ -592,7 +581,7 @@ export default function EditCreateUserProfile(props) {
<Grid item xs={12} sm={12} md={6}>
<FormControl className={classes.margin} fullWidth>
<InputLabel htmlFor="extension">Extension</InputLabel>
<Field name="extension" validate={validateFieldInput} >
<Field name="extension" >
{({field}) => (
<Input
id="extension"
......@@ -614,7 +603,7 @@ export default function EditCreateUserProfile(props) {
<Grid item xs={12} sm={12} md={6}>
<FormControl className={classes.margin} fullWidth>
<InputLabel htmlFor="faxnumber">Fax Number</InputLabel>
<Field name="faxnumber" validate={validateFieldInput} >
<Field name="faxnumber" >
{({field}) => (
<Input
id="faxnumber"
......@@ -636,7 +625,7 @@ export default function EditCreateUserProfile(props) {
<Grid item xs={12} sm={12} md={6}>
<FormControl className={classes.margin} fullWidth>
<InputLabel htmlFor="mobilephonenumber">Mobile Phonenumber</InputLabel>
<Field name="mobilephonenumber" validate={validateFieldInput} >
<Field name="mobilephonenumber" >
{({field}) => (
<Input
id="mobilephonenumber"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment