Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

improved 'no events' message (#397)

Andrii Romasiuncfcecd3f292f
diff --git a/app/pages/Project/View/components/NoEvents.tsx b/app/pages/Project/View/components/NoEvents.tsx
index 810b0e723..e4a375aae 100644
--- a/app/pages/Project/View/components/NoEvents.tsx
+++ b/app/pages/Project/View/components/NoEvents.tsx
@@ -1,10 +1,18 @@
import React, { memo } from 'react'
-import { useTranslation, Trans } from 'react-i18next'
+import { useTranslation } from 'react-i18next'
import _isEmpty from 'lodash/isEmpty'
import PropTypes from 'prop-types'
import Button from 'ui/Button'
-import { DOCS_URL } from 'redux/constants'
+
+interface INoEvents {
+ filters: {
+ column: string
+ filter: string
+ isExclusive: boolean
+ }[]
+ resetFilters: () => void
+}
/**
* This component is used to display text if the data is not available.
@@ -14,17 +22,7 @@ import { DOCS_URL } from 'redux/constants'
* @param {string} pid - Project ID.
* @returns {JSX.Element}
*/
-const NoEvents = ({
- filters,
- resetFilters,
-}: {
- filters: {
- column: string
- filter: string
- isExclusive: boolean
- }[]
- resetFilters: () => void
-}): JSX.Element => {
+const NoEvents = ({ filters, resetFilters }: INoEvents): JSX.Element => {
const {
t,
}: {
@@ -35,25 +33,7 @@ const NoEvents = ({
<div className='flex flex-col py-6 sm:px-6 lg:px-8 mt-5'>
<div className='max-w-7xl w-full mx-auto text-gray-900 dark:text-gray-50'>
<h2 className='text-4xl text-center leading-tight my-3'>{t('project.noEvTitle')}</h2>
- <h2 className='text-2xl mb-8 text-center leading-snug'>
- <Trans
- // @ts-ignore
- t={t}
- i18nKey='project.noEvContent'
- components={{
- // eslint-disable-next-line jsx-a11y/anchor-has-content
- url: (
- <a
- title={`${t('titles.docs')} (opens in a new tab)`}
- href={DOCS_URL}
- className='hover:underline text-blue-600'
- target='_blank'
- rel='noreferrer noopener'
- />
- ),
- }}
- />
- </h2>
+ <h2 className='text-2xl mb-8 text-center leading-snug'>{t('project.noEvContent')}</h2>
{!_isEmpty(filters) && (
<div className='!flex !mx-auto'>
<Button onClick={resetFilters} className='!flex !mx-auto' primary giant>
diff --git a/public/locales/en.json b/public/locales/en.json
index bd3958645..f2b5d5934 100644
--- a/public/locales/en.json
+++ b/public/locales/en.json
@@ -619,7 +619,7 @@
"desc": "We're waiting for your first pageview! If your integration is set up correctly, you should see it within 1 minute.\n<snippet>Click here</snippet> to view your JavaScript tracking code.\nStill not working? Try <turl>troubleshooting</turl> your integration or <curl>contact us</curl> for help with your setup."
},
"trendlineTotal": "Pageviews trendline",
- "noEvContent": "No events have been captured for the specified timeframe.\nIf you haven't tracked any events yet, you can check out our <url>Docs</url> to easily integrate tracking into your app.",
+ "noEvContent": "No events have been recorded for the specified period, please try a different period.",
"noCaptchaEv": "No events have been captured for the specified timeframe.\nIf you haven't set up CAPTCHA yet, you can check out our <url>Docs</url> to easily integrate it into your app.",
"mapping": {
"cc": "Country",