cleanup ids

This commit is contained in:
Paul Sealock 2020-11-18 14:07:05 +13:00
parent b52ba3bdcc
commit 569b016b24
1 changed files with 8 additions and 8 deletions

View File

@ -31,17 +31,17 @@ const NavigationPlugin = () => {
const pages = getPages() const pages = getPages()
.filter( ( page ) => ! pagesWithoutNavigation.includes( page.path ) ) .filter( ( page ) => ! pagesWithoutNavigation.includes( page.path ) )
.map( ( page ) => { .map( ( page ) => {
if ( page.path === '/analytics/settings' ) { const pageWithId = {
...page,
id: `wc-admin&path=${ page.path }`,
};
if ( pageWithId.path === '/analytics/settings' ) {
return { return {
...page, ...pageWithId,
id: 'wc-admin&path=' + page.path,
breadcrumbs: [ __( 'Analytics', 'woocommerce-admin' ) ], breadcrumbs: [ __( 'Analytics', 'woocommerce-admin' ) ],
}; };
} }
return { return pageWithId;
...page,
id: 'wc-admin&path=' + page.path,
};
} ); } );
const persistedQuery = getPersistedQuery( {} ); const persistedQuery = getPersistedQuery( {} );
return ( return (
@ -58,7 +58,7 @@ const NavigationPlugin = () => {
</WooNavigationItem> </WooNavigationItem>
) ) } ) ) }
{ reports.map( ( item ) => { { reports.map( ( item ) => {
const id = 'wc-admin&path=/analytics/' + item.report; const id = `wc-admin&path=/analytics/${ item.report }`;
return ( return (
<WooNavigationItem item={ id } key={ id }> <WooNavigationItem item={ id } key={ id }>
<Link <Link