Commit c8e75f31 authored by Elias Nahum's avatar Elias Nahum Committed by Juorder Antonio

fix lodout when user credential has expired, add formatter to total invoice, add pag to domain list

parent 37ef6581
...@@ -59,27 +59,27 @@ app.get('/company/:id/invoices', (req, res) => { ...@@ -59,27 +59,27 @@ app.get('/company/:id/invoices', (req, res) => {
number: 355, number: 355,
link: 'http://google.com', link: 'http://google.com',
date: moment('2016-01-01').toJSON(), date: moment('2016-01-01').toJSON(),
total: '$ 54.490', total: '235581',
status: 1 status: 1
}, },
{ {
number: 356, number: 356,
link: 'http://google.com', link: 'http://google.com',
date: moment('2016-02-01').toJSON(), date: moment('2016-02-01').toJSON(),
total: '$ 54.490', total: '27581',
status: 2 status: 2
}, },
{ {
number: 357, number: 357,
date: moment('2016-02-01').toJSON(), date: moment('2016-02-01').toJSON(),
total: '$ 54.490', total: '30581',
status: 3 status: 3
}, },
{ {
number: 358, number: 358,
link: 'http://google.com', link: 'http://google.com',
date: moment('2016-03-01').toJSON(), date: moment('2016-03-01').toJSON(),
total: '$ 54.490', total: '35581',
status: 0 status: 0
} }
]); ]);
......
module.exports = {"main":{"js":"/516290bundle.js"}} module.exports = {"main":{"js":"/072329bundle.js"}}
\ No newline at end of file \ No newline at end of file
...@@ -12,6 +12,7 @@ import StatusLabel from '../status_label.jsx'; ...@@ -12,6 +12,7 @@ import StatusLabel from '../status_label.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';
import currencyFormatter from 'currency-formatter';
const messageType = Constants.MessageType; const messageType = Constants.MessageType;
...@@ -86,6 +87,7 @@ export default class CompanyInvoices extends React.Component { ...@@ -86,6 +87,7 @@ export default class CompanyInvoices extends React.Component {
let status; let status;
let statusClass = ''; let statusClass = '';
let number = i.number; let number = i.number;
const total = i.total > 0 ? currencyFormatter.format(i.total, {code: 'USD', symbol: '$ '}) : i.total;
if (i.link) { if (i.link) {
number = ( number = (
<a <a
...@@ -122,7 +124,7 @@ export default class CompanyInvoices extends React.Component { ...@@ -122,7 +124,7 @@ export default class CompanyInvoices extends React.Component {
{number} {number}
</td> </td>
<td className='text-center'> <td className='text-center'>
{i.total} {total}
</td> </td>
<td className='text-center'> <td className='text-center'>
{moment(i.date).locale('es').format('DD [de] MMMM [de] YYYY')} {moment(i.date).locale('es').format('DD [de] MMMM [de] YYYY')}
......
{ {
"debug": true, "debug": false,
"zimbraUrl": "http://zimbra.zboxapp.dev:8000/service/admin/soap", "zimbraUrl": "http://zimbra.zboxapp.dev:8000/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",
......
...@@ -18,7 +18,9 @@ function handleError(methodName, err) { ...@@ -18,7 +18,9 @@ function handleError(methodName, err) {
if (err.extra && if (err.extra &&
(err.extra.code === Constants.ZimbraCodes.AUTH_EXPIRED || err.extra.code === Constants.ZimbraCodes.AUTH__REQUIRED) (err.extra.code === Constants.ZimbraCodes.AUTH_EXPIRED || err.extra.code === Constants.ZimbraCodes.AUTH__REQUIRED)
) { ) {
logout(); logout(() => {
Utils.kickOutUserWhenAuthExpired();
});
return err; return err;
} }
......
...@@ -603,12 +603,9 @@ export function setInitialDate() { ...@@ -603,12 +603,9 @@ export function setInitialDate() {
return dateObject; return dateObject;
} }
export function cloneObject(obj) { export function kickOutUserWhenAuthExpired() {
var copy = obj.constructor(); let query = `?error=${Constants.ZimbraCodes.AUTH_EXPIRED}`;
for (var attr in obj) {
if (obj.hasOwnProperty(attr)) { GlobalActions.emitEndLoading();
copy[attr] = obj[attr]; browserHistory.push(`/login${query}`);
}
}
return copy;
} }
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