Skip to content

Commit 42b5bcc

Browse files
shreyanshdwivediabhinavk96
authored andcommitted
fix: pagination/searching/sorting in billing invoice table (#3473)
1 parent 7ef8165 commit 42b5bcc

File tree

3 files changed

+10
-6
lines changed
  • app
    • controllers/account/billing/invoices
    • routes/account/billing/invoices
    • templates/account/billing/invoices

3 files changed

+10
-6
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,15 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
118118
name : 'Amount',
119119
valuePath : 'amount',
120120
extraValuePaths : ['event'],
121-
cellComponent : 'ui-table/cell/events/cell-amount'
121+
cellComponent : 'ui-table/cell/events/cell-amount',
122+
isSortable : true,
123+
headerComponent : 'tables/headers/sort'
122124
},
123125
{
124-
name : 'Status',
125-
valuePath : 'status'
126+
name : 'Status',
127+
valuePath : 'status',
128+
isSortable : true,
129+
headerComponent : 'tables/headers/sort'
126130
},
127131
{
128132
name : 'Action',

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default class extends Route.extend(EmberTableRouteMixin) {
1818
}
1919
async model(params) {
2020
this.set('params', params);
21-
const searchField = 'name';
21+
const searchField = 'status';
2222
let filterOptions = [];
2323
if (params.invoice_status === 'paid' || params.invoice_status === 'due') {
2424
filterOptions = [
@@ -59,7 +59,7 @@ export default class extends Route.extend(EmberTableRouteMixin) {
5959

6060
queryString = this.applySortFilters(queryString, params);
6161
return {
62-
eventInvoices: (await this.store.query('event-invoice', queryString)).toArray(),
62+
eventInvoices: await this.asArray(this.store.query('event-invoice', queryString)),
6363
params
6464

6565
};

app/templates/account/billing/invoices/list.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="sixteen wide column">
22
{{tables/default columns=columns
3-
rows=model.eventInvoices
3+
rows=model.eventInvoices.data
44
currentPage=page
55
pageSize=per_page
66
searchQuery=search

0 commit comments

Comments
 (0)