[WooCommerce Analytics] Add Guest label when no customer name (#49594)
* Show Guest when there is no Customer name * Show Guest when there is no Customer name
This commit is contained in:
parent
acea491755
commit
a5c9db8fac
|
@ -5,7 +5,7 @@ import { __, _n } from '@wordpress/i18n';
|
||||||
import { Fragment, useContext } from '@wordpress/element';
|
import { Fragment, useContext } from '@wordpress/element';
|
||||||
import { useSelect } from '@wordpress/data';
|
import { useSelect } from '@wordpress/data';
|
||||||
import { Tooltip } from '@wordpress/components';
|
import { Tooltip } from '@wordpress/components';
|
||||||
import { Date, Link } from '@woocommerce/components';
|
import { Date, Link, Pill } from '@woocommerce/components';
|
||||||
import { formatValue } from '@woocommerce/number';
|
import { formatValue } from '@woocommerce/number';
|
||||||
import { getAdminLink } from '@woocommerce/settings';
|
import { getAdminLink } from '@woocommerce/settings';
|
||||||
import { defaultTableDateFormat } from '@woocommerce/date';
|
import { defaultTableDateFormat } from '@woocommerce/date';
|
||||||
|
@ -141,6 +141,12 @@ function CustomersReportTable( {
|
||||||
country,
|
country,
|
||||||
} = customer;
|
} = customer;
|
||||||
const countryName = getCountryName( country );
|
const countryName = getCountryName( country );
|
||||||
|
const customerName =
|
||||||
|
name?.trim() !== '' ? (
|
||||||
|
name
|
||||||
|
) : (
|
||||||
|
<Pill>{ __( 'Guest', 'woocommerce' ) }</Pill>
|
||||||
|
);
|
||||||
|
|
||||||
const customerNameLink = userId ? (
|
const customerNameLink = userId ? (
|
||||||
<Link
|
<Link
|
||||||
|
@ -150,7 +156,7 @@ function CustomersReportTable( {
|
||||||
{ name }
|
{ name }
|
||||||
</Link>
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
name
|
customerName
|
||||||
);
|
);
|
||||||
|
|
||||||
const dateLastActiveDisplay = dateLastActive ? (
|
const dateLastActiveDisplay = dateLastActive ? (
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: tweak
|
||||||
|
|
||||||
|
Show Guest when there is no Customer name
|
Loading…
Reference in New Issue