// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import * as Utils from '../utils/utils.jsx';
import LoginEmail from './login_email.jsx';
import LoginLdap from './login_ldap.jsx';
export default class Login extends React.Component {
constructor(props) {
super(props);
this.state = {};
}
render() {
const teamDisplayName = this.props.teamDisplayName;
const teamName = this.props.teamName;
let loginMessage = [];
if (global.window.mm_config.EnableSignUpWithGitLab === 'true') {
loginMessage.push(
{'with GitLab'}
);
}
if (global.window.mm_config.EnableSignUpWithGoogle === 'true') {
loginMessage.push(
{'with Google Apps'}
);
}
const verifiedParam = Utils.getUrlParameter('verified');
let verifiedBox = '';
if (verifiedParam) {
verifiedBox = (
{' Email Verified'}
);
}
let emailSignup;
if (global.window.mm_config.EnableSignUpWithEmail === 'true') {
emailSignup = (
);
}
if (loginMessage.length > 0 && emailSignup) {
loginMessage = (
);
}
let forgotPassword;
if (emailSignup) {
forgotPassword = (
);
}
let userSignUp = null;
if (this.props.inviteId) {
userSignUp = (
);
}
let teamSignUp = null;
if (global.window.mm_config.EnableTeamCreation === 'true') {
teamSignUp = (
);
}
let ldapLogin = null;
if (global.window.mm_config.EnableLdap === 'true') {
ldapLogin = (
);
}
return (
{'Sign in to:'}
{teamDisplayName}
{'on '}{global.window.mm_config.SiteName}
{verifiedBox}
{loginMessage}
{emailSignup}
{ldapLogin}
{userSignUp}
{forgotPassword}
{teamSignUp}
);
}
}
Login.defaultProps = {
teamName: '',
teamDisplayName: ''
};
Login.propTypes = {
teamName: React.PropTypes.string,
teamDisplayName: React.PropTypes.string,
inviteId: React.PropTypes.string
};