Commit 37538367 authored by Juorder Antonio's avatar Juorder Antonio

fix issue in view edit, to set the current state of the account

parent 2384b73a
...@@ -29,6 +29,7 @@ export default class EditMailBox extends React.Component { ...@@ -29,6 +29,7 @@ export default class EditMailBox extends React.Component {
super(props); super(props);
this.isStoreEnabled = window.manager_config.enableStores; this.isStoreEnabled = window.manager_config.enableStores;
this.changeStatus = this.changeStatus.bind(this);
this.handleEdit = this.handleEdit.bind(this); this.handleEdit = this.handleEdit.bind(this);
this.handleRadioChanged = this.handleRadioChanged.bind(this); this.handleRadioChanged = this.handleRadioChanged.bind(this);
this.getMailbox = this.getMailbox.bind(this); this.getMailbox = this.getMailbox.bind(this);
...@@ -47,7 +48,8 @@ export default class EditMailBox extends React.Component { ...@@ -47,7 +48,8 @@ export default class EditMailBox extends React.Component {
this.currentPlan = ''; this.currentPlan = '';
this.state = { this.state = {
zimbraCOSId: '' zimbraCOSId: '',
zimbraAccountStatus: ''
}; };
} }
...@@ -58,6 +60,15 @@ export default class EditMailBox extends React.Component { ...@@ -58,6 +60,15 @@ export default class EditMailBox extends React.Component {
}); });
} }
changeStatus(e) {
const select = e.target;
const zimbraAccountStatus = select.value;
this.setState({
zimbraAccountStatus
});
}
handleRadioChanged(e, val) { handleRadioChanged(e, val) {
const {enabledAccounts} = this.state; const {enabledAccounts} = this.state;
let needToUpgrade = false; let needToUpgrade = false;
...@@ -610,6 +621,7 @@ export default class EditMailBox extends React.Component { ...@@ -610,6 +621,7 @@ export default class EditMailBox extends React.Component {
this.setState({ this.setState({
data, data,
zimbraCOSId: data.attrs.zimbraCOSId, zimbraCOSId: data.attrs.zimbraCOSId,
zimbraAccountStatus: data.attrs.zimbraAccountStatus,
domains, domains,
cos: this.cos cos: this.cos
}); });
...@@ -665,6 +677,7 @@ export default class EditMailBox extends React.Component { ...@@ -665,6 +677,7 @@ export default class EditMailBox extends React.Component {
this.setState({ this.setState({
data: account, data: account,
zimbraCOSId: account.attrs.zimbraCOSId, zimbraCOSId: account.attrs.zimbraCOSId,
zimbraAccountStatus: account.attrs.zimbraAccountStatus,
domains, domains,
cos: this.cos cos: this.cos
}); });
...@@ -717,7 +730,7 @@ export default class EditMailBox extends React.Component { ...@@ -717,7 +730,7 @@ export default class EditMailBox extends React.Component {
let currentDomain = ''; let currentDomain = '';
const cosElements = []; const cosElements = [];
const {cos} = this.state; const {cos} = this.state;
const {zimbraCOSId} = this.state; const {zimbraCOSId, zimbraAccountStatus} = this.state;
let enableAccounts; let enableAccounts;
let counterPlans = 9999; let counterPlans = 9999;
...@@ -999,6 +1012,8 @@ export default class EditMailBox extends React.Component { ...@@ -999,6 +1012,8 @@ export default class EditMailBox extends React.Component {
<select <select
className='form-control' className='form-control'
ref='zimbraAccountStatus' ref='zimbraAccountStatus'
value={zimbraAccountStatus}
onChange={this.changeStatus}
> >
{options} {options}
</select> </select>
......
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