* Add link to file in Downloads table

* Fix wrong param name for 'ip_address'
This commit is contained in:
Albert Juhé Lluveras 2019-01-08 17:51:19 +01:00 committed by GitHub
parent d2ca354bd5
commit 41b933e714
2 changed files with 7 additions and 3 deletions

View File

@ -132,7 +132,7 @@ export const advancedFilters = {
} ) ),
},
},
downloadIp: {
ip_address: {
labels: {
add: __( 'IP Address', 'wc-admin' ),
placeholder: __( 'Search IP address', 'wc-admin' ),

View File

@ -72,7 +72,7 @@ export default class CouponsReportTable extends Component {
const persistedQuery = getPersistedQuery( query );
return map( downloads, download => {
const { _embedded, date, file_name, ip_address, order_id, product_id } = download;
const { _embedded, date, file_name, file_path, ip_address, order_id, product_id } = download;
const { name: productName } = _embedded.product[ 0 ];
const { name: userName } = _embedded.user[ 0 ];
@ -95,7 +95,11 @@ export default class CouponsReportTable extends Component {
value: productName,
},
{
display: file_name,
display: (
<Link href={ file_path } type="external">
{ file_name }
</Link>
),
value: file_name,
},
{