UI fix for errors in signup and login pages and adding space between buttons in the security tab (#3512)
* Fixing the errors style on login and signup pages * Adding space between login options in the security section
Этот коммит содержится в:
коммит произвёл
Corey Hulen
родитель
31a0f65973
Коммит
3eee51f74e
@@ -8,6 +8,7 @@ export default class FormError extends React.Component {
|
|||||||
// accepts either a single error or an array of errors
|
// accepts either a single error or an array of errors
|
||||||
return {
|
return {
|
||||||
error: React.PropTypes.node,
|
error: React.PropTypes.node,
|
||||||
|
margin: React.PropTypes.node,
|
||||||
errors: React.PropTypes.arrayOf(React.PropTypes.node)
|
errors: React.PropTypes.arrayOf(React.PropTypes.node)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -39,6 +40,16 @@ export default class FormError extends React.Component {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.props.margin) {
|
||||||
|
return (
|
||||||
|
<div className='form-group has-error'>
|
||||||
|
<label className='control-label'>
|
||||||
|
{message}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='col-sm-12 has-error'>
|
<div className='col-sm-12 has-error'>
|
||||||
<label className='control-label'>
|
<label className='control-label'>
|
||||||
|
|||||||
@@ -336,7 +336,10 @@ export default class LoginController extends React.Component {
|
|||||||
onSubmit={this.preSubmit}
|
onSubmit={this.preSubmit}
|
||||||
>
|
>
|
||||||
<div className='signup__email-container'>
|
<div className='signup__email-container'>
|
||||||
<FormError error={this.state.serverError}/>
|
<FormError
|
||||||
|
error={this.state.serverError}
|
||||||
|
margin={true}
|
||||||
|
/>
|
||||||
<div className={'form-group' + errorClass}>
|
<div className={'form-group' + errorClass}>
|
||||||
<input
|
<input
|
||||||
className='form-control'
|
className='form-control'
|
||||||
|
|||||||
@@ -393,7 +393,10 @@ export default class SignupUserComplete extends React.Component {
|
|||||||
onSubmit={this.handleLdapSignup}
|
onSubmit={this.handleLdapSignup}
|
||||||
>
|
>
|
||||||
<div className='signup__email-container'>
|
<div className='signup__email-container'>
|
||||||
<FormError error={this.state.ldapError}/>
|
<FormError
|
||||||
|
error={this.state.ldapError}
|
||||||
|
margin={true}
|
||||||
|
/>
|
||||||
<div className={'form-group' + errorClass}>
|
<div className={'form-group' + errorClass}>
|
||||||
<input
|
<input
|
||||||
className='form-control'
|
className='form-control'
|
||||||
|
|||||||
@@ -551,7 +551,7 @@ class SecurityTab extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
emailOption = (
|
emailOption = (
|
||||||
<div>
|
<div className='padding-bottom x2'>
|
||||||
<Link
|
<Link
|
||||||
className='btn btn-primary'
|
className='btn btn-primary'
|
||||||
to={link}
|
to={link}
|
||||||
@@ -569,7 +569,7 @@ class SecurityTab extends React.Component {
|
|||||||
let gitlabOption;
|
let gitlabOption;
|
||||||
if (global.window.mm_config.EnableSignUpWithGitLab === 'true' && user.auth_service === '') {
|
if (global.window.mm_config.EnableSignUpWithGitLab === 'true' && user.auth_service === '') {
|
||||||
gitlabOption = (
|
gitlabOption = (
|
||||||
<div>
|
<div className='padding-bottom x2'>
|
||||||
<Link
|
<Link
|
||||||
className='btn btn-primary'
|
className='btn btn-primary'
|
||||||
to={'/claim/email_to_oauth?email=' + encodeURIComponent(user.email) + '&old_type=' + user.auth_service + '&new_type=' + Constants.GITLAB_SERVICE}
|
to={'/claim/email_to_oauth?email=' + encodeURIComponent(user.email) + '&old_type=' + user.auth_service + '&new_type=' + Constants.GITLAB_SERVICE}
|
||||||
@@ -587,7 +587,7 @@ class SecurityTab extends React.Component {
|
|||||||
let googleOption;
|
let googleOption;
|
||||||
if (global.window.mm_config.EnableSignUpWithGoogle === 'true' && user.auth_service === '') {
|
if (global.window.mm_config.EnableSignUpWithGoogle === 'true' && user.auth_service === '') {
|
||||||
googleOption = (
|
googleOption = (
|
||||||
<div>
|
<div className='padding-bottom x2'>
|
||||||
<Link
|
<Link
|
||||||
className='btn btn-primary'
|
className='btn btn-primary'
|
||||||
to={'/' + teamName + '/claim/email_to_oauth?email=' + encodeURIComponent(user.email) + '&old_type=' + user.auth_service + '&new_type=' + Constants.GOOGLE_SERVICE}
|
to={'/' + teamName + '/claim/email_to_oauth?email=' + encodeURIComponent(user.email) + '&old_type=' + user.auth_service + '&new_type=' + Constants.GOOGLE_SERVICE}
|
||||||
@@ -605,7 +605,7 @@ class SecurityTab extends React.Component {
|
|||||||
let ldapOption;
|
let ldapOption;
|
||||||
if (global.window.mm_config.EnableLdap === 'true' && user.auth_service === '') {
|
if (global.window.mm_config.EnableLdap === 'true' && user.auth_service === '') {
|
||||||
ldapOption = (
|
ldapOption = (
|
||||||
<div>
|
<div className='padding-bottom x2'>
|
||||||
<Link
|
<Link
|
||||||
className='btn btn-primary'
|
className='btn btn-primary'
|
||||||
to={'/claim/email_to_ldap?email=' + encodeURIComponent(user.email)}
|
to={'/claim/email_to_ldap?email=' + encodeURIComponent(user.email)}
|
||||||
@@ -623,7 +623,7 @@ class SecurityTab extends React.Component {
|
|||||||
let samlOption;
|
let samlOption;
|
||||||
if (global.window.mm_config.EnableSaml === 'true' && user.auth_service === '') {
|
if (global.window.mm_config.EnableSaml === 'true' && user.auth_service === '') {
|
||||||
samlOption = (
|
samlOption = (
|
||||||
<div>
|
<div className='padding-bottom x2'>
|
||||||
<Link
|
<Link
|
||||||
className='btn btn-primary'
|
className='btn btn-primary'
|
||||||
to={'/claim/email_to_oauth?email=' + encodeURIComponent(user.email) + '&old_type=' + user.auth_service + '&new_type=' + Constants.SAML_SERVICE}
|
to={'/claim/email_to_oauth?email=' + encodeURIComponent(user.email) + '&old_type=' + user.auth_service + '&new_type=' + Constants.SAML_SERVICE}
|
||||||
@@ -643,7 +643,6 @@ class SecurityTab extends React.Component {
|
|||||||
<div key='userSignInOption'>
|
<div key='userSignInOption'>
|
||||||
{emailOption}
|
{emailOption}
|
||||||
{gitlabOption}
|
{gitlabOption}
|
||||||
<br/>
|
|
||||||
{ldapOption}
|
{ldapOption}
|
||||||
{samlOption}
|
{samlOption}
|
||||||
{googleOption}
|
{googleOption}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user