Commit c1cdb9c4 authored by Juorder Gonzalez's avatar Juorder Gonzalez Committed by GitHub

Merge pull request #206 from ZBoxApp/issues_resolved_manager

fix error when add or remove admin, add more delay to refresh DL, fix…
parents 60df27e1 6883d78b
...@@ -50,8 +50,6 @@ export default class DomainAdminList extends React.Component { ...@@ -50,8 +50,6 @@ export default class DomainAdminList extends React.Component {
} }
return Client.getDomain(domain.name, (data) => { return Client.getDomain(domain.name, (data) => {
this.props.domain = data;
return data.getAdmins((err, res) => { return data.getAdmins((err, res) => {
const admins = res.account || []; const admins = res.account || [];
if (this.isStoreEnabled) { if (this.isStoreEnabled) {
......
...@@ -44,7 +44,6 @@ export default class DomainDistributionList extends React.Component { ...@@ -44,7 +44,6 @@ export default class DomainDistributionList extends React.Component {
setTimeout(() => { setTimeout(() => {
domain.getAllDistributionLists( domain.getAllDistributionLists(
(err, lists) => { (err, lists) => {
console.log('getAllDL', lists); //eslint-disable-line no-console
if (this.isStoreEnabled) { if (this.isStoreEnabled) {
DomainStore.setDistibutionLists(domain, lists); DomainStore.setDistibutionLists(domain, lists);
} }
...@@ -52,7 +51,7 @@ export default class DomainDistributionList extends React.Component { ...@@ -52,7 +51,7 @@ export default class DomainDistributionList extends React.Component {
this.setState({lists}); this.setState({lists});
} }
); );
}, 100); }, 1000);
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
const page = parseInt(nextProps.location.query.page, 10) || 1; const page = parseInt(nextProps.location.query.page, 10) || 1;
...@@ -64,7 +63,6 @@ export default class DomainDistributionList extends React.Component { ...@@ -64,7 +63,6 @@ export default class DomainDistributionList extends React.Component {
onListsChange() { onListsChange() {
const lists = this.isStoreEnabled ? DomainStore.getDistributionLists(this.props.domain) : null; const lists = this.isStoreEnabled ? DomainStore.getDistributionLists(this.props.domain) : null;
if (!lists) { if (!lists) {
console.log('no store'); //eslint-disable-line no-console
return this.getLists(); return this.getLists();
} }
......
...@@ -68,7 +68,11 @@ export default class Domains extends React.Component { ...@@ -68,7 +68,11 @@ export default class Domains extends React.Component {
}); });
data.total = data.domain.length; data.total = data.domain.length;
domains = data.domain; domains = data.domain;
if (this.isStoreEnabled) {
DomainStore.setDomains(data); DomainStore.setDomains(data);
}
this.getPlans(domains). this.getPlans(domains).
then(() => { then(() => {
self.setState({ self.setState({
...@@ -256,7 +260,9 @@ export default class Domains extends React.Component { ...@@ -256,7 +260,9 @@ export default class Domains extends React.Component {
<a <a
href='#' href='#'
onClick={(e) => { onClick={(e) => {
if (this.isStoreEnabled) {
DomainStore.setCurrent(d); DomainStore.setCurrent(d);
}
Utils.handleLink(e, `/domains/${d.id}`); Utils.handleLink(e, `/domains/${d.id}`);
}} }}
> >
......
...@@ -14,6 +14,9 @@ export default class ImportMassiveModal extends React.Component { ...@@ -14,6 +14,9 @@ export default class ImportMassiveModal extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.isDEV = window.manager_config.DEV;
this.createMassiveAccounts = this.createMassiveAccounts.bind(this);
this.onSubmit = this.onSubmit.bind(this);
this.buildCols = this.buildCols.bind(this); this.buildCols = this.buildCols.bind(this);
this.options = { this.options = {
email: 'email', email: 'email',
...@@ -287,7 +290,8 @@ export default class ImportMassiveModal extends React.Component { ...@@ -287,7 +290,8 @@ export default class ImportMassiveModal extends React.Component {
for (const account in accounts) { for (const account in accounts) {
if (accounts.hasOwnProperty(account)) { if (accounts.hasOwnProperty(account)) {
accounts[account].zimbraCOSId = this.plans[accounts[account].zimbraCOSId.toLowerCase()]; const zimbraCOS = this.isDEV ? accounts[account].zimbraCOSId.trim().toLowerCase() : Utils.titleCase(accounts[account].zimbraCOSId.trim());
accounts[account].zimbraCOSId = this.plans[zimbraCOS];
const email = accounts[account].email; const email = accounts[account].email;
const passwd = accounts[account].passwd; const passwd = accounts[account].passwd;
if (passwd.length < 8) { if (passwd.length < 8) {
...@@ -352,6 +356,19 @@ export default class ImportMassiveModal extends React.Component { ...@@ -352,6 +356,19 @@ export default class ImportMassiveModal extends React.Component {
this.props.onHide(); this.props.onHide();
} }
if (response.Fault) {
const total = response.Fault.length;
const message = total === 1 ? `Hubo un error en ${total} casilla : ${response.Fault[0].Reason.Text}` : `Hubo un error en ${total} casillas`;
return GlobalActions.emitEndTask({
id: 'casillamasiva',
toast: {
message,
title: 'Mailbox - Carga Masiva',
type: 'error'
}
});
}
return GlobalActions.emitEndTask({ return GlobalActions.emitEndTask({
id: 'casillamasiva', id: 'casillamasiva',
toast: { toast: {
......
...@@ -32,7 +32,7 @@ export default class ProgressTask extends React.Component { ...@@ -32,7 +32,7 @@ export default class ProgressTask extends React.Component {
if (arrTasks[i].id === params.id) { if (arrTasks[i].id === params.id) {
this.tasks.splice(i, 1); this.tasks.splice(i, 1);
EventStore.emitToast({ EventStore.emitToast({
type: 'success', type: params.toast.type || 'success',
title: params.toast.title, title: params.toast.title,
body: params.toast.message, body: params.toast.message,
options: { options: {
......
{ {
"debug": true, "debug": true,
"DEV": true,
"enableStores" : false, "enableStores" : false,
"zimbraUrl": "http://zimbra.zboxapp.dev:9081/zimbra_proxy/service/admin/soap", "zimbraUrl": "http://zimbra.zboxapp.dev:9081/zimbra_proxy/service/admin/soap",
"zimbraProxy": "https://192.168.1.8:7071", "zimbraProxy": "https://192.168.1.8:7071",
......
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