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