Skip to content

Commit c4480f2

Browse files
authored
Merge branch 'development' into gamma
2 parents 4ea1436 + e7b88e1 commit c4480f2

File tree

5 files changed

+68
-20
lines changed

5 files changed

+68
-20
lines changed

app/controllers/account/billing/invoices/list.js

Lines changed: 43 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
1010
columns = [
1111
{
1212
name : 'Invoice ID',
13-
valuePath : 'id'
13+
valuePath : 'identifier'
1414
},
1515
{
16-
name : 'Name',
16+
name : 'Event Name',
1717
valuePath : 'event',
1818
cellComponent : 'ui-table/cell/events/cell-event-invoice'
1919
},
@@ -22,8 +22,10 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
2222
valuePath : 'createdAt'
2323
},
2424
{
25-
name : 'Outstanding Amount',
26-
valuePath : 'amount'
25+
name : 'Outstanding Amount',
26+
valuePath : 'amount',
27+
extraValuePaths : ['event'],
28+
cellComponent : 'ui-table/cell/events/cell-amount'
2729
},
2830
{
2931
name : 'View Invoice',
@@ -34,10 +36,10 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
3436
columns = [
3537
{
3638
name : 'Invoice ID',
37-
valuePath : 'id'
39+
valuePath : 'identifier'
3840
},
3941
{
40-
name : 'Name',
42+
name : 'Event Name',
4143
valuePath : 'event',
4244
cellComponent : 'ui-table/cell/events/cell-event-invoice'
4345
},
@@ -46,8 +48,10 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
4648
valuePath : 'createdAt'
4749
},
4850
{
49-
name : 'Amount',
50-
valuePath : 'amount'
51+
name : 'Amount',
52+
valuePath : 'amount',
53+
extraValuePaths : ['event'],
54+
cellComponent : 'ui-table/cell/events/cell-amount'
5155
},
5256
{
5357
name : 'Date Paid',
@@ -56,17 +60,23 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
5660
{
5761
name : 'View Invoice',
5862
valuePath : 'invoicePdfUrl'
63+
},
64+
{
65+
name : 'Action',
66+
valuePath : 'identifier',
67+
extraValuePaths : ['status'],
68+
cellComponent : 'ui-table/cell/events/cell-action'
5969
}
6070

6171
];
6272
} else if (this.model.params.invoice_status === 'due') {
6373
columns = [
6474
{
6575
name : 'Invoice ID',
66-
valuePath : 'id'
76+
valuePath : 'identifier'
6777
},
6878
{
69-
name : 'Name',
79+
name : 'Event Name',
7080
valuePath : 'event',
7181
cellComponent : 'ui-table/cell/events/cell-event-invoice'
7282

@@ -76,33 +86,49 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
7686
valuePath : 'createdAt'
7787
},
7888
{
79-
name : 'Amount Due',
80-
valuePath : 'amount'
89+
name : 'Amount Due',
90+
valuePath : 'amount',
91+
extraValuePaths : ['event'],
92+
cellComponent : 'ui-table/cell/events/cell-amount'
8193
},
8294
{
8395
name : 'View Invoice',
8496
valuePath : 'invoicePdfUrl'
97+
},
98+
{
99+
name : 'Action',
100+
valuePath : 'identifier',
101+
extraValuePaths : ['status'],
102+
cellComponent : 'ui-table/cell/events/cell-action'
85103
}
86104

87105
];
88-
} else if (this.model.params.invoice_status === 'due') {
106+
} else if (this.model.params.invoice_status === 'all') {
89107
columns = [
90108
{
91109
name : 'Invoice ID',
92-
valuePath : 'id'
110+
valuePath : 'identifier'
93111
},
94112
{
95-
name : 'Name',
113+
name : 'Event Name',
96114
valuePath : 'event',
97115
cellComponent : 'ui-table/cell/events/cell-event-invoice'
98116
},
99117
{
100-
name : 'Amount',
101-
valuePath : 'amount'
118+
name : 'Amount',
119+
valuePath : 'amount',
120+
extraValuePaths : ['event'],
121+
cellComponent : 'ui-table/cell/events/cell-amount'
102122
},
103123
{
104124
name : 'Status',
105125
valuePath : 'status'
126+
},
127+
{
128+
name : 'Action',
129+
valuePath : 'identifier',
130+
extraValuePaths : ['status'],
131+
cellComponent : 'ui-table/cell/events/cell-action'
106132
}
107133

108134
];
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import Route from '@ember/routing/route';
2+
3+
export default Route.extend({
4+
beforeModel() {
5+
this._super(...arguments);
6+
this.transitionTo('account.billing.invoices.list', 'all');
7+
}
8+
});
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{{#if (eq extraRecords.status 'due')}}
2+
{{#link-to 'event-invoice.review' record class='ui blue button'}}
3+
{{t 'Review and Pay'}}
4+
{{/link-to}}
5+
{{else}}
6+
{{#link-to 'event-invoice.paid' record class='ui green button'}}
7+
{{t 'See Payment'}}
8+
{{/link-to}}
9+
{{/if}}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{currency-symbol extraRecords.event.paymentCurrency}} {{format-number record}}

tests/integration/components/ui-table/cell/events/view/tickets/orders/cell-amount-test.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@ import { render } from '@ember/test-helpers';
55

66
module('Integration | Component | ui table/cell/events/view/tickets/orders/cell amount', function(hooks) {
77
setupIntegrationTest(hooks);
8-
8+
const extraRecords = {
9+
event: {
10+
paymentCurrency: 'USD'
11+
}
12+
};
913
test('it renders', async function(assert) {
10-
11-
await render(hbs`{{ui-table/cell/events/view/tickets/orders/cell-amount paymentCurrency='USD'}}`);
14+
this.set('extraRecords', extraRecords);
15+
await render(hbs`{{ui-table/cell/events/view/tickets/orders/cell-amount extraRecords=extraRecords}}`);
1216
assert.ok(this.element.textContent.trim().includes(''));
1317
});
1418
});

0 commit comments

Comments
 (0)