Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-jams
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-jams
Commits
5f857c42
Commit
5f857c42
authored
4 years ago
by
William Enright
Committed by
Larbi Gharib
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fixed user profile fields being marked as required
Change-Id: I4b15e1d4dc4641dd997c1ea1a4dfe27c1f30bd21
parent
2f89cea3
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
jams-react-client/src/views/UserProfile/EditCreateUserProfile.js
+8
-19
8 additions, 19 deletions
...act-client/src/views/UserProfile/EditCreateUserProfile.js
with
8 additions
and
19 deletions
jams-react-client/src/views/UserProfile/EditCreateUserProfile.js
+
8
−
19
View file @
5f857c42
...
@@ -299,14 +299,6 @@ export default function EditCreateUserProfile(props) {
...
@@ -299,14 +299,6 @@ export default function EditCreateUserProfile(props) {
*
*
* */
* */
const
validateFieldInput
=
fieldinput
=>
{
let
error
;
if
(
!
fieldinput
)
{
error
=
'
Required
'
;
}
return
error
;
}
const
validateUsername
=
usernamevalue
=>
{
const
validateUsername
=
usernamevalue
=>
{
handleUserExists
(
usernamevalue
)
handleUserExists
(
usernamevalue
)
let
error
;
let
error
;
...
@@ -318,10 +310,7 @@ export default function EditCreateUserProfile(props) {
...
@@ -318,10 +310,7 @@ export default function EditCreateUserProfile(props) {
const
validateEmail
=
emailvalue
=>
{
const
validateEmail
=
emailvalue
=>
{
let
error
;
let
error
;
if
(
!
emailvalue
)
{
if
(
!
/^
[
A-Z0-9._%+-
]
+@
[
A-Z0-9.-
]
+
\.[
A-Z
]{2,4}
$/i
.
test
(
emailvalue
))
{
error
=
'
Required
'
;
}
else
if
(
!
/^
[
A-Z0-9._%+-
]
+@
[
A-Z0-9.-
]
+
\.[
A-Z
]{2,4}
$/i
.
test
(
emailvalue
))
{
error
=
'
Invalid email address
'
;
error
=
'
Invalid email address
'
;
}
}
return
error
;
return
error
;
...
@@ -482,7 +471,7 @@ export default function EditCreateUserProfile(props) {
...
@@ -482,7 +471,7 @@ export default function EditCreateUserProfile(props) {
<
Grid
item
xs
=
{
12
}
sm
=
{
12
}
md
=
{
6
}
>
<
Grid
item
xs
=
{
12
}
sm
=
{
12
}
md
=
{
6
}
>
<
FormControl
className
=
{
classes
.
margin
}
fullWidth
>
<
FormControl
className
=
{
classes
.
margin
}
fullWidth
>
<
InputLabel
htmlFor
=
"
firstname
"
>
First
Name
<
/InputLabel
>
<
InputLabel
htmlFor
=
"
firstname
"
>
First
Name
<
/InputLabel
>
<
Field
name
=
"
firstname
"
validate
=
{
validateFieldInput
}
>
<
Field
name
=
"
firstname
"
>
{({
field
})
=>
(
{({
field
})
=>
(
<
Input
<
Input
id
=
"
firstname
"
id
=
"
firstname
"
...
@@ -504,7 +493,7 @@ export default function EditCreateUserProfile(props) {
...
@@ -504,7 +493,7 @@ export default function EditCreateUserProfile(props) {
<
Grid
item
xs
=
{
12
}
sm
=
{
12
}
md
=
{
6
}
>
<
Grid
item
xs
=
{
12
}
sm
=
{
12
}
md
=
{
6
}
>
<
FormControl
className
=
{
classes
.
margin
}
fullWidth
>
<
FormControl
className
=
{
classes
.
margin
}
fullWidth
>
<
InputLabel
htmlFor
=
"
lastname
"
>
Last
Name
<
/InputLabel
>
<
InputLabel
htmlFor
=
"
lastname
"
>
Last
Name
<
/InputLabel
>
<
Field
name
=
"
lastname
"
validate
=
{
validateFieldInput
}
>
<
Field
name
=
"
lastname
"
>
{({
field
})
=>
(
{({
field
})
=>
(
<
Input
<
Input
id
=
"
lastname
"
id
=
"
lastname
"
...
@@ -548,7 +537,7 @@ export default function EditCreateUserProfile(props) {
...
@@ -548,7 +537,7 @@ export default function EditCreateUserProfile(props) {
<
Grid
item
xs
=
{
12
}
sm
=
{
12
}
md
=
{
6
}
>
<
Grid
item
xs
=
{
12
}
sm
=
{
12
}
md
=
{
6
}
>
<
FormControl
className
=
{
classes
.
margin
}
fullWidth
>
<
FormControl
className
=
{
classes
.
margin
}
fullWidth
>
<
InputLabel
htmlFor
=
"
organization
"
>
Organisation
<
/InputLabel
>
<
InputLabel
htmlFor
=
"
organization
"
>
Organisation
<
/InputLabel
>
<
Field
name
=
"
organization
"
validate
=
{
validateFieldInput
}
>
<
Field
name
=
"
organization
"
>
{({
field
})
=>
(
{({
field
})
=>
(
<
Input
<
Input
id
=
"
organization
"
id
=
"
organization
"
...
@@ -570,7 +559,7 @@ export default function EditCreateUserProfile(props) {
...
@@ -570,7 +559,7 @@ export default function EditCreateUserProfile(props) {
<
Grid
item
xs
=
{
12
}
sm
=
{
12
}
md
=
{
6
}
>
<
Grid
item
xs
=
{
12
}
sm
=
{
12
}
md
=
{
6
}
>
<
FormControl
className
=
{
classes
.
margin
}
fullWidth
>
<
FormControl
className
=
{
classes
.
margin
}
fullWidth
>
<
InputLabel
htmlFor
=
"
phonenumber
"
>
Phone
Number
<
/InputLabel
>
<
InputLabel
htmlFor
=
"
phonenumber
"
>
Phone
Number
<
/InputLabel
>
<
Field
name
=
"
phonenumber
"
validate
=
{
validateFieldInput
}
>
<
Field
name
=
"
phonenumber
"
>
{({
field
})
=>
(
{({
field
})
=>
(
<
Input
<
Input
id
=
"
phonenumber
"
id
=
"
phonenumber
"
...
@@ -592,7 +581,7 @@ export default function EditCreateUserProfile(props) {
...
@@ -592,7 +581,7 @@ export default function EditCreateUserProfile(props) {
<
Grid
item
xs
=
{
12
}
sm
=
{
12
}
md
=
{
6
}
>
<
Grid
item
xs
=
{
12
}
sm
=
{
12
}
md
=
{
6
}
>
<
FormControl
className
=
{
classes
.
margin
}
fullWidth
>
<
FormControl
className
=
{
classes
.
margin
}
fullWidth
>
<
InputLabel
htmlFor
=
"
extension
"
>
Extension
<
/InputLabel
>
<
InputLabel
htmlFor
=
"
extension
"
>
Extension
<
/InputLabel
>
<
Field
name
=
"
extension
"
validate
=
{
validateFieldInput
}
>
<
Field
name
=
"
extension
"
>
{({
field
})
=>
(
{({
field
})
=>
(
<
Input
<
Input
id
=
"
extension
"
id
=
"
extension
"
...
@@ -614,7 +603,7 @@ export default function EditCreateUserProfile(props) {
...
@@ -614,7 +603,7 @@ export default function EditCreateUserProfile(props) {
<
Grid
item
xs
=
{
12
}
sm
=
{
12
}
md
=
{
6
}
>
<
Grid
item
xs
=
{
12
}
sm
=
{
12
}
md
=
{
6
}
>
<
FormControl
className
=
{
classes
.
margin
}
fullWidth
>
<
FormControl
className
=
{
classes
.
margin
}
fullWidth
>
<
InputLabel
htmlFor
=
"
faxnumber
"
>
Fax
Number
<
/InputLabel
>
<
InputLabel
htmlFor
=
"
faxnumber
"
>
Fax
Number
<
/InputLabel
>
<
Field
name
=
"
faxnumber
"
validate
=
{
validateFieldInput
}
>
<
Field
name
=
"
faxnumber
"
>
{({
field
})
=>
(
{({
field
})
=>
(
<
Input
<
Input
id
=
"
faxnumber
"
id
=
"
faxnumber
"
...
@@ -636,7 +625,7 @@ export default function EditCreateUserProfile(props) {
...
@@ -636,7 +625,7 @@ export default function EditCreateUserProfile(props) {
<
Grid
item
xs
=
{
12
}
sm
=
{
12
}
md
=
{
6
}
>
<
Grid
item
xs
=
{
12
}
sm
=
{
12
}
md
=
{
6
}
>
<
FormControl
className
=
{
classes
.
margin
}
fullWidth
>
<
FormControl
className
=
{
classes
.
margin
}
fullWidth
>
<
InputLabel
htmlFor
=
"
mobilephonenumber
"
>
Mobile
Phonenumber
<
/InputLabel
>
<
InputLabel
htmlFor
=
"
mobilephonenumber
"
>
Mobile
Phonenumber
<
/InputLabel
>
<
Field
name
=
"
mobilephonenumber
"
validate
=
{
validateFieldInput
}
>
<
Field
name
=
"
mobilephonenumber
"
>
{({
field
})
=>
(
{({
field
})
=>
(
<
Input
<
Input
id
=
"
mobilephonenumber
"
id
=
"
mobilephonenumber
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment