Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Automatically-Generated-Cyber-Security-Compliance-Engine
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jda1g15
Automatically-Generated-Cyber-Security-Compliance-Engine
Commits
a989ff8d
Commit
a989ff8d
authored
5 years ago
by
James D'Alton
Browse files
Options
Downloads
Patches
Plain Diff
added 'Don't have an account?' button
parent
1c0b0181
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
compforge/src/Components/Login.react.jsx
+15
-9
15 additions, 9 deletions
compforge/src/Components/Login.react.jsx
compforge/src/Components/Signup.react.jsx
+16
-15
16 additions, 15 deletions
compforge/src/Components/Signup.react.jsx
with
31 additions
and
24 deletions
compforge/src/Components/Login.react.jsx
+
15
−
9
View file @
a989ff8d
import
React
,
{
useState
}
from
"
react
"
;
import
React
,
{
useState
}
from
"
react
"
;
import
{
connect
}
from
"
react-redux
"
;
import
{
connect
}
from
"
react-redux
"
;
import
{
Redirect
}
from
"
react-router-dom
"
;
import
{
Link
,
Redirect
}
from
"
react-router-dom
"
;
import
{
loginUser
,
passwordReset
}
from
"
../actions
"
;
import
{
loginUser
,
passwordReset
}
from
"
../actions
"
;
import
{
withStyles
}
from
"
@material-ui/styles
"
;
import
{
withStyles
}
from
"
@material-ui/styles
"
;
...
@@ -91,8 +91,8 @@ const Login = (props) => {
...
@@ -91,8 +91,8 @@ const Login = (props) => {
return
<
Redirect
to
=
"/"
/>;
return
<
Redirect
to
=
"/"
/>;
}
}
return
(<
Container
component
=
"main"
style
=
{
{
marginBottom
:
100
,
paddingLeft
:
0
,
paddingRight
:
0
}
}
maxWidth
=
"xs"
>
return
(<
Container
component
=
"main"
style
=
{
{
marginBottom
:
100
,
paddingLeft
:
0
,
paddingRight
:
0
}
}
maxWidth
=
"xs"
>
<
Paper
className
=
{
`
${
classes
.
paper
}
paper-mui`
}
>
<
Paper
className
=
{
`
${
classes
.
paper
}
paper-mui`
}
>
<
Avatar
className
=
{
classes
.
avatar
}
>
<
Avatar
className
=
{
classes
.
avatar
}
>
<
VpnKeyOutlinedIcon
/>
<
VpnKeyOutlinedIcon
/>
</
Avatar
>
</
Avatar
>
...
@@ -125,8 +125,8 @@ const Login = (props) => {
...
@@ -125,8 +125,8 @@ const Login = (props) => {
)
}
)
}
<
Typography
component
=
"p"
className
=
{
classes
.
password
}
>
<
Typography
component
=
"p"
className
=
{
classes
.
password
}
>
<
span
style
=
{
{
marginRight
:
6
}
}
>
Request password reset
</
span
>
<
span
style
=
{
{
marginRight
:
6
}
}
>
Don't have an account?
</
span
>
<
Button
variant
=
"outlined"
size
=
'small'
style
=
{
{
fontSize
:
10
}
}
color
=
"primary"
onClick
=
{
()
=>
{
setShowModal
(
true
);
}
}
>
here
</
Button
>
<
Button
variant
=
"outlined"
size
=
'small'
style
=
{
{
fontSize
:
10
}
}
color
=
"primary"
>
<
Link
to
=
{
'
/signup
'
}
>
Sign up
</
Link
>
</
Button
>
</
Typography
>
</
Typography
>
<
Button
<
Button
...
@@ -139,6 +139,12 @@ const Login = (props) => {
...
@@ -139,6 +139,12 @@ const Login = (props) => {
>
>
Sign In
Sign In
</
Button
>
</
Button
>
<
Typography
component
=
"p"
className
=
{
classes
.
password
}
>
<
span
style
=
{
{
marginRight
:
6
}
}
>
Request password reset
</
span
>
<
Button
variant
=
"outlined"
size
=
'small'
style
=
{
{
fontSize
:
10
}
}
color
=
"primary"
onClick
=
{
()
=>
{
setShowModal
(
true
);
}
}
>
here
</
Button
>
</
Typography
>
<
Drawer
anchor
=
{
'
top
'
}
open
=
{
Boolean
(
showModal
)
}
onClose
=
{
()
=>
setShowModal
(
'
false
'
)
}
>
<
Drawer
anchor
=
{
'
top
'
}
open
=
{
Boolean
(
showModal
)
}
onClose
=
{
()
=>
setShowModal
(
'
false
'
)
}
>
<
Container
component
=
"main"
maxWidth
=
"md"
>
<
Container
component
=
"main"
maxWidth
=
"md"
>
...
@@ -148,7 +154,7 @@ const Login = (props) => {
...
@@ -148,7 +154,7 @@ const Login = (props) => {
</
Typography
>
</
Typography
>
<
Button
variant
=
"outlined"
size
=
'small'
style
=
{
{
margin
:
16
,
height
:
40
}
}
onClick
=
{
()
=>
{
setShowModal
(
false
);
}
}
>
Done
</
Button
>
<
Button
variant
=
"outlined"
size
=
'small'
style
=
{
{
margin
:
16
,
height
:
40
}
}
onClick
=
{
()
=>
{
setShowModal
(
false
);
}
}
>
Done
</
Button
>
</
div
>
}
</
div
>
}
{
!
showSuccess
&&
<
div
className
=
'reset__password__wrapper'
>
{
!
showSuccess
&&
<
div
className
=
'reset__password__wrapper'
>
<
Typography
component
=
"p"
style
=
{
{
paddingTop
:
16
,
marginRight
:
16
,
marginTop
:
8
}
}
>
<
Typography
component
=
"p"
style
=
{
{
paddingTop
:
16
,
marginRight
:
16
,
marginTop
:
8
}
}
>
<
MailOutlineIcon
style
=
{
{
position
:
'
relative
'
,
top
:
5
,
color
:
'
#4BB543
'
}
}
/>
Please use a valid email address to reset your password.
<
MailOutlineIcon
style
=
{
{
position
:
'
relative
'
,
top
:
5
,
color
:
'
#4BB543
'
}
}
/>
Please use a valid email address to reset your password.
...
@@ -159,13 +165,13 @@ const Login = (props) => {
...
@@ -159,13 +165,13 @@ const Login = (props) => {
id
=
"email"
id
=
"email"
error
=
{
emailNotValid
}
error
=
{
emailNotValid
}
helperText
=
{
emailNotValid
?
'
Email format is not valid
'
:
''
}
helperText
=
{
emailNotValid
?
'
Email format is not valid
'
:
''
}
style
=
{
{
marginTop
:
26
}
}
style
=
{
{
marginTop
:
26
}
}
label
=
"Email address"
label
=
"Email address"
name
=
"email"
name
=
"email"
onChange
=
{
(
evt
)
=>
{
setResetEmail
(
evt
.
target
.
value
)
}
}
onChange
=
{
(
evt
)
=>
{
setResetEmail
(
evt
.
target
.
value
)
}
}
/>
/>
<
Button
variant
=
"outlined"
size
=
'large'
color
=
"primary"
onClick
=
{
()
=>
submitReset
()
}
>
Submit
</
Button
>
<
Button
variant
=
"outlined"
size
=
'large'
color
=
"primary"
onClick
=
{
()
=>
submitReset
()
}
>
Submit
</
Button
>
<
Button
variant
=
"outlined"
size
=
'large'
onClick
=
{
()
=>
{
setShowModal
(
false
);
}
}
>
Cancel
</
Button
>
<
Button
variant
=
"outlined"
size
=
'large'
onClick
=
{
()
=>
{
setShowModal
(
false
);
}
}
>
Cancel
</
Button
>
</
div
>
}
</
div
>
}
</
Container
>
</
Container
>
</
Drawer
>
</
Drawer
>
...
...
This diff is collapsed.
Click to expand it.
compforge/src/Components/Signup.react.jsx
+
16
−
15
View file @
a989ff8d
...
@@ -5,7 +5,7 @@ import { createUser } from "../actions";
...
@@ -5,7 +5,7 @@ import { createUser } from "../actions";
import
{
withStyles
}
from
"
@material-ui/styles
"
;
import
{
withStyles
}
from
"
@material-ui/styles
"
;
import
AccountCircleOutlinedIcon
from
'
@material-ui/icons/AccountCircleOutlined
'
;
import
AccountCircleOutlinedIcon
from
'
@material-ui/icons/AccountCircleOutlined
'
;
import
{
Typography
,
Paper
,
Container
,
TextField
,
Button
,
Avatar
}
from
"
@material-ui/core
"
;
import
{
Typography
,
Paper
,
Container
,
TextField
,
Button
,
Avatar
}
from
"
@material-ui/core
"
;
const
styles
=
()
=>
({
const
styles
=
()
=>
({
...
@@ -35,7 +35,7 @@ const styles = () => ({
...
@@ -35,7 +35,7 @@ const styles = () => ({
});
});
const
Signup
=
(
props
)
=>
{
const
Signup
=
(
props
)
=>
{
const
{
classes
,
loginError
,
isAuthenticated
,
createError
}
=
props
;
const
{
classes
,
loginError
,
isAuthenticated
,
createError
}
=
props
;
const
[
email
,
setEmail
]
=
useState
(
''
);
const
[
email
,
setEmail
]
=
useState
(
''
);
const
[
name
,
setName
]
=
useState
(
''
);
const
[
name
,
setName
]
=
useState
(
''
);
const
[
password
,
setPassword
]
=
useState
(
''
);
const
[
password
,
setPassword
]
=
useState
(
''
);
...
@@ -46,7 +46,7 @@ const Signup = (props) => {
...
@@ -46,7 +46,7 @@ const Signup = (props) => {
setCapval
(
value
);
setCapval
(
value
);
}
}
const
handleChange
=
({
target
},
type
)
=>
{
const
handleChange
=
({
target
},
type
)
=>
{
switch
(
type
)
{
switch
(
type
)
{
case
'
displayName
'
:
case
'
displayName
'
:
...
@@ -60,8 +60,8 @@ const Signup = (props) => {
...
@@ -60,8 +60,8 @@ const Signup = (props) => {
break
;
break
;
default
:
default
:
break
;
break
;
}
}
}
}
const
handleSubmit
=
()
=>
{
const
handleSubmit
=
()
=>
{
...
@@ -71,14 +71,14 @@ const Signup = (props) => {
...
@@ -71,14 +71,14 @@ const Signup = (props) => {
}
}
setDnerror
(
false
);
setDnerror
(
false
);
const
{
dispatch
}
=
props
;
const
{
dispatch
}
=
props
;
dispatch
(
createUser
(
email
,
password
,
name
));
dispatch
(
createUser
(
email
,
password
,
name
));
}
}
if
(
isAuthenticated
)
{
if
(
isAuthenticated
)
{
return
<
Redirect
to
=
"/userhome"
/>;
return
<
Redirect
to
=
"/userhome"
/>;
}
}
return
(<
Container
component
=
"main"
style
=
{
{
marginBottom
:
100
,
marginTop
:
100
,
paddingLeft
:
0
,
paddingRight
:
0
}
}
maxWidth
=
"xs"
>
return
(<
Container
component
=
"main"
style
=
{
{
marginBottom
:
100
,
marginTop
:
100
,
paddingLeft
:
0
,
paddingRight
:
0
}
}
maxWidth
=
"xs"
>
<
Paper
className
=
{
classes
.
paper
}
>
<
Paper
className
=
{
classes
.
paper
}
>
<
Avatar
className
=
{
classes
.
avatar
}
>
<
Avatar
className
=
{
classes
.
avatar
}
>
<
AccountCircleOutlinedIcon
/>
<
AccountCircleOutlinedIcon
/>
...
@@ -93,7 +93,7 @@ const Signup = (props) => {
...
@@ -93,7 +93,7 @@ const Signup = (props) => {
id
=
"username"
id
=
"username"
label
=
"Display Name"
label
=
"Display Name"
name
=
"Display Name"
name
=
"Display Name"
onChange
=
{
(
ev
)
=>
{
handleChange
(
ev
,
'
displayName
'
)}
}
onChange
=
{
(
ev
)
=>
{
handleChange
(
ev
,
'
displayName
'
)
}
}
/>
/>
<
TextField
<
TextField
variant
=
"outlined"
variant
=
"outlined"
...
@@ -102,7 +102,7 @@ const Signup = (props) => {
...
@@ -102,7 +102,7 @@ const Signup = (props) => {
id
=
"email"
id
=
"email"
label
=
"Email Address"
label
=
"Email Address"
name
=
"email"
name
=
"email"
onChange
=
{
(
ev
)
=>
{
handleChange
(
ev
,
'
email
'
)}
}
onChange
=
{
(
ev
)
=>
{
handleChange
(
ev
,
'
email
'
)
}
}
/>
/>
<
TextField
<
TextField
variant
=
"outlined"
variant
=
"outlined"
...
@@ -112,7 +112,7 @@ const Signup = (props) => {
...
@@ -112,7 +112,7 @@ const Signup = (props) => {
label
=
"Password"
label
=
"Password"
type
=
"password"
type
=
"password"
id
=
"password"
id
=
"password"
onChange
=
{
(
ev
)
=>
{
handleChange
(
ev
,
'
password
'
)}
}
onChange
=
{
(
ev
)
=>
{
handleChange
(
ev
,
'
password
'
)
}
}
/>
/>
{
loginError
&&
(
{
loginError
&&
(
...
@@ -122,18 +122,19 @@ const Signup = (props) => {
...
@@ -122,18 +122,19 @@ const Signup = (props) => {
)
}
)
}
<
Typography
component
=
"p"
className
=
{
classes
.
password
}
>
<
Typography
component
=
"p"
className
=
{
classes
.
password
}
>
<
Link
variant
=
"outlined"
size
=
'small'
style
=
{
{
fontSize
:
10
}
}
color
=
"primary"
to
=
{
'
/login
'
}
>
Already have an account?
</
Link
>
<
span
style
=
{
{
marginRight
:
6
}
}
>
Already have an account?
</
span
>
<
Button
variant
=
"outlined"
size
=
'small'
style
=
{
{
fontSize
:
10
}
}
color
=
"primary"
>
<
Link
to
=
{
'
/login
'
}
>
Login
</
Link
>
</
Button
>
</
Typography
>
</
Typography
>
{
createError
?.
isError
&&
(
{
createError
?.
isError
&&
(
<
Typography
component
=
"p"
className
=
{
classes
.
errorText
}
>
<
Typography
component
=
"p"
className
=
{
classes
.
errorText
}
>
{
`
${
createError
?.
message
?
createError
.
message
:
'
Error
'
}
`
}
{
`
${
createError
?.
message
?
createError
.
message
:
'
Error
'
}
`
}
</
Typography
>
</
Typography
>
)
}
)
}
{
dnerror
&&
(
{
dnerror
&&
(
<
Typography
component
=
"p"
className
=
{
classes
.
errorText
}
>
<
Typography
component
=
"p"
className
=
{
classes
.
errorText
}
>
Please set display name. Minimum characters 4.
Please set display name. Minimum characters 4.
</
Typography
>
</
Typography
>
)
}
)
}
<
Button
<
Button
disabled
=
{
false
}
disabled
=
{
false
}
...
...
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