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!

improve no projects found message if searching

Blue Mouse455a48779c76
diff --git a/web/app/lib/constants/index.ts b/web/app/lib/constants/index.ts
index 1abd8fcd5..a0466418b 100644
--- a/web/app/lib/constants/index.ts
+++ b/web/app/lib/constants/index.ts
@@ -430,7 +430,7 @@ export const paddleLanguageMapping = {
// Increase this counter every time some major change is done within localisation files
// This will prevent cached version or raw locale strings being displayed in production
-export const I18N_CACHE_BREAKER = 13
+export const I18N_CACHE_BREAKER = 14
export const roles: Role[] = ['admin', 'viewer']
diff --git a/web/app/pages/Dashboard/Dashboard.tsx b/web/app/pages/Dashboard/Dashboard.tsx
index 355461420..ae4b5c3b4 100644
--- a/web/app/pages/Dashboard/Dashboard.tsx
+++ b/web/app/pages/Dashboard/Dashboard.tsx
@@ -439,7 +439,7 @@ const Dashboard = () => {
{() => (
<>
{_isEmpty(projects) ? (
- <NoProjects onClick={onNewProject} />
+ <NoProjects search={debouncedSearch} activeTab={activeTab} onClick={onNewProject} />
) : (
<div
className={cx(
diff --git a/web/app/pages/Dashboard/NoProjects.tsx b/web/app/pages/Dashboard/NoProjects.tsx
index 559a8543c..069dd9c2e 100644
--- a/web/app/pages/Dashboard/NoProjects.tsx
+++ b/web/app/pages/Dashboard/NoProjects.tsx
@@ -4,14 +4,27 @@ import { Link } from '@remix-run/react'
import { useTranslation } from 'react-i18next'
import routes from '~/utils/routes'
+import { DASHBOARD_TABS } from './Tabs'
interface NoProjectsProps {
onClick: (e: React.MouseEvent<HTMLAnchorElement>) => void
+ activeTab: (typeof DASHBOARD_TABS)[number]['id']
+ search: string
}
-export const NoProjects = ({ onClick }: NoProjectsProps) => {
+export const NoProjects = ({ onClick, activeTab, search }: NoProjectsProps) => {
const { t } = useTranslation('common')
+ if (activeTab !== 'default' || search) {
+ return (
+ <div className='mt-5 flex flex-col py-6 sm:px-6 lg:px-8'>
+ <div className='mx-auto w-full max-w-6xl text-gray-900 dark:text-gray-50'>
+ <h3 className='mb-8 text-center text-xl leading-snug'>{t('dashboard.noProjectsForCriteria')}</h3>
+ </div>
+ </div>
+ )
+ }
+
return (
<Link
to={routes.new_project}
diff --git a/web/public/locales/en.json b/web/public/locales/en.json
index 1afbfa3c5..85bd5fad2 100644
--- a/web/public/locales/en.json
+++ b/web/public/locales/en.json
@@ -696,6 +696,7 @@
"sortDateDesc": "Newest first",
"pageviewsDesc": "Most pageviews",
"pageviewsAsc": "Least pageviews",
+ "noProjectsForCriteria": "No projects found for the selected criteria",
"lastVisitDesc": "Recently visited first",
"uptime": "Uptime",
"captcha": "CAPTCHA",