Commit 0456f57e authored by Juorder Gonzalez's avatar Juorder Gonzalez Committed by GitHub

Merge pull request #218 from ZBoxApp/issues_beta_v1

fix the wat on we identify archive account, throw regexp store in jso…
parents 10d07132 8685e86c
...@@ -228,9 +228,9 @@ export default class EditMailBox extends React.Component { ...@@ -228,9 +228,9 @@ export default class EditMailBox extends React.Component {
let shouldEnableArchiving = false; let shouldEnableArchiving = false;
let shouldDisabledArchiving = false; let shouldDisabledArchiving = false;
const plans = this.state.cos; const plans = this.state.cos;
const mailbox = this.state.data.attrs; const mailbox = this.state.data;
let p; let p;
//Utils.toggleStatusButtons('.action-button', true); Utils.toggleStatusButtons('.action-button', true);
Utils.validateInputRequired(this.refs).then(() => { Utils.validateInputRequired(this.refs).then(() => {
// fill new attrs // fill new attrs
...@@ -248,11 +248,11 @@ export default class EditMailBox extends React.Component { ...@@ -248,11 +248,11 @@ export default class EditMailBox extends React.Component {
keysPlans.forEach((plan) => { keysPlans.forEach((plan) => {
if (plans[plan] === attrs.zimbraCOSId && plansConfig[plan].archiving) { if (plans[plan] === attrs.zimbraCOSId && plansConfig[plan].archiving) {
shouldEnableArchiving = !shouldEnableArchiving; shouldEnableArchiving = !shouldEnableArchiving;
p = plan; p = plansConfig[plan].refer || plan;
} }
}); });
if (mailbox.zimbraCOSId !== attrs.zimbraCOSId && mailbox.zimbraArchiveEnabled === 'TRUE') { if (mailbox.attrs.zimbraCOSId !== attrs.zimbraCOSId && mailbox.archiveEnabled) {
shouldDisabledArchiving = !shouldDisabledArchiving; shouldDisabledArchiving = !shouldDisabledArchiving;
} }
...@@ -286,7 +286,7 @@ export default class EditMailBox extends React.Component { ...@@ -286,7 +286,7 @@ export default class EditMailBox extends React.Component {
}); });
} }
if (shouldEnableArchiving && !shouldDisabledArchiving && mailbox.zimbraArchiveEnabled === 'FALSE') { if (shouldEnableArchiving && !shouldDisabledArchiving && !mailbox.archiveEnabled) {
account.enableArchiving(p, (err) => { account.enableArchiving(p, (err) => {
if (err) { if (err) {
return err; return err;
......
...@@ -25,7 +25,8 @@ ...@@ -25,7 +25,8 @@
"label": "Premium", "label": "Premium",
"isEnabledToEdit": true, "isEnabledToEdit": true,
"forRights": true, "forRights": true,
"archiving": true "archiving": true,
"refer": "archiving"
}, },
"professional": { "professional": {
"statusCos": "btn-primary", "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