Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
mattermost-webapp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
sysadmin
mattermost
mattermost-webapp
Commits
b9897a36
Commit
b9897a36
authored
Dec 05, 2018
by
Saturnino Abril
Committed by
Harrison Healey
Dec 04, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix redirect to default team and channel on team invite link (#2119)
parent
39ca658b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
57 deletions
+48
-57
components/signup/signup_controller/signup_controller.jsx
components/signup/signup_controller/signup_controller.jsx
+3
-3
components/signup/signup_email/signup_email.jsx
components/signup/signup_email/signup_email.jsx
+45
-54
No files found.
components/signup/signup_controller/signup_controller.jsx
View file @
b9897a36
...
@@ -113,14 +113,14 @@ export default class SignupController extends React.Component {
...
@@ -113,14 +113,14 @@ export default class SignupController extends React.Component {
}
}
getInviteInfo
=
async
(
inviteId
)
=>
{
getInviteInfo
=
async
(
inviteId
)
=>
{
const
{
data
}
=
await
this
.
props
.
actions
.
getTeamInviteInfo
(
inviteId
);
const
{
data
,
error
}
=
await
this
.
props
.
actions
.
getTeamInviteInfo
(
inviteId
);
if
(
data
)
{
if
(
data
)
{
this
.
setState
({
this
.
setState
({
serverError
:
''
,
serverError
:
''
,
loading
:
false
,
loading
:
false
,
});
});
}
else
{
}
else
if
(
error
)
{
this
.
handleInvalidInvite
();
this
.
handleInvalidInvite
(
error
);
}
}
}
}
...
...
components/signup/signup_email/signup_email.jsx
View file @
b9897a36
...
@@ -42,72 +42,63 @@ export default class SignupEmail extends React.Component {
...
@@ -42,72 +42,63 @@ export default class SignupEmail extends React.Component {
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
this
.
state
=
this
.
getInviteInfo
();
const
data
=
(
new
URLSearchParams
(
this
.
props
.
location
.
search
)).
get
(
'
d
'
);
const
token
=
(
new
URLSearchParams
(
this
.
props
.
location
.
search
)).
get
(
'
t
'
);
const
inviteId
=
(
new
URLSearchParams
(
this
.
props
.
location
.
search
)).
get
(
'
id
'
);
this
.
state
=
{};
if
(
token
&&
token
.
length
>
0
)
{
this
.
state
=
this
.
getTokenData
(
token
,
data
);
}
else
if
(
inviteId
&&
inviteId
.
length
>
0
)
{
this
.
state
=
{
loading
:
true
,
inviteId
,
};
}
}
}
componentDidMount
()
{
componentDidMount
()
{
trackEvent
(
'
signup
'
,
'
signup_user_01_welcome
'
);
trackEvent
(
'
signup
'
,
'
signup_user_01_welcome
'
);
}
getInviteInfo
=
async
()
=>
{
const
{
inviteId
}
=
this
.
state
;
let
data
=
(
new
URLSearchParams
(
this
.
props
.
location
.
search
)).
get
(
'
d
'
);
if
(
inviteId
&&
inviteId
.
length
>
0
)
{
let
token
=
(
new
URLSearchParams
(
this
.
props
.
location
.
search
)).
get
(
'
t
'
);
this
.
getInviteInfo
(
inviteId
);
const
inviteId
=
(
new
URLSearchParams
(
this
.
props
.
location
.
search
)).
get
(
'
id
'
);
let
email
=
''
;
let
teamDisplayName
=
''
;
let
teamName
=
''
;
let
teamId
=
''
;
let
loading
=
false
;
const
serverError
=
''
;
const
noOpenServerError
=
false
;
if
(
token
&&
token
.
length
>
0
)
{
const
parsedData
=
JSON
.
parse
(
data
);
email
=
parsedData
.
email
;
teamDisplayName
=
parsedData
.
display_name
;
teamName
=
parsedData
.
name
;
teamId
=
parsedData
.
id
;
}
else
if
(
inviteId
&&
inviteId
.
length
>
0
)
{
loading
=
true
;
data
=
null
;
token
=
null
;
const
{
data
:
inviteData
,
error
}
=
await
this
.
props
.
actions
.
getTeamInviteInfo
(
inviteId
);
if
(
inviteData
)
{
this
.
setState
({
loading
:
false
,
serverError
:
''
,
teamDisplayName
:
inviteData
.
display_name
,
teamName
:
inviteData
.
name
,
teamId
:
inviteData
.
id
,
});
}
else
if
(
error
)
{
this
.
setState
({
loading
:
false
,
noOpenServerError
:
true
,
serverError
:
(
<
FormattedMessage
id
=
'signup_user_completed.invalid_invite'
defaultMessage
=
'The invite link was invalid. Please speak with your Administrator to receive an invitation.'
/>
),
});
}
}
}
}
getTokenData
=
(
token
,
data
)
=>
{
const
parsedData
=
JSON
.
parse
(
data
);
return
{
return
{
data
,
loading
:
false
,
token
,
token
,
email
,
email
:
parsedData
.
email
,
teamDisplayName
,
teamName
:
parsedData
.
name
,
teamName
,
teamId
,
inviteId
,
loading
,
serverError
,
noOpenServerError
,
};
};
}
}
getInviteInfo
=
async
(
inviteId
)
=>
{
const
{
data
,
error
}
=
await
this
.
props
.
actions
.
getTeamInviteInfo
(
inviteId
);
if
(
data
)
{
this
.
setState
({
loading
:
false
,
noOpenServerError
:
false
,
serverError
:
''
,
teamName
:
data
.
name
,
});
}
else
if
(
error
)
{
this
.
setState
({
loading
:
false
,
noOpenServerError
:
true
,
serverError
:
(
<
FormattedMessage
id
=
'signup_user_completed.invalid_invite'
defaultMessage
=
'The invite link was invalid. Please speak with your Administrator to receive an invitation.'
/>
),
});
}
}
handleSignupSuccess
=
(
user
,
data
)
=>
{
handleSignupSuccess
=
(
user
,
data
)
=>
{
trackEvent
(
'
signup
'
,
'
signup_user_02_complete
'
);
trackEvent
(
'
signup
'
,
'
signup_user_02_complete
'
);
...
...
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