Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scratch-www
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
scratch-www
Commits
bf28fae9
Commit
bf28fae9
authored
Jul 21, 2016
by
Matthew Taylor
Committed by
GitHub
Jul 21, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #739 from mewtaylor/issue/gh-698
Fix GH-698: refresh session on successful registration
parents
63b0b03b
859877c1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
3 deletions
+20
-3
src/views/teacherregistration/teacherregistration.jsx
src/views/teacherregistration/teacherregistration.jsx
+20
-3
No files found.
src/views/teacherregistration/teacherregistration.jsx
View file @
bf28fae9
var
connect
=
require
(
'
react-redux
'
).
connect
;
var
defaults
=
require
(
'
lodash.defaultsdeep
'
);
var
defaults
=
require
(
'
lodash.defaultsdeep
'
);
var
React
=
require
(
'
react
'
);
var
React
=
require
(
'
react
'
);
var
render
=
require
(
'
../../lib/render.jsx
'
);
var
render
=
require
(
'
../../lib/render.jsx
'
);
var
api
=
require
(
'
../../lib/api
'
);
var
api
=
require
(
'
../../lib/api
'
);
var
sessionActions
=
require
(
'
../../redux/session.js
'
);
var
Deck
=
require
(
'
../../components/deck/deck.jsx
'
);
var
Deck
=
require
(
'
../../components/deck/deck.jsx
'
);
var
Progression
=
require
(
'
../../components/progression/progression.jsx
'
);
var
Progression
=
require
(
'
../../components/progression/progression.jsx
'
);
...
@@ -67,12 +69,16 @@ var TeacherRegistration = React.createClass({
...
@@ -67,12 +69,16 @@ var TeacherRegistration = React.createClass({
},
function
(
err
,
res
)
{
},
function
(
err
,
res
)
{
this
.
setState
({
waiting
:
false
});
this
.
setState
({
waiting
:
false
});
if
(
err
)
return
this
.
setState
({
registrationError
:
err
});
if
(
err
)
return
this
.
setState
({
registrationError
:
err
});
if
(
res
[
0
].
success
)
return
this
.
advanceStep
(
formData
);
if
(
res
[
0
].
success
)
{
this
.
props
.
dispatch
(
sessionActions
.
refreshSession
());
return
this
.
advanceStep
(
formData
);
}
this
.
setState
({
registrationError
:
res
[
0
].
msg
});
this
.
setState
({
registrationError
:
res
[
0
].
msg
});
}.
bind
(
this
));
}.
bind
(
this
));
},
},
render
:
function
()
{
render
:
function
()
{
var
permissions
=
this
.
props
.
session
.
permissions
||
{};
return
(
return
(
<
Deck
className=
"teacher-registration"
>
<
Deck
className=
"teacher-registration"
>
{
this
.
state
.
registrationError
?
{
this
.
state
.
registrationError
?
...
@@ -101,7 +107,10 @@ var TeacherRegistration = React.createClass({
...
@@ -101,7 +107,10 @@ var TeacherRegistration = React.createClass({
waiting=
{
this
.
state
.
waiting
}
/>
waiting=
{
this
.
state
.
waiting
}
/>
<
Steps
.
EmailStep
onNextStep=
{
this
.
register
}
<
Steps
.
EmailStep
onNextStep=
{
this
.
register
}
waiting=
{
this
.
state
.
waiting
}
/>
waiting=
{
this
.
state
.
waiting
}
/>
<
Steps
.
TeacherApprovalStep
email=
{
this
.
state
.
formData
.
user
&&
this
.
state
.
formData
.
user
.
email
}
/>
<
Steps
.
TeacherApprovalStep
email=
{
this
.
state
.
formData
.
user
&&
this
.
state
.
formData
.
user
.
email
}
confirmed=
{
permissions
.
social
}
invited=
{
permissions
.
educator_invitee
}
educator=
{
permissions
.
educator
}
/>
</
Progression
>
</
Progression
>
}
}
</
Deck
>
</
Deck
>
...
@@ -109,4 +118,12 @@ var TeacherRegistration = React.createClass({
...
@@ -109,4 +118,12 @@ var TeacherRegistration = React.createClass({
}
}
});
});
render
(<
TeacherRegistration
/>,
document
.
getElementById
(
'
app
'
));
var
mapStateToProps
=
function
(
state
)
{
return
{
session
:
state
.
session
.
session
};
};
var
ConnectedTeacherRegistration
=
connect
(
mapStateToProps
)(
TeacherRegistration
);
render
(<
ConnectedTeacherRegistration
/>,
document
.
getElementById
(
'
app
'
));
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment