📈 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!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
Don't block UI
Blue Mouse20375871514f
diff --git a/web/app/pages/Project/Settings/components/DataImportTab.tsx b/web/app/pages/Project/Settings/components/DataImportTab.tsxindex 7b868a3ae..8367ebb02 100644--- a/web/app/pages/Project/Settings/components/DataImportTab.tsx+++ b/web/app/pages/Project/Settings/components/DataImportTab.tsx@@ -113,10 +113,15 @@ export default function DataImportTab({ projectId }: DataImportTabProps) {if (listFetcher.state !== 'idle' || !listFetcher.data) returnif (listFetcher.data.intent !== 'list-data-imports') return- if (listFetcher.data.dataImports) {+ if (listFetcher.data.error) {+ toast.error(+ listFetcher.data.error || t('project.settings.dataImport.loadFailed'),+ )+ } else if (listFetcher.data.dataImports) {setImports(listFetcher.data.dataImports)}setLoading(false)+ // eslint-disable-next-line react-hooks/exhaustive-deps}, [listFetcher.state, listFetcher.data])useEffect(() => {@@ -343,7 +348,7 @@ export default function DataImportTab({ projectId }: DataImportTabProps) {<td className='px-4 py-3 text-sm font-medium whitespace-nowrap text-gray-900 capitalize dark:text-gray-100'>{imp.provider}</td>- <td className='px-4 py-3 whitespace-nowrap'>+ <td className='px-4 py-3'><StatusBadgestatus={imp.status}label={statusLabels[imp.status]}@@ -354,7 +359,6 @@ export default function DataImportTab({ projectId }: DataImportTabProps) {size='xs'colour='error'className='mt-1 max-w-xs'- truncate>{imp.errorMessage}</Text>diff --git a/web/app/pages/Project/tabs/Traffic/TrafficView.tsx b/web/app/pages/Project/tabs/Traffic/TrafficView.tsxindex c303b529b..cfab31886 100644--- a/web/app/pages/Project/tabs/Traffic/TrafficView.tsx+++ b/web/app/pages/Project/tabs/Traffic/TrafficView.tsx@@ -141,7 +141,6 @@ interface DeferredTrafficData {trafficCompareData: ServerTrafficLogResponse | nulloverallCompareStats: Record<string, ServerOverallObject> | nullcustomEventsData: { chart?: { events?: Record<string, unknown> } } | null- hasImportedData?: boolean}interface TrafficErrorBoundaryState {@@ -199,7 +198,6 @@ function TrafficDataResolver({trafficCompareData: trafficComparePromise,overallCompareStats: overallComparePromise,customEventsData: customEventsPromise,- hasImportedData: hasImportedDataPromise,} = useLoaderData<ProjectLoaderData>()const trafficData = trafficDataPromise ? use(trafficDataPromise) : null@@ -211,9 +209,6 @@ function TrafficDataResolver({? use(overallComparePromise): nullconst customEventsData = customEventsPromise ? use(customEventsPromise) : null- const hasImportedData = hasImportedDataPromise- ? use(hasImportedDataPromise)- : falsereturn (<>@@ -223,12 +218,34 @@ function TrafficDataResolver({trafficCompareData,overallCompareStats,customEventsData,- hasImportedData,})}</>)}+function HasImportedIndicator() {+ const { t } = useTranslation('common')+ const { hasImportedData: hasImportedDataPromise } =+ useLoaderData<ProjectLoaderData>()++ const hasImportedData = hasImportedDataPromise+ ? use(hasImportedDataPromise)+ : false++ if (!hasImportedData) return null++ return (+ <Tooltip+ text={t('project.settings.dataImport.statsIncludeImported')}+ tooltipNode={+ <span className='inline-flex rounded-md border border-transparent p-1.5'>+ <DownloadIcon className='size-5 text-gray-700 dark:text-gray-50' />+ </span>+ }+ />+ )+}+function TrafficViewWrapper(props: TrafficViewProps) {return (<TrafficErrorBoundary>@@ -1062,16 +1079,9 @@ const TrafficViewInner = ({onSwitch={setChartTypeOnClick}type={chartType}/>- {deferredData.hasImportedData ? (- <Tooltip- text={t('project.settings.dataImport.statsIncludeImported')}- tooltipNode={- <span className='inline-flex rounded-md border border-transparent p-1.5'>- <DownloadIcon className='size-5 text-gray-700 dark:text-gray-50' />- </span>- }- />- ) : null}+ <Suspense fallback={null}>+ <HasImportedIndicator />+ </Suspense></div>{!_isEmpty(overall) ? (<div className='mb-5 flex flex-wrap justify-center gap-5 lg:justify-start'>diff --git a/web/public/locales/en.json b/web/public/locales/en.jsonindex 6d414cea4..af8e90e00 100644--- a/web/public/locales/en.json+++ b/web/public/locales/en.json@@ -1750,6 +1750,7 @@"deleteImportConfirm": "This will permanently remove all imported data ({{count}} rows) from your analytics. This action cannot be undone.","importStarted": "Import started. Your data is being processed.","importDeleted": "Import deleted successfully",+ "loadFailed": "Failed to load imports","uploadFailed": "Failed to upload file. Please try again.","deleteFailed": "Failed to delete import","clickToUpload": "Click to upload",