Skip to content

Commit 7ea1a20

Browse files
na3ddisplague
authored andcommitted
billing invoices and history linter fixes
1 parent 5634ab9 commit 7ea1a20

File tree

7 files changed

+22
-28
lines changed

7 files changed

+22
-28
lines changed

src/api/configs/invoices.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ export const config = genConfig({
1111
singular: 'items',
1212
endpoint: id => `/account/invoices/${id}/items`,
1313
supports: [ONE],
14-
},
1514
},
15+
},
1616
});
1717

1818
export const actions = genActions(config);

src/billing/layouts/DashboardPage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export class DashboardPage extends Component {
8585
</FormGroup>
8686
<FormGroup className="row">
8787
<div className="col-sm-12 text-right">
88-
<Link to={`/billing/history`}>Billing History</Link>
88+
<Link to="/billing/history">Billing History</Link>
8989
</div>
9090
</FormGroup>
9191
<h3 className="sub-header">Account Balance</h3>

src/billing/layouts/HistoryPage.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ import moment from 'moment-timezone';
55
import { getStorage } from '~/storage';
66
import { Card, CardHeader } from 'linode-components/cards';
77
import { Table } from 'linode-components/tables';
8-
import { ListBody } from 'linode-components/lists/bodies';
9-
import { LinkCell, ButtonCell } from 'linode-components/tables/cells';
10-
import { account, invoices } from '~/api';
8+
import { LinkCell } from 'linode-components/tables/cells';
119

1210
import { setSource } from '~/actions/source';
1311

@@ -50,7 +48,7 @@ export class HistoryPage extends Component {
5048
/>
5149
<div className="row">
5250
<div className="col-sm-12 text-right">
53-
<strong>Current Balance: ${account.balance}</strong>
51+
<strong>Current Balance: ${account.balance}</strong>
5452
</div>
5553
</div>
5654
</Card>

src/billing/layouts/InvoicePage.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ import moment from 'moment-timezone';
55
import { getStorage } from '~/storage';
66
import { Card, CardHeader } from 'linode-components/cards';
77
import { Table } from 'linode-components/tables';
8-
import { List } from 'linode-components/lists';
9-
import { ListBody } from 'linode-components/lists/bodies';
10-
import { LinkCell, ButtonCell } from 'linode-components/tables/cells';
11-
import { objectFromMapByLabel } from '~/api/util';
128
import { invoices } from '~/api';
139

1410
import { setSource } from '~/actions/source';
@@ -40,7 +36,7 @@ export class InvoicePage extends Component {
4036
label: 'From',
4137
headerClassName: 'DateColumn',
4238
formatFn: (from) => {
43-
if(!from) {
39+
if (!from) {
4440
return;
4541
}
4642
const time = moment.utc(from, moment.iso_8601).tz(timezone);
@@ -52,7 +48,7 @@ export class InvoicePage extends Component {
5248
label: 'To',
5349
headerClassName: 'DateColumn',
5450
formatFn: (to) => {
55-
if(!to) {
51+
if (!to) {
5652
return;
5753
}
5854
const time = moment.utc(to, moment.iso_8601).tz(timezone);
@@ -71,7 +67,7 @@ export class InvoicePage extends Component {
7167
headerClassName: 'IntegerColumn text-right',
7268
className: 'text-right',
7369
formatFn: (unitPrice) => {
74-
if(!unitPrice) {
70+
if (!unitPrice) {
7571
return;
7672
}
7773
return `$${parseFloat(unitPrice).toFixed(4)}`;
@@ -92,7 +88,7 @@ export class InvoicePage extends Component {
9288
/>
9389
<div className="row">
9490
<div className="col-sm-12 text-right">
95-
<strong>Invoice Total: ${invoice.total.toFixed(2)}</strong>
91+
<strong>Invoice Total: ${invoice.total.toFixed(2)}</strong>
9692
</div>
9793
</div>
9894
</Card>
@@ -105,6 +101,7 @@ export class InvoicePage extends Component {
105101
InvoicePage.propTypes = {
106102
dispatch: PropTypes.func,
107103
invoice: PropTypes.object.isRequired,
104+
items: PropTypes.object.isRequired,
108105
};
109106

110107
function select(state, ownProps) {

test/billing/layouts/HistoryPage.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe('billing/layouts/HistoryPage', () => {
3131
const rowCount = Object.keys(invoices.invoices).length;
3232
expect(page.find('.TableRow').length).to.equal(rowCount);
3333
});
34-
34+
3535
it('renders account balance', () => {
3636
const page = mount(
3737
<HistoryPage

test/billing/layouts/InvoicePage.spec.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React from 'react';
22
import sinon from 'sinon';
33
import { mount } from 'enzyme';
44
import { expect } from 'chai';
5-
import moment from 'moment-timezone';
65

76
import { InvoicePage } from '~/billing/layouts/InvoicePage';
87
import { api } from '@/data';

test/data/invoices.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,28 @@ export const apiTestInvoice = {
1717
data: [
1818
testItem,
1919
{
20-
...testItem,
21-
label: 'Linode 1024 - ln (1234)',
20+
...testItem,
21+
label: 'Linode 1024 - ln (1234)',
2222
},
2323
{
24-
...testItem,
25-
label: 'Storage Volume - sv (123)',
24+
...testItem,
25+
label: 'Storage Volume - sv (123)',
2626
},
2727
{
28-
...testItem,
29-
label: 'Backup Service - Linode 1024 - ln (1234)',
28+
...testItem,
29+
label: 'Backup Service - Linode 1024 - ln (1234)',
3030
},
3131
{
32-
...testItem,
33-
label: 'Nodebalancer - nb (432)',
32+
...testItem,
33+
label: 'Nodebalancer - nb (432)',
3434
},
3535
{
36-
...testItem,
37-
label: 'Linode 1024 - ln (1235)',
36+
...testItem,
37+
label: 'Linode 1024 - ln (1235)',
3838
},
3939
{
40-
...testItem,
41-
label: 'Linode 1024 - ln (1236)',
40+
...testItem,
41+
label: 'Linode 1024 - ln (1236)',
4242
},
4343
],
4444
},

0 commit comments

Comments
 (0)