Commit 5494e704 authored by Juorder Antonio's avatar Juorder Antonio

identify archive accounts, close modal when adding massive mailboxes, update api zimbra client

parent 33429c38
# -*- mode: ruby -*-
# -*t mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
......
module.exports = {"main":{"js":"/012994bundle.js"}}
\ No newline at end of file
module.exports = {"main":{"js":"/275274bundle.js"}}
\ No newline at end of file
......@@ -15,6 +15,7 @@ export default class ImportMassiveModal extends React.Component {
super(props);
this.isDEV = window.manager_config.DEV;
this.isStoreEnabled = window.manager_config.enableStores;
this.createMassiveAccounts = this.createMassiveAccounts.bind(this);
this.onSubmit = this.onSubmit.bind(this);
this.buildCols = this.buildCols.bind(this);
......@@ -38,7 +39,7 @@ export default class ImportMassiveModal extends React.Component {
this.plans = Utils.getEnabledPlansByCos(ZimbraStore.getAllCos());
this.limit = 200;
this.limit = 50;
this.state = {
options: this.options
......@@ -288,6 +289,11 @@ export default class ImportMassiveModal extends React.Component {
let runAgain = false;
let loop = 0;
//Aqui va error batchrequest
if (this.props.show) {
this.props.onHide();
}
for (const account in accounts) {
if (accounts.hasOwnProperty(account)) {
const zimbraCOS = this.isDEV ? accounts[account].zimbraCOSId.trim().toLowerCase() : Utils.titleCase(accounts[account].zimbraCOSId.trim());
......@@ -337,7 +343,9 @@ export default class ImportMassiveModal extends React.Component {
for (let i = 0; i < length; i++) {
const account = response.CreateAccountResponse[i].account[0];
const accountFormatted = Client.buildAccountByObject(account);
MailboxStore.setMailbox(accountFormatted);
if (this.isStoreEnabled) {
MailboxStore.setMailbox(accountFormatted);
}
}
MailboxStore.emitAddMassive();
......
......@@ -34,6 +34,7 @@ export default class CreateMailBox extends React.Component {
this.cacheDomain = null;
this.state = {};
this.s = true;
}
handlePasswd(e) {
......@@ -341,6 +342,17 @@ export default class CreateMailBox extends React.Component {
this.getAllDomains();
GlobalActions.emitEndLoading();
this.addBlurListeneronInput();
/*console.log(this.s);
setTimeout(() => {
console.log('setTimeout', this.s);
if (this.s) {
console.log('set state');
this.setState({
flag: true
})
}
}, 10000);*/
}
componentWillUnmount() {
......@@ -349,6 +361,11 @@ export default class CreateMailBox extends React.Component {
this.cacheDomain = null;
const parent = document.getElementById('add-mailbox');
parent.removeEventListener('focusout', null);
this.s = false;
}
shouldComponentUpdate() {
return true;
}
controllerDataList(controller) {
......
......@@ -202,8 +202,7 @@ export default class Mailboxes extends React.Component {
};
this.setState({
loading: true,
data: null
loading: true
});
const attrneeded = Utils.getAttrsBySectionFromConfig('mailboxes');
......@@ -245,7 +244,6 @@ export default class Mailboxes extends React.Component {
if (hasMailboxes) {
return resolve(MailboxStore.getMailboxes());
}
return Client.getAllAccounts(attrs, (success) => {
const data = Utils.extractLockOuts(success);
if (this.isStoreEnabled) {
......@@ -276,7 +274,8 @@ export default class Mailboxes extends React.Component {
return this.setState({
data: tables,
loading: false
loading: false,
ac: data.account
});
}
......@@ -331,8 +330,9 @@ export default class Mailboxes extends React.Component {
data: tables
});
}
return this.getAllMailboxes();
const domainId = this.props.params.domain_id;
this.domainId = domainId;
return this.getAllMailboxes(domainId);
}
componentDidMount() {
......@@ -365,7 +365,7 @@ export default class Mailboxes extends React.Component {
}
if (!tipo) {
tipo = 'Desconocido';
tipo = row.archiveEnabled ? 'Archiving' : 'Desconocido';
}
displayName = attrs.displayName || `${attrs.givenName || attrs.cn} ${attrs.sn}`;
......
......@@ -24,7 +24,8 @@
"statusCos": "btn-primary2",
"label": "Premium",
"isEnabledToEdit": true,
"forRights": true
"forRights": true,
"archiving": true
},
"professional": {
"statusCos": "btn-primary",
......
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