Skip to content

Commit

Permalink
Merge pull request #10212 from google/issue/10045-include-learn-more-…
Browse files Browse the repository at this point in the history
…link-in-lost-events-banner

Issue / 10045 Include Learn More Link in Lost Events Banner
  • Loading branch information
eugene-manuilov authored Feb 12, 2025
2 parents 2b6e732 + d8c3178 commit 42917df
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions assets/js/components/KeyMetrics/LostEventsSubtleNotification.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,46 @@ import PropTypes from 'prop-types';
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { useSelect } from '@wordpress/data';
import { createInterpolateElement } from '@wordpress/element';

/**
* Internal dependencies
*/
import { CORE_SITE } from '../../googlesitekit/datastore/site/constants';
import { Button } from 'googlesitekit-components';
import SubtleNotification from '../../googlesitekit/notifications/components/layout/SubtleNotification';
import Warning from '../../../svg/icons/warning.svg';
import Link from '../Link';

export default function LostEventsSubtleNotification( {
onSelectMetricsCallback,
onDismissCallback,
} ) {
const lostEventsDocumentationURL = useSelect( ( select ) =>
select( CORE_SITE ).getDocumentationLinkURL( 'unavailable-metric-data' )
);
return (
<SubtleNotification
className="googlesitekit-acr-subtle-notification googlesitekit-acr-subtle-notification__lost-events"
title={ __( 'Unavailable metrics data', 'google-site-kit' ) }
description={ __(
'We couldn’t detect any events for some of your metrics in over 90 days. You can select other metrics for your dashboard.',
'google-site-kit'
description={ createInterpolateElement(
__(
'We couldn’t detect any events for some of your metrics in over 90 days. You can select other metrics for your dashboard. <a>Learn more</a>',
'google-site-kit'
),
{
a: (
<Link
href={ lostEventsDocumentationURL }
external
aria-label={ __(
'Learn more about unavailable metric data',
'google-site-kit'
) }
/>
),
}
) }
dismissCTA={
<Button tertiary onClick={ onDismissCallback }>
Expand Down

0 comments on commit 42917df

Please sign in to comment.