Commit 4dcc9f62 authored by Juorder Antonio's avatar Juorder Antonio

applt a switch to require or not, stores, fix issues lik, return to correcto...

applt a switch to require or not, stores, fix issues lik, return to correcto domain when delete mailbox, remove the right dns record when using input search, hide buttons actions when is not a global admin on admin list in domain view, add pagination on distribution list, and input search etc.
parent dc7719c1
module.exports = {"main":{"js":"/886953bundle.js"}} module.exports = {"main":{"js":"/738894bundle.js"}}
\ No newline at end of file \ No newline at end of file
...@@ -27,6 +27,7 @@ export default class Companies extends React.Component { ...@@ -27,6 +27,7 @@ export default class Companies extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.isStoreEnabled = window.manager_config.enableStores;
this.getCompanies = this.getCompanies.bind(this); this.getCompanies = this.getCompanies.bind(this);
this.getDomains = this.getDomains.bind(this); this.getDomains = this.getDomains.bind(this);
this.getPlans = this.getPlans.bind(this); this.getPlans = this.getPlans.bind(this);
...@@ -43,13 +44,15 @@ export default class Companies extends React.Component { ...@@ -43,13 +44,15 @@ export default class Companies extends React.Component {
} }
gotoCompany(e, company) { gotoCompany(e, company) {
CompaniesStore.setCurrent(company); if (this.isStoreEnabled) {
CompaniesStore.setCurrent(company);
}
Utils.handleLink(e, `/companies/${company.id}`, this.props.location); Utils.handleLink(e, `/companies/${company.id}`, this.props.location);
} }
getCompanies() { getCompanies() {
const self = this; const self = this;
const companies = CompaniesStore.getCompanies(); const companies = this.isStoreEnabled ? CompaniesStore.getCompanies() : null;
if (companies) { if (companies) {
self.setState({ self.setState({
companies companies
...@@ -66,7 +69,9 @@ export default class Companies extends React.Component { ...@@ -66,7 +69,9 @@ export default class Companies extends React.Component {
}); });
return Promise.all(domains).then((comps) => { return Promise.all(domains).then((comps) => {
CompaniesStore.setCompanies(comps); if (this.isStoreEnabled) {
CompaniesStore.setCompanies(comps);
}
self.setState({ self.setState({
companies: comps, companies: comps,
...@@ -87,10 +92,14 @@ export default class Companies extends React.Component { ...@@ -87,10 +92,14 @@ export default class Companies extends React.Component {
}); });
} }
if (DomainStore.getDomains()) { const domains = this.isStoreEnabled ? DomainStore.getDomains() : null;
const domain = DomainStore.getDomainByName(mydomain);
if (domains) {
const domain = this.isStoreEnabled ? DomainStore.getDomainByName(mydomain) : null;
Client.getCompany(domain.attrs.businessCategory, (company) => { Client.getCompany(domain.attrs.businessCategory, (company) => {
CompaniesStore.setCompanies(company); if (this.isStoreEnabled) {
CompaniesStore.setCompanies(company);
}
}, (error) => { }, (error) => {
self.setState({error: { self.setState({error: {
message: error, message: error,
......
...@@ -16,6 +16,7 @@ export default class CompanyAdmins extends React.Component { ...@@ -16,6 +16,7 @@ export default class CompanyAdmins extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.isStoreEnabled = window.manager_config.enableStores;
this.getCompanyAdmins = this.getCompanyAdmins.bind(this); this.getCompanyAdmins = this.getCompanyAdmins.bind(this);
this.getAdmins = this.getAdmins.bind(this); this.getAdmins = this.getAdmins.bind(this);
...@@ -70,7 +71,9 @@ export default class CompanyAdmins extends React.Component { ...@@ -70,7 +71,9 @@ export default class CompanyAdmins extends React.Component {
d.admins = []; d.admins = [];
} }
CompanyStore.addDomainAdmins(company.id, d); if (this.isStoreEnabled) {
CompanyStore.addDomainAdmins(company.id, d);
}
Reflect.apply(Array.prototype.push, admins, d.admins); Reflect.apply(Array.prototype.push, admins, d.admins);
}); });
......
...@@ -28,6 +28,7 @@ export default class CompaniesDetails extends React.Component { ...@@ -28,6 +28,7 @@ export default class CompaniesDetails extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.isStoreEnabled = window.manager_config.enableStores;
this.state = {}; this.state = {};
this.getCompany = this.getCompany.bind(this); this.getCompany = this.getCompany.bind(this);
...@@ -38,7 +39,7 @@ export default class CompaniesDetails extends React.Component { ...@@ -38,7 +39,7 @@ export default class CompaniesDetails extends React.Component {
getCompany() { getCompany() {
const self = this; const self = this;
const companyId = this.props.params.id; const companyId = this.props.params.id;
const company = CompaniesStore.getCurrent(); const company = this.isStoreEnabled ? CompaniesStore.getCurrent() : null;
if (company) { if (company) {
self.setState({ self.setState({
company company
...@@ -48,7 +49,9 @@ export default class CompaniesDetails extends React.Component { ...@@ -48,7 +49,9 @@ export default class CompaniesDetails extends React.Component {
return Client.getCompany(companyId).then((data) => { return Client.getCompany(companyId).then((data) => {
return self.getDomains(data).then((comp) => { return self.getDomains(data).then((comp) => {
CompaniesStore.setCurrent(comp); if (this.isStoreEnabled) {
CompaniesStore.setCurrent(comp);
}
self.setState({ self.setState({
company: comp company: comp
}); });
...@@ -75,13 +78,17 @@ export default class CompaniesDetails extends React.Component { ...@@ -75,13 +78,17 @@ export default class CompaniesDetails extends React.Component {
}, },
(data) => { (data) => {
const domains = data.domain; const domains = data.domain;
return self.getPlans(domains). if (domains) {
then(() => { return self.getPlans(domains).
company.domains = domains; then(() => {
resolve(company); company.domains = domains;
}).catch((error) => { resolve(company);
reject(error); }).catch((error) => {
}); reject(error);
});
}
return resolve(company);
}, },
(error) => { (error) => {
reject(error); reject(error);
...@@ -121,6 +128,7 @@ export default class CompaniesDetails extends React.Component { ...@@ -121,6 +128,7 @@ export default class CompaniesDetails extends React.Component {
render() { render() {
const company = this.state.company; const company = this.state.company;
if (!company) { if (!company) {
return <div/>; return <div/>;
} }
......
...@@ -13,7 +13,7 @@ import * as Utils from '../../utils/utils.jsx'; ...@@ -13,7 +13,7 @@ import * as Utils from '../../utils/utils.jsx';
export default class CompanyDomains extends React.Component { export default class CompanyDomains extends React.Component {
render() { render() {
const domains = this.props.company.domains; const domains = this.props.company.domains || [];
const isAdmin = UserStore.isGlobalAdmin(); const isAdmin = UserStore.isGlobalAdmin();
let buttons; let buttons;
......
...@@ -37,7 +37,7 @@ export default class CompanyMailboxPlans extends React.Component { ...@@ -37,7 +37,7 @@ export default class CompanyMailboxPlans extends React.Component {
return cos[c]; return cos[c];
}); });
const domains = company.domains; const domains = company.domains || [];
const plans = {}; const plans = {};
let noLimitError; let noLimitError;
......
...@@ -27,6 +27,7 @@ export default class DistributionLists extends React.Component { ...@@ -27,6 +27,7 @@ export default class DistributionLists extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.isStoreEnabled = true;
this.getDistributionLists = this.getDistributionLists.bind(this); this.getDistributionLists = this.getDistributionLists.bind(this);
this.showMessage = this.showMessage.bind(this); this.showMessage = this.showMessage.bind(this);
this.onDeleteMember = this.onDeleteMember.bind(this); this.onDeleteMember = this.onDeleteMember.bind(this);
...@@ -61,15 +62,14 @@ export default class DistributionLists extends React.Component { ...@@ -61,15 +62,14 @@ export default class DistributionLists extends React.Component {
} }
getDistributionLists() { getDistributionLists() {
//const domain = DomainStore.getCurrent(); const domain = this.isStoreEnabled ? DomainStore.getCurrent() : null;
const id = this.props.params.id; const id = this.props.params.id;
const response = {}; const response = {};
const domain = null;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (domain) { if (domain) {
response.domain = domain; response.domain = domain;
const dl = DomainStore.getDistributionListById(id, domain); const dl = this.isStoreEnabled ? DomainStore.getDistributionListById(id, domain) : null;
response.distributionsList = dl; response.distributionsList = dl;
dl.getOwners((error, owners) => { dl.getOwners((error, owners) => {
...@@ -102,13 +102,15 @@ export default class DistributionLists extends React.Component { ...@@ -102,13 +102,15 @@ export default class DistributionLists extends React.Component {
reject(error); reject(error);
}); });
}).then((data) => { }).then((data) => {
DomainStore.setOwners(data.owners); if (this.isStoreEnabled) {
DomainStore.setMembers(data.distributionsList.members); DomainStore.setOwners(data.owners);
DomainStore.setMembers(data.distributionsList.members);
}
this.setState({ this.setState({
distributionsList: data.distributionsList, distributionsList: data.distributionsList,
members: DomainStore.getMembers(), members: this.isStoreEnabled ? DomainStore.getMembers() : data.distributionsList.members,
owners: DomainStore.getOwners(), owners: this.isStoreEnabled ? DomainStore.getOwners() : data.owners,
domain: data.domain domain: data.domain
}); });
}).catch((error) => { }).catch((error) => {
...@@ -124,12 +126,14 @@ export default class DistributionLists extends React.Component { ...@@ -124,12 +126,14 @@ export default class DistributionLists extends React.Component {
onSubmitOwners(response) { onSubmitOwners(response) {
if (response.refresh) { if (response.refresh) {
response.refresh.forEach((member) => { response.refresh.forEach((member) => {
DomainStore.addOwners(member); if (this.isStoreEnabled) {
DomainStore.addOwners(member);
}
}); });
} }
this.multipleActionsOwners(response, this.state.distributionsList).then((res) => { this.multipleActionsOwners(response, this.state.distributionsList).then((res) => {
//const newOwners = DomainStore.getOwners(); //const newOwners = this.isStoreEnabled ? DomainStore.getOwners() : null;
const errors = []; const errors = [];
const limit = res.length; const limit = res.length;
...@@ -156,7 +160,9 @@ export default class DistributionLists extends React.Component { ...@@ -156,7 +160,9 @@ export default class DistributionLists extends React.Component {
Client.getDistributionList(id, (success) => { Client.getDistributionList(id, (success) => {
success.getOwners((error, owners) => { success.getOwners((error, owners) => {
if (owners) { if (owners) {
DomainStore.setOwners(owners); if (this.isStoreEnabled) {
DomainStore.setOwners(owners);
}
this.setState({ this.setState({
owners, owners,
error: errors error: errors
...@@ -175,12 +181,14 @@ export default class DistributionLists extends React.Component { ...@@ -175,12 +181,14 @@ export default class DistributionLists extends React.Component {
onSubmitMembers(response) { onSubmitMembers(response) {
if (response.refresh) { if (response.refresh) {
response.refresh.forEach((member) => { response.refresh.forEach((member) => {
DomainStore.addMember(member); if (this.isStoreEnabled) {
DomainStore.addMember(member);
}
}); });
} }
this.multipleActionsMembers(response, this.state.distributionsList).then((res) => { this.multipleActionsMembers(response, this.state.distributionsList).then((res) => {
const newMembers = DomainStore.getMembers(); const newMembers = this.isStoreEnabled ? DomainStore.getMembers() : null;
const errors = []; const errors = [];
const limit = res.length; const limit = res.length;
...@@ -227,7 +235,9 @@ export default class DistributionLists extends React.Component { ...@@ -227,7 +235,9 @@ export default class DistributionLists extends React.Component {
} }
response.add.forEach((member) => { response.add.forEach((member) => {
DomainStore.addMember(member); if (this.isStoreEnabled) {
DomainStore.addMember(member);
}
}); });
res.isCompleted = true; res.isCompleted = true;
...@@ -253,7 +263,9 @@ export default class DistributionLists extends React.Component { ...@@ -253,7 +263,9 @@ export default class DistributionLists extends React.Component {
} }
response.remove.forEach((member) => { response.remove.forEach((member) => {
DomainStore.removeMember(member); if (this.isStoreEnabled) {
DomainStore.removeMember(member);
}
}); });
res.isCompleted = true; res.isCompleted = true;
...@@ -334,8 +346,10 @@ export default class DistributionLists extends React.Component { ...@@ -334,8 +346,10 @@ export default class DistributionLists extends React.Component {
} }
onDeleteMember(member) { onDeleteMember(member) {
DomainStore.removeMember(member); if (this.isStoreEnabled) {
const currentMembers = DomainStore.getMembers(); DomainStore.removeMember(member);
}
const currentMembers = this.isStoreEnabled ? DomainStore.getMembers() : null;
this.setState({ this.setState({
members: currentMembers, members: currentMembers,
...@@ -346,10 +360,12 @@ export default class DistributionLists extends React.Component { ...@@ -346,10 +360,12 @@ export default class DistributionLists extends React.Component {
onCancelMember(response) { onCancelMember(response) {
if (response && response.length > 0) { if (response && response.length > 0) {
response.forEach((member) => { response.forEach((member) => {
DomainStore.addMember(member); if (this.isStoreEnabled) {
DomainStore.addMember(member);
}
}); });
const newMembers = DomainStore.getMembers(); const newMembers = this.isStoreEnabled ? DomainStore.getMembers() : null;
this.setState({ this.setState({
members: newMembers, members: newMembers,
...@@ -361,8 +377,10 @@ export default class DistributionLists extends React.Component { ...@@ -361,8 +377,10 @@ export default class DistributionLists extends React.Component {
} }
onDeleteOwner(owner) { onDeleteOwner(owner) {
DomainStore.removeOwner(owner); if (this.isStoreEnabled) {
const currentOwners = DomainStore.getOwners(); DomainStore.removeOwner(owner);
}
const currentOwners = this.isStoreEnabled ? DomainStore.getOwners() : null;
this.setState({ this.setState({
owners: currentOwners, owners: currentOwners,
...@@ -373,10 +391,12 @@ export default class DistributionLists extends React.Component { ...@@ -373,10 +391,12 @@ export default class DistributionLists extends React.Component {
onCancelOwner(response) { onCancelOwner(response) {
if (response && response.length > 0) { if (response && response.length > 0) {
response.forEach((member) => { response.forEach((member) => {
DomainStore.addOwners(member); if (this.isStoreEnabled) {
DomainStore.addOwners(member);
}
}); });
const newOwners = DomainStore.getOwners(); const newOwners = this.isStoreEnabled ? DomainStore.getOwners() : null;
this.setState({ this.setState({
owners: newOwners, owners: newOwners,
...@@ -581,20 +601,29 @@ export default class DistributionLists extends React.Component { ...@@ -581,20 +601,29 @@ export default class DistributionLists extends React.Component {
<div className='content animate-panel'> <div className='content animate-panel'>
{message} {message}
<div className='row'> <div className='row'>
<div className='col-md-6 central-content'> <div className='layout-back clearfix'>
<Panel <div className='back-left backstage'>
title='Información General' <div className='backbg'></div>
btnsHeader={btnsGeneralInfo} </div>
children={generalData} <div className='back-right backstage'>
classHeader='with-min-height' <div className='backbg'></div>
/> </div>
</div>
<div className='col-md-6 central-content'> <div className='col-md-6 central-content'>
<Panel <Panel
title='Dominio' title='Información General'
children={domainInfo} btnsHeader={btnsGeneralInfo}
classHeader='with-min-height' children={generalData}
/> classHeader='with-min-height'
/>
</div>
<div className='col-md-6 central-content'>
<Panel
title='Dominio'
children={domainInfo}
classHeader='with-min-height'
/>
</div>
</div> </div>
</div> </div>
<div className='row'> <div className='row'>
......
...@@ -19,6 +19,7 @@ export default class AddAdminModal extends React.Component { ...@@ -19,6 +19,7 @@ export default class AddAdminModal extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.isStoreEnabled = window.manager_config.enableStores;
this.handleSearch = this.handleSearch.bind(this); this.handleSearch = this.handleSearch.bind(this);
this.handleAddAdmin = this.handleAddAdmin.bind(this); this.handleAddAdmin = this.handleAddAdmin.bind(this);
...@@ -45,7 +46,7 @@ export default class AddAdminModal extends React.Component { ...@@ -45,7 +46,7 @@ export default class AddAdminModal extends React.Component {
(data) => { (data) => {
const admins = DomainStore.getAdmins(this.props.domain); const admins = DomainStore.getAdmins(this.props.domain);
let users = []; let users = [];
if (admins) { if (this.isStoreEnabled && admins) {
if (data.account) { if (data.account) {
data.account.forEach((u) => { data.account.forEach((u) => {
if (!admins.hasOwnProperty(u.id)) { if (!admins.hasOwnProperty(u.id)) {
...@@ -88,15 +89,20 @@ export default class AddAdminModal extends React.Component { ...@@ -88,15 +89,20 @@ export default class AddAdminModal extends React.Component {
if (this.props.show) { if (this.props.show) {
this.props.onHide(); this.props.onHide();
setTimeout(() => { GlobalActions.emitToast({
GlobalActions.emitMessage({ type: 'success',
message: 'Se ha agregado su administrador éxitoxamente.', title: 'Dominio',
type: Constants.MessageType.SUCCESS body: `Se ha agrega el administrador: ${user}, éxitosamente.`,
}); options: {
}, 1000); timeOut: 4000,
extendedTimeOut: 2000,
closeButton: true
}
});
} }
return DomainStore.addAdmin(user); DomainStore.emitAdminsChange();
return this.isStoreEnabled && DomainStore.addAdmin(user) ? DomainStore.addAdmin(user) : true;
} }
); );
} }
......
...@@ -15,6 +15,7 @@ export default class AddDistributionListModal extends React.Component { ...@@ -15,6 +15,7 @@ export default class AddDistributionListModal extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.isStoreEnabled = window.manager_config.enableStores;
this.handleAddList = this.handleAddList.bind(this); this.handleAddList = this.handleAddList.bind(this);
this.state = {}; this.state = {};
} }
...@@ -31,7 +32,11 @@ export default class AddDistributionListModal extends React.Component { ...@@ -31,7 +32,11 @@ export default class AddDistributionListModal extends React.Component {
email, email,
{displayName}, {displayName},
(data) => { (data) => {
DomainStore.addDistributionList(data); if (this.isStoreEnabled) {
DomainStore.addDistributionList(data);
} else {
DomainStore.emitDistributionListsChange();
}
GlobalActions.emitEndLoading(); GlobalActions.emitEndLoading();
this.props.onHide(); this.props.onHide();
}, },
......
...@@ -16,10 +16,11 @@ export default class AntiSpam extends React.Component { ...@@ -16,10 +16,11 @@ export default class AntiSpam extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.isStoreEnabled = window.manager_config.enableStores;
this.handleDelete = this.handleDelete.bind(this); this.handleDelete = this.handleDelete.bind(this);
this.handleSave = this.handleSave.bind(this); this.handleSave = this.handleSave.bind(this);
this.alterDomain = this.alterDomain.bind(this); this.alterDomain = this.alterDomain.bind(this);
this.domain = DomainStore.getCurrent(); this.domain = this.isStoreEnabled ? DomainStore.getCurrent() : this.props.data;
this.blackList = []; this.blackList = [];
this.whiteList = []; this.whiteList = [];
...@@ -141,7 +142,9 @@ export default class AntiSpam extends React.Component { ...@@ -141,7 +142,9 @@ export default class AntiSpam extends React.Component {
return reject(error); return reject(error);
}); });
}).then((res) => { }).then((res) => {
DomainStore.setCurrent(res); if (this.isStoreEnabled) {
DomainStore.setCurrent(res);
}
returns = res.attrs[key] ? res.attrs[key] : []; returns = res.attrs[key] ? res.attrs[key] : [];
returns = Array.isArray(returns) ? returns : [returns]; returns = Array.isArray(returns) ? returns : [returns];
......
...@@ -18,6 +18,7 @@ export default class DNSZoneForm extends React.Component { ...@@ -18,6 +18,7 @@ export default class DNSZoneForm extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.isStoreEnabled = window.manager_config.enableStores;
this.addDNSRow = this.addDNSRow.bind(this); this.addDNSRow = this.addDNSRow.bind(this);
this.removeRow = this.removeRow.bind(this); this.removeRow = this.removeRow.bind(this);
this.handleChangeInput = this.handleChangeInput.bind(this); this.handleChangeInput = this.handleChangeInput.bind(this);
...@@ -26,7 +27,7 @@ export default class DNSZoneForm extends React.Component { ...@@ -26,7 +27,7 @@ export default class DNSZoneForm extends React.Component {
this.showSweetConfirm = this.showSweetConfirm.bind(this); this.showSweetConfirm = this.showSweetConfirm.bind(this);
this.handleSearchByName = this.handleSearchByName.bind(this); this.handleSearchByName = this.handleSearchByName.bind(this);
this.zoneDNS = DomainStore.getZoneDNS(); this.zoneDNS = this.isStoreEnabled ? DomainStore.getZoneDNS() : this.props.zone;
this.instanceRow = { this.instanceRow = {
name: '', name: '',
...@@ -122,7 +123,11 @@ export default class DNSZoneForm extends React.Component { ...@@ -122,7 +123,11 @@ export default class DNSZoneForm extends React.Component {
return Client.getZone(domain.name, (zone) => { return Client.getZone(domain.name, (zone) => {
this.newRows = []; this.newRows = [];
DomainStore.setZoneDNS(zone); if (this.isStoreEnabled) {
DomainStore.setZoneDNS(zone);
} else {
DomainStore.emitZoneDNSChange(zone);
}
Utils.toggleStatusButtons('.savedns', false); Utils.toggleStatusButtons('.savedns', false);
button.innerHTML = oldContent; button.innerHTML = oldContent;
...@@ -202,6 +207,7 @@ export default class DNSZoneForm extends React.Component { ...@@ -202,6 +207,7 @@ export default class DNSZoneForm extends React.Component {
sweetAlert({ sweetAlert({
title: 'Esta seguro que desea borrar el DNS?', title: 'Esta seguro que desea borrar el DNS?',
text: `Desea borrar el record ${object.name}`,
type: 'info', type: 'info',
showCancelButton: true, showCancelButton: true,
confirmButtonColor: '#DD6B55', confirmButtonColor: '#DD6B55',
...@@ -211,7 +217,7 @@ export default class DNSZoneForm extends React.Component { ...@@ -211,7 +217,7 @@ export default class DNSZoneForm extends React.Component {
}, },
(isDeleted) => { (isDeleted) => {
if (isDeleted) { if (isDeleted) {
if (zoneDNS && zoneDNS.records[index]) { if (zoneDNS) {
return zoneDNS.deleteRecords(object, (error, success) => { return zoneDNS.deleteRecords(object, (error, success) => {
if (error) { if (error) {
response.title = 'Ha ocurrido un error.'; response.title = 'Ha ocurrido un error.';
...@@ -222,7 +228,9 @@ export default class DNSZoneForm extends React.Component { ...@@ -222,7 +228,9 @@ export default class DNSZoneForm extends React.Component {
return sweetAlert(response); return sweetAlert(response);
} }
DomainStore.setZoneDNS(success); if (this.isStoreEnabled) {
DomainStore.setZoneDNS(success);
}
this.defaultRows.splice(index, 1); this.defaultRows.splice(index, 1);
...@@ -238,15 +246,27 @@ export default class DNSZoneForm extends React.Component { ...@@ -238,15 +246,27 @@ export default class DNSZoneForm extends React.Component {
); );
} }
removeRow(e, index, from) { removeRow(e, object) {
e.preventDefault(); e.preventDefault();
const refer = from || null; let index = null;
if (typeof object === 'object') {
const element = this.defaultRows.filter((item, i) => {
const isRightName = item.name === object.name;
if (isRightName) {
index = i;
return isRightName;
}
return isRightName;
});
if (this.defaultRows[index] && !refer) { if (element.length > 0) {
return this.showSweetConfirm(this.defaultRows[index], index); const item = element.pop();
return this.showSweetConfirm(item, index);
}
} }
this.newRows.splice(index, 1); this.newRows.splice(object, 1);
return this.setState({ return this.setState({
update: true update: true
...@@ -302,13 +322,6 @@ export default class DNSZoneForm extends React.Component { ...@@ -302,13 +322,6 @@ export default class DNSZoneForm extends React.Component {
let header = null; let header = null;
let inputSearch = null; let inputSearch = null;
let pagination = null; let pagination = null;
//
// No show records
//
const inMutableFields = window.manager_config.dns.inmutable;
const mutableFields = this.state.fields.filter((record) => {
return !inMutableFields.includes(record.type.toLowerCase());
});
const types = this.types.map((item) => { const types = this.types.map((item) => {
return ( return (
<option <option
...@@ -361,19 +374,19 @@ export default class DNSZoneForm extends React.Component { ...@@ -361,19 +374,19 @@ export default class DNSZoneForm extends React.Component {
<strong>Nombre</strong> <strong>Nombre</strong>
</div> </div>
<div className='col-xs-2'> <div className='col-xs-1'>
<strong>Tipo</strong> <strong>Tipo</strong>
</div> </div>
<div className='col-xs-4'> <div className='col-xs-3'>
<strong>Contenido</strong> <strong>Contenido</strong>
</div> </div>
<div className='col-xs-1'> <div className='col-xs-2'>
<strong>Prioridad</strong> <strong>Prioridad</strong>
</div> </div>
<div className='col-xs-1'> <div className='col-xs-2'>
<strong>TTL</strong> <strong>TTL</strong>
</div> </div>
...@@ -403,7 +416,7 @@ export default class DNSZoneForm extends React.Component { ...@@ -403,7 +416,7 @@ export default class DNSZoneForm extends React.Component {
/> />
</div> </div>
<div className='col-xs-2'> <div className='col-xs-1'>
<select <select
className='form-control' className='form-control'
defaultValue={newElement.type} defaultValue={newElement.type}
...@@ -416,7 +429,7 @@ export default class DNSZoneForm extends React.Component { ...@@ -416,7 +429,7 @@ export default class DNSZoneForm extends React.Component {
</select> </select>
</div> </div>
<div className='col-xs-4'> <div className='col-xs-3'>
<input <input
type='text' type='text'
className='form-control' className='form-control'
...@@ -427,7 +440,7 @@ export default class DNSZoneForm extends React.Component { ...@@ -427,7 +440,7 @@ export default class DNSZoneForm extends React.Component {
/> />
</div> </div>
<div className='col-xs-1'> <div className='col-xs-2'>
<input <input
type='number' type='number'
className='form-control' className='form-control'
...@@ -438,7 +451,7 @@ export default class DNSZoneForm extends React.Component { ...@@ -438,7 +451,7 @@ export default class DNSZoneForm extends React.Component {
/> />
</div> </div>
<div className='col-xs-1'> <div className='col-xs-2'>
<input <input
type='number' type='number'
className='form-control' className='form-control'
...@@ -453,7 +466,7 @@ export default class DNSZoneForm extends React.Component { ...@@ -453,7 +466,7 @@ export default class DNSZoneForm extends React.Component {
<button <button
className='btn btn-danger' className='btn btn-danger'
onClick={(e) => { onClick={(e) => {
this.removeRow(e, index, 'new'); this.removeRow(e, index);
}} }}
> >
<i <i
...@@ -469,7 +482,7 @@ export default class DNSZoneForm extends React.Component { ...@@ -469,7 +482,7 @@ export default class DNSZoneForm extends React.Component {
if (this.state.fields.length > 0) { if (this.state.fields.length > 0) {
const length = this.state.fields.length; const length = this.state.fields.length;
fields = mutableFields.map((element, i) => { fields = this.state.fields.map((element, i) => {
const isDisabled = element.enabled ? null : true; const isDisabled = element.enabled ? null : true;
return ( return (
<div <div
...@@ -482,27 +495,20 @@ export default class DNSZoneForm extends React.Component { ...@@ -482,27 +495,20 @@ export default class DNSZoneForm extends React.Component {
type='text' type='text'
defaultValue={element.name} defaultValue={element.name}
className='form-control' className='form-control'
onChange={(e) => {
this.handleChangeInput(e, i, Labels.name);
}}
disabled={isDisabled} disabled={isDisabled}
/> />
</div> </div>
<div className='col-xs-2'> <div className='col-xs-1'>
<select <input
className='form-control' className='form-control'
type='text'
defaultValue={element.type} defaultValue={element.type}
onChange={(e) => {
this.handleChangeInput(e, i, Labels.type);
}}
disabled={isDisabled} disabled={isDisabled}
> />
{types}
</select>
</div> </div>
<div className='col-xs-4'> <div className='col-xs-3'>
<input <input
type='text' type='text'
className='form-control' className='form-control'
...@@ -513,7 +519,7 @@ export default class DNSZoneForm extends React.Component { ...@@ -513,7 +519,7 @@ export default class DNSZoneForm extends React.Component {
/> />
</div> </div>
<div className='col-xs-1'> <div className='col-xs-2'>
<input <input
type='number' type='number'
className='form-control' className='form-control'
...@@ -524,7 +530,7 @@ export default class DNSZoneForm extends React.Component { ...@@ -524,7 +530,7 @@ export default class DNSZoneForm extends React.Component {
/> />
</div> </div>
<div className='col-xs-1'> <div className='col-xs-2'>
<input <input
type='number' type='number'
className='form-control' className='form-control'
...@@ -539,7 +545,7 @@ export default class DNSZoneForm extends React.Component { ...@@ -539,7 +545,7 @@ export default class DNSZoneForm extends React.Component {
<button <button
className='btn btn-danger' className='btn btn-danger'
onClick={(e) => { onClick={(e) => {
this.removeRow(e, i); this.removeRow(e, element);
}} }}
> >
<i <i
...@@ -609,5 +615,9 @@ export default class DNSZoneForm extends React.Component { ...@@ -609,5 +615,9 @@ export default class DNSZoneForm extends React.Component {
DNSZoneForm.propTypes = { DNSZoneForm.propTypes = {
domain: React.PropTypes.object, domain: React.PropTypes.object,
zone: React.PropTypes.oneOfType([
React.PropTypes.string,
React.PropTypes.object
]),
location: React.PropTypes.object location: React.PropTypes.object
}; };
...@@ -5,6 +5,7 @@ import React from 'react'; ...@@ -5,6 +5,7 @@ import React from 'react';
import sweetAlert from 'sweetalert'; import sweetAlert from 'sweetalert';
import DomainStore from '../../stores/domain_store.jsx'; import DomainStore from '../../stores/domain_store.jsx';
import UserStore from '../../stores/user_store.jsx';
import MessageBar from '../message_bar.jsx'; import MessageBar from '../message_bar.jsx';
import Panel from '../panel.jsx'; import Panel from '../panel.jsx';
...@@ -19,15 +20,16 @@ export default class DomainAdminList extends React.Component { ...@@ -19,15 +20,16 @@ export default class DomainAdminList extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.isStoreEnabled = window.manager_config.enableStores;
this.getAdmins = this.getAdmins.bind(this); this.getAdmins = this.getAdmins.bind(this);
this.handleRemoveAdmin = this.handleRemoveAdmin.bind(this); this.handleRemoveAdmin = this.handleRemoveAdmin.bind(this);
this.onAdminsChange = this.onAdminsChange.bind(this); this.onAdminsChange = this.onAdminsChange.bind(this);
this.isGlobalAdmin = UserStore.isGlobalAdmin();
this.state = this.getStateFromStores(); this.state = this.getStateFromStores();
} }
getStateFromStores() { getStateFromStores() {
//const admins = DomainStore.getAdmins(this.props.domain); const admins = this.isStoreEnabled ? DomainStore.getAdmins(this.props.domain) : null;
const admins = null;
return { return {
admins admins
}; };
...@@ -37,7 +39,9 @@ export default class DomainAdminList extends React.Component { ...@@ -37,7 +39,9 @@ export default class DomainAdminList extends React.Component {
const domain = this.props.domain; const domain = this.props.domain;
domain.getAdmins((err, data) => { domain.getAdmins((err, data) => {
const admins = data.account || []; const admins = data.account || [];
DomainStore.setAdmins(domain, admins); if (this.isStoreEnabled) {
DomainStore.setAdmins(domain, admins);
}
this.setState({admins}); this.setState({admins});
}); });
} }
...@@ -78,7 +82,9 @@ export default class DomainAdminList extends React.Component { ...@@ -78,7 +82,9 @@ export default class DomainAdminList extends React.Component {
return sweetAlert(response); return sweetAlert(response);
} }
DomainStore.removeAdmin(admin.id); if (this.isStoreEnabled) {
DomainStore.removeAdmin(admin.id);
}
return sweetAlert(response); return sweetAlert(response);
} }
); );
...@@ -88,7 +94,7 @@ export default class DomainAdminList extends React.Component { ...@@ -88,7 +94,7 @@ export default class DomainAdminList extends React.Component {
} }
onAdminsChange() { onAdminsChange() {
const admins = DomainStore.getAdmins(this.props.domain); const admins = this.isStoreEnabled ? DomainStore.getAdmins(this.props.domain) : null;
if (!admins) { if (!admins) {
return this.getAdmins(); return this.getAdmins();
} }
...@@ -107,6 +113,7 @@ export default class DomainAdminList extends React.Component { ...@@ -107,6 +113,7 @@ export default class DomainAdminList extends React.Component {
DomainStore.removeAdminsChangeListener(this.onAdminsChange); DomainStore.removeAdminsChangeListener(this.onAdminsChange);
} }
render() { render() {
let btnAddNewAdmin = null;
if (!this.state.admins) { if (!this.state.admins) {
return <div/>; return <div/>;
} }
...@@ -127,6 +134,7 @@ export default class DomainAdminList extends React.Component { ...@@ -127,6 +134,7 @@ export default class DomainAdminList extends React.Component {
const domain = this.props.domain; const domain = this.props.domain;
const adminRows = this.state.admins.map((a) => { const adminRows = this.state.admins.map((a) => {
const name = a.attrs.displayName || `${a.attrs.givenName || a.attrs.cn} ${a.attrs.sn}`;
return ( return (
<tr <tr
key={`admin-${a.id}`} key={`admin-${a.id}`}
...@@ -136,35 +144,50 @@ export default class DomainAdminList extends React.Component { ...@@ -136,35 +144,50 @@ export default class DomainAdminList extends React.Component {
{a.name} {a.name}
</td> </td>
<td className='user-name text-center'> <td className='user-name text-center'>
{a.attrs.displayName} {name}
</td> </td>
<td className='user-type text-center'> <td className='user-type text-center'>
</td> </td>
<td className='user-actions text-center'> {this.isGlobalAdmin && (
<ul className='list-inline list-unstyled'> <td className='user-actions text-center'>
<li> <ul className='list-inline list-unstyled'>
<a <li>
className='btn btn-default btn-xs' <a
onClick={(e) => Utils.handleLink(e, `/mailboxes/${a.id}/edit`, this.props.location)} className='btn btn-default btn-xs'
> onClick={(e) => Utils.handleLink(e, `/mailboxes/${a.id}/edit`, this.props.location)}
{'Editar'} >
</a> {'Editar'}
</li> </a>
<li> </li>
<a <li>
className='btn btn-danger btn-xs' <a
onClick={(e) => this.handleRemoveAdmin(e, a)} className='btn btn-danger btn-xs'
> onClick={(e) => this.handleRemoveAdmin(e, a)}
{'Eliminar'} >
</a> {'Eliminar'}
</li> </a>
</ul> </li>
</td> </ul>
</td>
)}
</tr> </tr>
); );
}); });
if (this.isGlobalAdmin) {
btnAddNewAdmin = (
<ToggleModalButton
role='button'
className='btn btn-default'
dialogType={AddAdminModal}
dialogProps={{domain}}
>
{'Agregar administrador'}
</ToggleModalButton>
);
}
let adminContent; let adminContent;
if (adminRows.length > 0) { if (adminRows.length > 0) {
adminContent = ( adminContent = (
<div className='table-responsive'> <div className='table-responsive'>
...@@ -179,21 +202,16 @@ export default class DomainAdminList extends React.Component { ...@@ -179,21 +202,16 @@ export default class DomainAdminList extends React.Component {
<th>{'email'}</th> <th>{'email'}</th>
<th className='text-center'>{'Nombre'}</th> <th className='text-center'>{'Nombre'}</th>
<th></th> <th></th>
<th className='text-center'>{'Acciones'}</th> {this.isGlobalAdmin && (
<th className='text-center'>{'Acciones'}</th>
)}
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{adminRows} {adminRows}
</tbody> </tbody>
</table> </table>
<ToggleModalButton {btnAddNewAdmin}
role='button'
className='btn btn-default'
dialogType={AddAdminModal}
dialogProps={{domain}}
>
{'Agregar administrador'}
</ToggleModalButton>
</div> </div>
); );
} else { } else {
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
import $ from 'jquery'; import $ from 'jquery';
import React from 'react'; import React from 'react';
import {browserHistory} from 'react-router';
import MessageBar from '../message_bar.jsx'; import MessageBar from '../message_bar.jsx';
import PageInfo from '../page_info.jsx'; import PageInfo from '../page_info.jsx';
...@@ -23,18 +24,26 @@ import DomainStore from '../../stores/domain_store.jsx'; ...@@ -23,18 +24,26 @@ import DomainStore from '../../stores/domain_store.jsx';
import * as Client from '../../utils/client.jsx'; import * as Client from '../../utils/client.jsx';
import * as GlobalActions from '../../action_creators/global_actions.jsx'; import * as GlobalActions from '../../action_creators/global_actions.jsx';
//import Constants from '../../utils/constants.jsx'; import Constants from '../../utils/constants.jsx';
const QueryOptions = Constants.QueryOptions;
export default class DomainDetails extends React.Component { export default class DomainDetails extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.isStoreEnabled = window.manager_config.enableStores;
this.getDomain = this.getDomain.bind(this); this.getDomain = this.getDomain.bind(this);
this.showMessage = this.showMessage.bind(this); this.showMessage = this.showMessage.bind(this);
this.handleClickOnTab = this.handleClickOnTab.bind(this);
this.state = {}; this.state = {};
} }
handleClickOnTab(tab) {
const path = this.props.location.pathname;
browserHistory.push(`${path}?tab=${tab}`);
}
showMessage(attrs) { showMessage(attrs) {
this.setState({ this.setState({
error: { error: {
...@@ -45,8 +54,7 @@ export default class DomainDetails extends React.Component { ...@@ -45,8 +54,7 @@ export default class DomainDetails extends React.Component {
} }
getDomain() { getDomain() {
//const domain = DomainStore.getCurrent(); const domain = this.isStoreEnabled ? DomainStore.getCurrent() : null;
const domain = null;
const states = {}; const states = {};
if (domain && domain.id === this.props.params.id) { if (domain && domain.id === this.props.params.id) {
...@@ -57,13 +65,15 @@ export default class DomainDetails extends React.Component { ...@@ -57,13 +65,15 @@ export default class DomainDetails extends React.Component {
this.setState(states); this.setState(states);
Client.getZone(domain.name, (zone) => { Client.getZone(domain.name, (zone) => {
DomainStore.setZoneDNS(zone); states.zone = this.isStoreEnabled ? DomainStore.setZoneDNS(zone) : zone;
this.setState(states); this.setState(states);
GlobalActions.emitEndLoading(); GlobalActions.emitEndLoading();
}, () => { }, () => {
DomainStore.setZoneDNS(null); if (this.isStoreEnabled) {
DomainStore.setZoneDNS(null);
}
this.setState(states); this.setState(states);
...@@ -73,11 +83,13 @@ export default class DomainDetails extends React.Component { ...@@ -73,11 +83,13 @@ export default class DomainDetails extends React.Component {
Client.getDomain( Client.getDomain(
this.props.params.id, this.props.params.id,
(data) => { (data) => {
DomainStore.setCurrent(data); if (this.isStoreEnabled) {
DomainStore.setCurrent(data);
}
states.domain = data; states.domain = data;
Client.getZone(data.name, (zone) => { Client.getZone(data.name, (zone) => {
DomainStore.setZoneDNS(zone); states.zone = this.isStoreEnabled ? DomainStore.setZoneDNS(zone) : zone;
this.setState(states); this.setState(states);
...@@ -105,6 +117,17 @@ export default class DomainDetails extends React.Component { ...@@ -105,6 +117,17 @@ export default class DomainDetails extends React.Component {
this.props.params.id = nextProps.params.id; this.props.params.id = nextProps.params.id;
this.getDomain(); this.getDomain();
} }
const isPaging = this.props.location.query.page !== nextProps.location.query.page;
if (isPaging) {
const page = parseInt(nextProps.location.query.page, 10) || 1;
this.setState({
page,
offset: ((page - 1) * QueryOptions.DEFAULT_LIMIT)
});
}
} }
componentDidMount() { componentDidMount() {
...@@ -189,6 +212,7 @@ export default class DomainDetails extends React.Component { ...@@ -189,6 +212,7 @@ export default class DomainDetails extends React.Component {
<ZonaDNS <ZonaDNS
domain={domain} domain={domain}
location={this.props.location} location={this.props.location}
zone={this.state.zone}
/> />
); );
...@@ -214,6 +238,7 @@ export default class DomainDetails extends React.Component { ...@@ -214,6 +238,7 @@ export default class DomainDetails extends React.Component {
tabNames={tabNames} tabNames={tabNames}
tabs={tabs} tabs={tabs}
location={this.props.location} location={this.props.location}
onClick={this.handleClickOnTab}
/> />
); );
......
...@@ -12,36 +12,56 @@ import AddDistributionListModal from './add_distribution_list_modal.jsx'; ...@@ -12,36 +12,56 @@ import AddDistributionListModal from './add_distribution_list_modal.jsx';
import * as Client from '../../utils/client.jsx'; import * as Client from '../../utils/client.jsx';
import * as Utils from '../../utils/utils.jsx'; import * as Utils from '../../utils/utils.jsx';
import Constants from '../../utils/constants.jsx';
const defaultLimit = Constants.QueryOptions.DEFAULT_LIMIT;
import Pagination from '../pagination.jsx';
export default class DomainDistributionList extends React.Component { export default class DomainDistributionList extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.isStoreEnabled = window.manager_config.enableStores;
this.getLists = this.getLists.bind(this); this.getLists = this.getLists.bind(this);
this.handleRemoveAdmin = this.handleRemoveAdmin.bind(this); this.handleRemoveAdmin = this.handleRemoveAdmin.bind(this);
this.onListsChange = this.onListsChange.bind(this); this.onListsChange = this.onListsChange.bind(this);
this.state = this.getStateFromStores(); this.handleSearchByName = this.handleSearchByName.bind(this);
this.listscache = null;
const page = parseInt(this.props.location.query.page, 10) || 1;
this.state = {
lists: this.getStateFromStores(),
page,
offset: ((page - 1) * defaultLimit)
};
} }
getStateFromStores() { getStateFromStores() {
const lists = DomainStore.getDistributionLists(this.props.domain); const lists = this.isStoreEnabled ? DomainStore.getDistributionLists(this.props.domain) : null;
return { return lists;
lists
};
} }
getLists() { getLists() {
const domain = this.props.domain; const domain = this.props.domain;
domain.getAllDistributionLists( domain.getAllDistributionLists(
(err, lists) => { (err, lists) => {
DomainStore.setDistibutionLists(domain, lists); if (this.isStoreEnabled) {
DomainStore.setDistibutionLists(domain, lists);
}
this.listscache = lists;
this.setState({lists}); this.setState({lists});
} }
); );
} }
componentWillReceiveProps(nextProps) {
const page = parseInt(nextProps.location.query.page, 10) || 1;
this.setState({
page,
offset: ((page - 1) * defaultLimit)
});
}
onListsChange() { onListsChange() {
const lists = DomainStore.getDistributionLists(this.props.domain); const lists = this.isStoreEnabled ? DomainStore.getDistributionLists(this.props.domain) : null;
if (!lists) { if (!lists) {
return this.getAdmins(); return this.getLists();
} }
return this.setState({lists}); return this.setState({lists});
...@@ -68,7 +88,11 @@ export default class DomainDistributionList extends React.Component { ...@@ -68,7 +88,11 @@ export default class DomainDistributionList extends React.Component {
Client.removeDistributionList( Client.removeDistributionList(
list.id, list.id,
() => { () => {
DomainStore.removeDistributionList(list.id); if (this.isStoreEnabled) {
DomainStore.removeDistributionList(list.id);
} else {
DomainStore.emitDistributionListsChange();
}
return sweetAlert(response); return sweetAlert(response);
}, },
...@@ -85,6 +109,22 @@ export default class DomainDistributionList extends React.Component { ...@@ -85,6 +109,22 @@ export default class DomainDistributionList extends React.Component {
} }
); );
} }
handleSearchByName(e) {
const value = e.target.value.trim();
if (!this.listscache) {
return null;
}
const newLists = this.listscache.filter((dl) => {
const name = dl.name || dl.id;
return name.match(value);
});
this.setState({
lists: newLists
});
}
componentDidMount() { componentDidMount() {
DomainStore.addDistributionListsChangeListener(this.onListsChange); DomainStore.addDistributionListsChangeListener(this.onListsChange);
...@@ -96,8 +136,18 @@ export default class DomainDistributionList extends React.Component { ...@@ -96,8 +136,18 @@ export default class DomainDistributionList extends React.Component {
DomainStore.removeDistributionListsChangeListener(this.onListsChange); DomainStore.removeDistributionListsChangeListener(this.onListsChange);
} }
render() { render() {
let pagination = null;
let filter = null;
if (!this.state.lists) { if (!this.state.lists) {
return <div/>; return (
<div
className='text-center'
key={'dl-loading'}
>
<i className='fa fa-spinner fa-spin fa-4x fa-fw'></i>
<p>{'Cargando Listas de Distribución...'}</p>
</div>
);
} }
const domain = this.props.domain; const domain = this.props.domain;
...@@ -116,7 +166,21 @@ export default class DomainDistributionList extends React.Component { ...@@ -116,7 +166,21 @@ export default class DomainDistributionList extends React.Component {
) )
}]; }];
const listsRows = this.state.lists.map((dl) => { let lists = this.state.lists;
if (lists.length > defaultLimit) {
const totalPages = Math.ceil(lists.length / defaultLimit);
lists = lists.slice(this.state.offset, this.state.page * defaultLimit);
pagination = (
<Pagination
key='DlPagination'
url={this.props.location.pathname}
currentPage={this.state.page}
totalPages={totalPages}
/>
);
}
const listsRows = lists.map((dl) => {
return ( return (
<tr <tr
key={`dl-${dl.id}`} key={`dl-${dl.id}`}
...@@ -151,6 +215,29 @@ export default class DomainDistributionList extends React.Component { ...@@ -151,6 +215,29 @@ export default class DomainDistributionList extends React.Component {
let panelBody; let panelBody;
if (listsRows.length > 0) { if (listsRows.length > 0) {
filter = (
<div className='col-xs-12'>
<div className='input-group'>
<span className='input-group-btn'>
<button
className='btn btn-primary'
type='button'
>
Buscar
</button>
</span>
<input
type='text'
className='form-control'
placeholder='Búsqueda por nombre'
onKeyUp={(e) => {
this.handleSearchByName(e);
}}
/>
</div>
</div>
);
panelBody = ( panelBody = (
<div className='table-responsive'> <div className='table-responsive'>
<table <table
...@@ -169,6 +256,7 @@ export default class DomainDistributionList extends React.Component { ...@@ -169,6 +256,7 @@ export default class DomainDistributionList extends React.Component {
{listsRows} {listsRows}
</tbody> </tbody>
</table> </table>
{pagination}
</div> </div>
); );
} else { } else {
...@@ -185,6 +273,7 @@ export default class DomainDistributionList extends React.Component { ...@@ -185,6 +273,7 @@ export default class DomainDistributionList extends React.Component {
<Panel <Panel
hasHeader={true} hasHeader={true}
btnsHeader={headerButtons} btnsHeader={headerButtons}
filter={filter}
children={panelBody} children={panelBody}
/> />
); );
......
...@@ -19,6 +19,7 @@ export default class DomainGeneralInfo extends React.Component { ...@@ -19,6 +19,7 @@ export default class DomainGeneralInfo extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.isStoreEnabled = window.manager_config.enableStores;
this.getMXRecord = this.getMXRecord.bind(this); this.getMXRecord = this.getMXRecord.bind(this);
this.renovationDate = this.renovationDate.bind(this); this.renovationDate = this.renovationDate.bind(this);
this.getCompany = this.getCompany.bind(this); this.getCompany = this.getCompany.bind(this);
...@@ -50,7 +51,7 @@ export default class DomainGeneralInfo extends React.Component { ...@@ -50,7 +51,7 @@ export default class DomainGeneralInfo extends React.Component {
}); });
} }
getCompany(id) { getCompany(id) {
const company = CompanyStore.getCompanyById(id); const company = this.isStoreEnabled ? CompanyStore.getCompanyById(id) : null;
if (company) { if (company) {
this.setState({ this.setState({
company: company.name company: company.name
......
...@@ -26,6 +26,7 @@ export default class Domains extends React.Component { ...@@ -26,6 +26,7 @@ export default class Domains extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.isStoreEnabled = window.manager_config.enableStores;
this.getDomains = this.getDomains.bind(this); this.getDomains = this.getDomains.bind(this);
const page = parseInt(this.props.location.query.page, 10) || 1; const page = parseInt(this.props.location.query.page, 10) || 1;
...@@ -45,7 +46,7 @@ export default class Domains extends React.Component { ...@@ -45,7 +46,7 @@ export default class Domains extends React.Component {
maxResults: window.manager_config.maxResultOnRequestZimbra maxResults: window.manager_config.maxResultOnRequestZimbra
}; };
/*if (DomainStore.getDomains()) { if (this.isStoreEnabled && DomainStore.getDomains()) {
const data = DomainStore.getDomains(); const data = DomainStore.getDomains();
GlobalActions.emitEndLoading(); GlobalActions.emitEndLoading();
...@@ -54,7 +55,7 @@ export default class Domains extends React.Component { ...@@ -54,7 +55,7 @@ export default class Domains extends React.Component {
data, data,
loading: false loading: false
}); });
}*/ }
const attrneeded = Utils.getAttrsBySectionFromConfig('domains'); const attrneeded = Utils.getAttrsBySectionFromConfig('domains');
attrs.attrs = attrneeded; attrs.attrs = attrneeded;
......
...@@ -21,6 +21,7 @@ export default class EditDomain extends React.Component { ...@@ -21,6 +21,7 @@ export default class EditDomain extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.isStoreEnabled = window.manager_config.enableStores;
this.getDomain = this.getDomain.bind(this); this.getDomain = this.getDomain.bind(this);
this.getCompanies = this.getCompanies.bind(this); this.getCompanies = this.getCompanies.bind(this);
this.handleSubmit = this.handleSubmit.bind(this); this.handleSubmit = this.handleSubmit.bind(this);
...@@ -33,9 +34,8 @@ export default class EditDomain extends React.Component { ...@@ -33,9 +34,8 @@ export default class EditDomain extends React.Component {
} }
getDomain() { getDomain() {
//const domain = DomainStore.getCurrent(); const domain = this.isStoreEnabled ? DomainStore.getCurrent() : null;
const domainId = this.props.params.id; const domainId = this.props.params.id;
const domain = null;
if (domain && domain.id === domainId) { if (domain && domain.id === domainId) {
return this.getCompanies(domain); return this.getCompanies(domain);
...@@ -54,7 +54,7 @@ export default class EditDomain extends React.Component { ...@@ -54,7 +54,7 @@ export default class EditDomain extends React.Component {
} }
getCompanies(domain) { getCompanies(domain) {
const companies = CompanyStore.getCompanies(); const companies = this.isStoreEnabled ? CompanyStore.getCompanies() : null;
if (companies) { if (companies) {
this.setState({ this.setState({
...@@ -115,8 +115,10 @@ export default class EditDomain extends React.Component { ...@@ -115,8 +115,10 @@ export default class EditDomain extends React.Component {
Client.modifyDomain( Client.modifyDomain(
domain, domain,
(data) => { (data) => {
CompanyStore.modifyDomain(prevCompanyId, data); if (this.isStoreEnabled) {
DomainStore.setCurrent(data); CompanyStore.modifyDomain(prevCompanyId, data);
DomainStore.setCurrent(data);
}
browserHistory.push(`/domains/${data.id}`); browserHistory.push(`/domains/${data.id}`);
}, },
(error) => { (error) => {
......
...@@ -17,6 +17,7 @@ export default class CreateDomainForm extends React.Component { ...@@ -17,6 +17,7 @@ export default class CreateDomainForm extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.isStoreEnabled = window.manager_config.enableStores;
this.planSize = this.planSize.bind(this); this.planSize = this.planSize.bind(this);
this.getCompanies = this.getCompanies.bind(this); this.getCompanies = this.getCompanies.bind(this);
this.handleSubmit = this.handleSubmit.bind(this); this.handleSubmit = this.handleSubmit.bind(this);
...@@ -40,7 +41,7 @@ export default class CreateDomainForm extends React.Component { ...@@ -40,7 +41,7 @@ export default class CreateDomainForm extends React.Component {
const companyId = this.props.params.id; const companyId = this.props.params.id;
const companies = CompanyStore.getCompanies(); const companies = CompanyStore.getCompanies();
if (companies) { if (this.isStoreEnabled && companies) {
this.setState({ this.setState({
plans: Utils.getEnabledPlansByCos(ZimbraStore.getAllCos()), plans: Utils.getEnabledPlansByCos(ZimbraStore.getAllCos()),
companies, companies,
...@@ -114,8 +115,10 @@ export default class CreateDomainForm extends React.Component { ...@@ -114,8 +115,10 @@ export default class CreateDomainForm extends React.Component {
Client.createDomain( Client.createDomain(
domain, domain,
(data) => { (data) => {
CompanyStore.addDomain(businessCategory, data); if (this.isStoreEnabled) {
DomainStore.setCurrent(data); CompanyStore.addDomain(businessCategory, data);
DomainStore.setCurrent(data);
}
if (this.props.state.total === this.props.state.step) { if (this.props.state.total === this.props.state.step) {
browserHistory.push(`/domains/${data.id}`); browserHistory.push(`/domains/${data.id}`);
......
...@@ -15,6 +15,7 @@ export default class ConfirmDeleteModal extends React.Component { ...@@ -15,6 +15,7 @@ export default class ConfirmDeleteModal extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.isStoreEnabled = window.manager_config.enableStores;
this.handleDelete = this.handleDelete.bind(this); this.handleDelete = this.handleDelete.bind(this);
this.handleKeyUp = this.handleKeyUp.bind(this); this.handleKeyUp = this.handleKeyUp.bind(this);
this.redirect = this.redirect.bind(this); this.redirect = this.redirect.bind(this);
...@@ -47,7 +48,9 @@ export default class ConfirmDeleteModal extends React.Component { ...@@ -47,7 +48,9 @@ export default class ConfirmDeleteModal extends React.Component {
} }
); );
}).then(() => { }).then(() => {
MailboxStore.removeAccount(this.props.data); if (this.isStoreEnabled) {
MailboxStore.removeAccount(this.props.data);
}
this.setState( this.setState(
{ {
alert: true, alert: true,
......
...@@ -84,6 +84,7 @@ export default class CreateMailBox extends React.Component { ...@@ -84,6 +84,7 @@ export default class CreateMailBox extends React.Component {
const attrs = { const attrs = {
givenName: this.refs.givenName.value, givenName: this.refs.givenName.value,
sn: this.refs.sn.value, sn: this.refs.sn.value,
displayName: `${this.refs.givenName.value} ${this.refs.sn.value}`,
description: this.refs.description.value, description: this.refs.description.value,
zimbraCOSId: this.refs.zimbraCOSId.value, zimbraCOSId: this.refs.zimbraCOSId.value,
zimbraAccountStatus: this.refs.zimbraAccountStatus.value, zimbraAccountStatus: this.refs.zimbraAccountStatus.value,
......
...@@ -31,6 +31,7 @@ export default class EditMailBox extends React.Component { ...@@ -31,6 +31,7 @@ export default class EditMailBox extends React.Component {
this.fillForm = this.fillForm.bind(this); this.fillForm = this.fillForm.bind(this);
this.showMessage = this.showMessage.bind(this); this.showMessage = this.showMessage.bind(this);
this.handleRenameAccount = this.handleRenameAccount.bind(this); this.handleRenameAccount = this.handleRenameAccount.bind(this);
this.editUrlFromParams = this.props.params.domain_id ? `/domains/${this.props.params.domain_id}/mailboxes/` : '/mailboxes/';
this.state = {}; this.state = {};
} }
...@@ -82,10 +83,11 @@ export default class EditMailBox extends React.Component { ...@@ -82,10 +83,11 @@ export default class EditMailBox extends React.Component {
}).then(() => { }).then(() => {
MailboxStore.removeAccount(account); MailboxStore.removeAccount(account);
response.text = 'Será redireccionado a Casillas.'; response.text = 'Será redireccionado a Casillas.';
this.editUrlFromParams = this.props.params.domain_id ? `/domains/${this.props.params.domain_id}/mailboxes/` : '/mailboxes/';
return sweetAlert( return sweetAlert(
response, response,
() => { () => {
Utils.handleLink(event, '/mailboxes/', this.props.location); Utils.handleLink(event, `${this.editUrlFromParams}`, this.props.location);
} }
); );
}).catch((error) => { }).catch((error) => {
...@@ -223,7 +225,8 @@ export default class EditMailBox extends React.Component { ...@@ -223,7 +225,8 @@ export default class EditMailBox extends React.Component {
sn: this.refs.sn.value, sn: this.refs.sn.value,
description: this.refs.description.value, description: this.refs.description.value,
zimbraCOSId: this.refs.zimbraCOSId.value, zimbraCOSId: this.refs.zimbraCOSId.value,
zimbraAccountStatus: this.refs.zimbraAccountStatus.value zimbraAccountStatus: this.refs.zimbraAccountStatus.value,
displayName: `${this.refs.givenName.value} ${this.refs.sn.value}`
}; };
GlobalActions.emitStartLoading(); GlobalActions.emitStartLoading();
...@@ -643,7 +646,7 @@ export default class EditMailBox extends React.Component { ...@@ -643,7 +646,7 @@ export default class EditMailBox extends React.Component {
{ {
className: 'btn btn-default action-button', className: 'btn btn-default action-button',
onClick: (e) => { onClick: (e) => {
Utils.handleLink(e, '/mailboxes', this.props.location); Utils.handleLink(e, `${this.editUrlFromParams}${this.props.params.id}`, this.props.location);
} }
} }
} }
...@@ -661,7 +664,7 @@ export default class EditMailBox extends React.Component { ...@@ -661,7 +664,7 @@ export default class EditMailBox extends React.Component {
props: { props: {
className: 'btn btn-default btn-xs action-button', className: 'btn btn-default btn-xs action-button',
onClick: (e) => { onClick: (e) => {
Utils.handleLink(e, `/mailboxes/${this.props.params.id}`, this.props.location); Utils.handleLink(e, `${this.editUrlFromParams}${this.props.params.id}`, this.props.location);
} }
} }
}, },
......
...@@ -57,7 +57,7 @@ export default class BlockGeneralInfoMailbox extends React.Component { ...@@ -57,7 +57,7 @@ export default class BlockGeneralInfoMailbox extends React.Component {
if (this.state.hasDomain) { if (this.state.hasDomain) {
const data = this.props.data; const data = this.props.data;
const attrs = this.props.data.attrs; const attrs = this.props.data.attrs;
const owner = (!attrs.givenName || !attrs.sn) ? null : attrs.givenName + ' ' + attrs.sn; const owner = attrs.displayName ? attrs.displayName : `${attrs.givenName || attrs.cn} ${attrs.sn}`;
const mail = data.name; const mail = data.name;
//properties //properties
......
...@@ -35,11 +35,13 @@ export default class Mailboxes extends React.Component { ...@@ -35,11 +35,13 @@ export default class Mailboxes extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.isStoreEnabled = window.manager_config.enableStores;
this.showMessage = this.showMessage.bind(this); this.showMessage = this.showMessage.bind(this);
this.refreshAllAccounts = this.refreshAllAccounts.bind(this); this.refreshAllAccounts = this.refreshAllAccounts.bind(this);
this.handleChangeFilter = this.handleChangeFilter.bind(this); this.handleChangeFilter = this.handleChangeFilter.bind(this);
this.handleTabChanged = this.handleTabChanged.bind(this); this.handleTabChanged = this.handleTabChanged.bind(this);
this.makeFilter = this.makeFilter.bind(this); this.makeFilter = this.makeFilter.bind(this);
this.c = 0;
const page = parseInt(this.props.location.query.page, 10) || 1; const page = parseInt(this.props.location.query.page, 10) || 1;
this.mailboxes = null; this.mailboxes = null;
...@@ -124,8 +126,10 @@ export default class Mailboxes extends React.Component { ...@@ -124,8 +126,10 @@ export default class Mailboxes extends React.Component {
handleExportAsCSV(e) { handleExportAsCSV(e) {
e.preventDefault(); e.preventDefault();
if (MailboxStore.getMailboxByDomainId(this.domainId)) { const mailboxesByDomainId = this.isStoreEnabled ? MailboxStore.getMailboxByDomainId(this.domainId) : null;
const accounts = MailboxStore.getMailboxByDomainId(this.domainId); const accountsFromState = this.state.accounts;
if (mailboxesByDomainId || accountsFromState) {
const accounts = mailboxesByDomainId || accountsFromState;
const title = `Casillas de ${accounts.account[0].domain}`; const title = `Casillas de ${accounts.account[0].domain}`;
return Utils.exportAsCSV(accounts.account, 'domain', title, true); return Utils.exportAsCSV(accounts.account, 'domain', title, true);
} }
...@@ -169,7 +173,7 @@ export default class Mailboxes extends React.Component { ...@@ -169,7 +173,7 @@ export default class Mailboxes extends React.Component {
domainInfo(domainId) { domainInfo(domainId) {
return new Promise( return new Promise(
(resolve, reject) => { (resolve, reject) => {
const domain = DomainStore.getCurrent(); const domain = this.isStoreEnabled ? DomainStore.getCurrent() : null;
if (domain && domainId === domain.id) { if (domain && domainId === domain.id) {
return resolve(); return resolve();
} }
...@@ -177,11 +181,13 @@ export default class Mailboxes extends React.Component { ...@@ -177,11 +181,13 @@ export default class Mailboxes extends React.Component {
return Client.getDomain( return Client.getDomain(
domainId, domainId,
(data) => { (data) => {
DomainStore.setCurrent(data); if (this.isStoreEnabled) {
return resolve(); DomainStore.setCurrent(data);
}
return resolve(data);
}, },
() => { (error) => {
return reject(); return reject(error);
} }
); );
} }
...@@ -208,7 +214,7 @@ export default class Mailboxes extends React.Component { ...@@ -208,7 +214,7 @@ export default class Mailboxes extends React.Component {
new Promise((resolve, reject) => { new Promise((resolve, reject) => {
if (domainName) { if (domainName) {
const hasMailboxForDomain = MailboxStore.getMailboxByDomainId(this.domainId); const hasMailboxForDomain = this.isStoreEnabled ? MailboxStore.getMailboxByDomainId(this.domainId) : null;
if (hasMailboxForDomain) { if (hasMailboxForDomain) {
return resolve(hasMailboxForDomain); return resolve(hasMailboxForDomain);
...@@ -216,7 +222,13 @@ export default class Mailboxes extends React.Component { ...@@ -216,7 +222,13 @@ export default class Mailboxes extends React.Component {
return Client.getAllAccounts(attrs, (success) => { return Client.getAllAccounts(attrs, (success) => {
const data = Utils.extractLockOuts(success); const data = Utils.extractLockOuts(success);
MailboxStore.setMailboxesByDomain(this.domainId, data); if (this.isStoreEnabled) {
MailboxStore.setMailboxesByDomain(this.domainId, data);
} else {
this.setState({
accounts: data
});
}
return resolve(success); return resolve(success);
}, (error) => { }, (error) => {
...@@ -224,13 +236,16 @@ export default class Mailboxes extends React.Component { ...@@ -224,13 +236,16 @@ export default class Mailboxes extends React.Component {
}); });
} }
if (MailboxStore.hasMailboxes()) { const hasMailboxes = this.isStoreEnabled ? MailboxStore.hasMailboxes() : null;
if (hasMailboxes) {
return resolve(MailboxStore.getMailboxes()); return resolve(MailboxStore.getMailboxes());
} }
return Client.getAllAccounts(attrs, (success) => { return Client.getAllAccounts(attrs, (success) => {
const data = Utils.extractLockOuts(success); const data = Utils.extractLockOuts(success);
MailboxStore.setMailboxes(data); if (this.isStoreEnabled) {
MailboxStore.setMailboxes(data);
}
return resolve(data); return resolve(data);
}, (error) => { }, (error) => {
...@@ -285,8 +300,8 @@ export default class Mailboxes extends React.Component { ...@@ -285,8 +300,8 @@ export default class Mailboxes extends React.Component {
getAllMailboxes(domainId) { getAllMailboxes(domainId) {
if (domainId) { if (domainId) {
return this.domainInfo(domainId).then(() => { return this.domainInfo(domainId).then((data) => {
const domain = DomainStore.getCurrent(); const domain = this.isStoreEnabled ? DomainStore.getCurrent() : data;
this.getAccounts(domain.name, window.manager_config.maxResultOnRequestZimbra); this.getAccounts(domain.name, window.manager_config.maxResultOnRequestZimbra);
}); });
} }
...@@ -295,7 +310,7 @@ export default class Mailboxes extends React.Component { ...@@ -295,7 +310,7 @@ export default class Mailboxes extends React.Component {
} }
refreshAllAccounts() { refreshAllAccounts() {
const mailboxes = MailboxStore.getMailboxes(); const mailboxes = this.isStoreEnabled ? MailboxStore.getMailboxes() : null;
const tables = this.buildTableFromData(mailboxes, ['Todas', 'Bloqueadas']); const tables = this.buildTableFromData(mailboxes, ['Todas', 'Bloqueadas']);
if (tables.lockedAlert) { if (tables.lockedAlert) {
...@@ -343,13 +358,9 @@ export default class Mailboxes extends React.Component { ...@@ -343,13 +358,9 @@ export default class Mailboxes extends React.Component {
tipo = 'Desconocido'; tipo = 'Desconocido';
} }
if (attrs.displayName) { displayName = attrs.displayName || `${attrs.givenName || attrs.cn} ${attrs.sn}`;
displayName = attrs.displayName.trim();
} else if (attrs.cn || attrs.sn) { const editUrlFromParams = this.props.params.domain_id ? `/domains/${this.props.params.domain_id}/mailboxes/` : '/mailboxes/';
const cn = attrs.cn || '';
const sn = attrs.sn || '';
displayName = `${cn.trim()} ${sn.trim()}`;
}
return ( return (
<tr <tr
...@@ -363,7 +374,7 @@ export default class Mailboxes extends React.Component { ...@@ -363,7 +374,7 @@ export default class Mailboxes extends React.Component {
btnAttrs={ btnAttrs={
{ {
className: 'mailbox-link', className: 'mailbox-link',
onClick: (e) => Utils.handleLink(e, 'mailboxes/' + id) onClick: (e) => Utils.handleLink(e, `${editUrlFromParams}${id}`)
} }
} }
> >
...@@ -384,7 +395,7 @@ export default class Mailboxes extends React.Component { ...@@ -384,7 +395,7 @@ export default class Mailboxes extends React.Component {
btnAttrs={ btnAttrs={
{ {
className: 'btn btn-xs btn-default', className: 'btn btn-xs btn-default',
onClick: (e) => Utils.handleLink(e, '/mailboxes/' + id + '/edit') onClick: (e) => Utils.handleLink(e, `${editUrlFromParams}${id}/edit`)
} }
} }
> >
...@@ -664,7 +675,10 @@ export default class Mailboxes extends React.Component { ...@@ -664,7 +675,10 @@ export default class Mailboxes extends React.Component {
if (this.state.loading) { if (this.state.loading) {
content = ( content = (
<div className='text-center'> <div
className='text-center'
key={'mailboxes-loading'}
>
<i className='fa fa-spinner fa-spin fa-4x fa-fw'></i> <i className='fa fa-spinner fa-spin fa-4x fa-fw'></i>
<p>{'Cargando Casillas...'}</p> <p>{'Cargando Casillas...'}</p>
</div> </div>
......
...@@ -31,6 +31,7 @@ export default class MailboxDetails extends React.Component { ...@@ -31,6 +31,7 @@ export default class MailboxDetails extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.isStoreEnabled = window.manager_config.enableStores;
this.getMailbox = this.getMailbox.bind(this); this.getMailbox = this.getMailbox.bind(this);
this.handleEdit = this.handleEdit.bind(this); this.handleEdit = this.handleEdit.bind(this);
this.showMessage = this.showMessage.bind(this); this.showMessage = this.showMessage.bind(this);
...@@ -84,7 +85,8 @@ export default class MailboxDetails extends React.Component { ...@@ -84,7 +85,8 @@ export default class MailboxDetails extends React.Component {
} }
getMailbox(id) { getMailbox(id) {
if (MailboxStore.hasMailboxes()) { const hasMailboxes = this.isStoreEnabled ? MailboxStore.hasMailboxes() : null;
if (hasMailboxes) {
const account = MailboxStore.getMailboxById(id); const account = MailboxStore.getMailboxById(id);
MailboxStore.setCurrent(account); MailboxStore.setCurrent(account);
let items = account.attrs.zimbraMailAlias; let items = account.attrs.zimbraMailAlias;
...@@ -122,6 +124,7 @@ export default class MailboxDetails extends React.Component { ...@@ -122,6 +124,7 @@ export default class MailboxDetails extends React.Component {
}); });
}).then((result) => { }).then((result) => {
MailboxStore.setCurrent(result); MailboxStore.setCurrent(result);
let items = result.attrs.zimbraMailAlias; let items = result.attrs.zimbraMailAlias;
if (items) { if (items) {
...@@ -318,12 +321,14 @@ export default class MailboxDetails extends React.Component { ...@@ -318,12 +321,14 @@ export default class MailboxDetails extends React.Component {
/> />
); );
const editUrlFromParams = this.props.params.domain_id ? `/domains/${this.props.params.domain_id}/mailboxes/` : '/mailboxes/';
btnsGeneralInfo = [ btnsGeneralInfo = [
{ {
props: { props: {
className: 'btn btn-xs btn-default action-info-btns', className: 'btn btn-xs btn-default action-info-btns',
onClick: (e) => { onClick: (e) => {
this.handleEdit(e, `/mailboxes/${this.state.data.id}/edit`, this.props.location); this.handleEdit(e, `${editUrlFromParams}${this.state.data.id}/edit`, this.props.location);
} }
}, },
label: 'Editar' label: 'Editar'
......
...@@ -55,6 +55,10 @@ export default class PanelActions extends React.Component { ...@@ -55,6 +55,10 @@ export default class PanelActions extends React.Component {
onSearch() { onSearch() {
const search = this.refs.search.value; const search = this.refs.search.value;
if (!this.props.data) {
return null;
}
const arrayFiltered = this.props.data.filter((strArray) => { const arrayFiltered = this.props.data.filter((strArray) => {
if (strArray.match(search)) { if (strArray.match(search)) {
return strArray; return strArray;
...@@ -209,11 +213,10 @@ export default class PanelActions extends React.Component { ...@@ -209,11 +213,10 @@ export default class PanelActions extends React.Component {
handleChangeLimit() { handleChangeLimit() {
const limit = this.refs.countItems.value; const limit = this.refs.countItems.value;
this.pagination.setLimit(limit); this.pagination.setLimit(limit);
this.pagination.reset();
const states = {}; const states = {};
states['items' + this.props.name] = this.pagination.init(); states['items' + this.props.name] = this.pagination.reset();
states['pagination' + this.props.name] = this.pagination.getResults(); states['pagination' + this.props.name] = this.pagination.getResults();
this.setState(states); this.setState(states);
......
...@@ -55,6 +55,10 @@ export default class PanelActions extends React.Component { ...@@ -55,6 +55,10 @@ export default class PanelActions extends React.Component {
onSearch() { onSearch() {
const search = this.refs.search.value; const search = this.refs.search.value;
if (!this.props.data) {
return null;
}
const arrayFiltered = this.props.data.filter((strArray) => { const arrayFiltered = this.props.data.filter((strArray) => {
const strToTest = typeof strArray.name === 'string' ? strArray.name : strArray.id; const strToTest = typeof strArray.name === 'string' ? strArray.name : strArray.id;
return strToTest.match(search); return strToTest.match(search);
......
{ {
"debug": true, "debug": true,
"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",
"dnsApiUrl": "http://zimbra.zboxapp.dev:3000", "dnsApiUrl": "http://zimbra.zboxapp.dev:3000",
"webMailUrl": "https://192.168.1.8:8443", "webMailUrl": "https://192.168.1.8:8443",
"dns": { "dns": {
"url": "http://zimbra.zboxapp.dev:9081/powerdns_proxy", "url": "http://zimbra.zboxapp.dev:9081/powerdns_proxy",
"token": "otto" "token": "otto",
"inmutable": ["mx", "soa", "ns", "spf"]
}, },
"maxResultOnRequestZimbra": 3000, "maxResultOnRequestZimbra": 3000,
"autoincrementOnFailRequestZimbra": 500, "autoincrementOnFailRequestZimbra": 500,
......
...@@ -148,6 +148,14 @@ function renderRootComponent() { ...@@ -148,6 +148,14 @@ function renderRootComponent() {
path='domains/:domain_id/mailboxes' path='domains/:domain_id/mailboxes'
component={Mailboxes} component={Mailboxes}
/> />
<Route
path='domains/:domain_id/mailboxes/:id'
component={MailboxDetails}
/>
<Route
path='domains/:domain_id/mailboxes/:id/edit'
component={EditMailBox}
/>
<Route <Route
path='domains/:domain_id/distribution_lists/:id' path='domains/:domain_id/distribution_lists/:id'
component={DistributionLists} component={DistributionLists}
......
...@@ -21,6 +21,10 @@ ...@@ -21,6 +21,10 @@
font-weight: 600; font-weight: 600;
padding: 10px 4px; padding: 10px 4px;
transition: all .3s; transition: all .3s;
.heading-buttons {
max-width: 50%;
}
} }
.hbuilt { .hbuilt {
......
...@@ -13,11 +13,30 @@ html { ...@@ -13,11 +13,30 @@ html {
body { body {
background-color: $white; background-color: $white;
color: $color-text; color: $color-text;
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; font-family: 'Open Sans", "Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 13px; font-size: 13px;
height: 100%; height: 100%;
margin: 0; margin: 0;
padding: 0; padding: 0;
&::after {
background: $bg-beta;
color: $white;
content: 'Beta';
font-family: sans-serif;
font-size: 13px;
font-weight: bold;
height: 25px;
left: -20px;
line-height: 27px;
position: fixed;
text-align: center;
text-shadow: 0 3px 1px $black;
text-transform: uppercase;
top: 7px;
transform: rotate(-45deg);
width: 80px;
}
} }
#header { #header {
......
...@@ -122,3 +122,6 @@ $sweet-green: #a5dc86; ...@@ -122,3 +122,6 @@ $sweet-green: #a5dc86;
$keyframe-bg-color: #f8d486; $keyframe-bg-color: #f8d486;
$keyframe-bg-color2: #f8bb86; $keyframe-bg-color2: #f8bb86;
$la-dark-color: #333; $la-dark-color: #333;
//beta style
$bg-beta: #ee8e4a;
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