Commit 97fffa12 authored by Juorder Gonzalez's avatar Juorder Gonzalez

Merge pull request #151 from ZBoxApp/issues_resolved_manager

add loading icon on when login is fired, add messagebar on add admin,…
parents f76b13db 59bc3851
module.exports = {"main":{"js":"/534318bundle.js"}}
\ No newline at end of file
module.exports = {"main":{"js":"/354185bundle.js"}}
\ No newline at end of file
......@@ -193,27 +193,30 @@ export default class Companies extends React.Component {
}
render() {
if (!this.state.companies) {
return <div/>;
}
let panelBody;
let noLimitError;
let pagination = null;
const textLoading = this.isGlobalAdmin ? 'Cargando Empresas...' : 'Cargando Mi Empresa...';
if (this.state.loading) {
panelBody = (
<div className='text-center'>
if (!this.state.companies && this.state.loading) {
return (
<div
key='panelbody-loading.company'
className='text-center content animate-panel'
>
<i className='fa fa-spinner fa-spin fa-4x fa-fw'></i>
<p>{textLoading}</p>
</div>
);
}
let panelBody;
let noLimitError;
let pagination = null;
if (this.state.companies.length === 0) {
panelBody = (
<div className='center-block text-center'>
<div
key='panelbody-nofound'
className='center-block text-center'
>
<h5>
{'Actualmente no hay ninguna empresa registrada '}
<label style={{transform: 'rotate(90deg)'}}>
......@@ -305,7 +308,10 @@ export default class Companies extends React.Component {
});
panelBody = (
<div className='table-responsive'>
<div
key='panelbody-companies'
className='table-responsive'
>
<div className='table-responsive'>
<table
cellPadding='1'
......
......@@ -86,6 +86,16 @@ export default class AddAdminModal extends React.Component {
});
}
if (this.props.show) {
this.props.onHide();
setTimeout(() => {
GlobalActions.emitMessage({
message: 'Se ha agregado su administrador éxitoxamente.',
type: Constants.MessageType.SUCCESS
});
}, 1000);
}
return DomainStore.addAdmin(user);
}
);
......
......@@ -10,6 +10,7 @@ import ZimbraStore from '../../stores/zimbra_store.jsx';
import Constants from '../../utils/constants.jsx';
import * as Client from '../../utils/client.jsx';
import * as Utils from '../../utils/utils.jsx';
import Panel from '../panel.jsx';
import LoginEmail from './login_email.jsx';
......@@ -49,8 +50,9 @@ export default class Login extends React.Component {
browserHistory.push('/mailboxes');
}
}
submit(email, password) {
submit(email, password, refs) {
var state = this.state;
const oldText = refs.submitbutton.innerHTML;
if (!email) {
state.loginError = 'El correo electrónico es obligatorio';
......@@ -64,19 +66,26 @@ export default class Login extends React.Component {
return;
}
refs.submitbutton.innerHTML = '<i class="fa fa-spinner fa-spin fa-1x fa-fw"></i> Cargando ...';
Utils.toggleStatusButtons('.btn-block', true);
this.setState({loginError: null});
Client.login(email, password,
() => {
return Client.getAllCos(
(cosData) => {
refs.submitbutton.innerHTML = oldText;
ZimbraStore.setAllCos(cosData);
Utils.toggleStatusButtons('.btn-block', false);
browserHistory.push('/mailboxes');
}
);
},
(err) => {
refs.submitbutton.innerHTML = oldText;
this.setState({loginError: err.message});
Utils.toggleStatusButtons('.btn-block', false);
}
);
}
......
......@@ -21,7 +21,7 @@ export default class LoginEmail extends React.Component {
const email = this.refs.email.value.trim();
const password = this.refs.password.value.trim();
this.props.submit(email, password);
this.props.submit(email, password, this.refs);
}
render() {
let errorClass = '';
......@@ -64,6 +64,7 @@ export default class LoginEmail extends React.Component {
<button
type='submit'
className='btn btn-success btn-block'
ref='submitbutton'
>
{'Ingresar'}
</button>
......
......@@ -65,7 +65,8 @@
"zimbraPrefOutOfOfficeUntilDate": true,
"zimbraPrefOutOfOfficeReply": true,
"zimbraCreateTimestamp": true,
"zimbraLastLogonTimestamp": true
"zimbraLastLogonTimestamp": true,
"zimbraIsDelegatedAdminAccount": true
}
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment