This commit is contained in:
Albert Juhé Lluveras 2018-12-15 00:56:52 +01:00 committed by Timmy Crawford
parent 88b81beac0
commit f9533afdda
4 changed files with 11 additions and 11 deletions

View File

@ -74,7 +74,7 @@ class ReportTable extends Component {
const isRequesting = tableData.isRequesting || primaryData.isRequesting;
const orderedItems = orderBy( items.data, query.orderby, query.order );
const totals = get( primaryData, [ 'data', 'totals' ], null );
const totalCount = items.totalCount || 0;
const totalResults = items.totalResults || 0;
const { headers, ids, rows, summary } = applyFilters( TABLE_FILTER, {
endpoint: endpoint,
headers: getHeadersContent(),
@ -82,7 +82,7 @@ class ReportTable extends Component {
ids: itemIdField ? orderedItems.map( item => item[ itemIdField ] ) : null,
rows: getRowsContent( orderedItems ),
totals: totals,
summary: getSummary ? getSummary( totals, totalCount ) : null,
summary: getSummary ? getSummary( totals, totalResults ) : null,
} );
// Hide any headers based on user prefs, if loaded.
@ -99,7 +99,7 @@ class ReportTable extends Component {
rows={ rows }
rowsPerPage={ parseInt( query.per_page ) }
summary={ summary }
totalRows={ totalCount }
totalRows={ totalResults }
{ ...tableProps }
/>
);

View File

@ -98,15 +98,15 @@ export default class CategoriesReportTable extends Component {
} );
}
getSummary( totals, totalCount ) {
getSummary( totals, totalResults ) {
if ( ! totals ) {
return [];
}
return [
{
label: _n( 'category', 'categories', totalCount, 'wc-admin' ),
value: numberFormat( totalCount ),
label: _n( 'category', 'categories', totalResults, 'wc-admin' ),
value: numberFormat( totalResults ),
},
{
label: _n( 'item sold', 'items sold', totals.items_sold, 'wc-admin' ),

View File

@ -285,7 +285,7 @@ export default compose(
tableData: {
items: {
data: formatTableOrders( orders ),
totalCount: ordersTotalCount,
totalResults: ordersTotalCount,
},
isError,
isRequesting,

View File

@ -162,15 +162,15 @@ class RevenueReportTable extends Component {
} );
}
getSummary( totals, totalCount ) {
getSummary( totals, totalResults ) {
if ( ! totals ) {
return [];
}
return [
{
label: _n( 'day', 'days', totalCount, 'wc-admin' ),
value: numberFormat( totalCount ),
label: _n( 'day', 'days', totalResults, 'wc-admin' ),
value: numberFormat( totalResults ),
},
{
label: _n( 'order', 'orders', totals.orders_count, 'wc-admin' ),
@ -245,7 +245,7 @@ export default compose(
tableData: {
items: {
data: get( revenueData, [ 'data', 'intervals' ] ),
totalCount: get( revenueData, [ 'totalResults' ] ),
totalResults: get( revenueData, [ 'totalResults' ] ),
},
isError,
isRequesting,