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!

Enable 'All time' period for errors & filters view

Blue Mouse8e341680b412
diff --git a/web/app/lib/constants/index.ts b/web/app/lib/constants/index.ts
index ff4e1620d..7d3475145 100644
--- a/web/app/lib/constants/index.ts
+++ b/web/app/lib/constants/index.ts
@@ -32,8 +32,6 @@ const getCustomLabel = (dates: Date[], t: typeof i18nextT, language?: string): s
return t('project.custom')
}
-export const KEY_FOR_ALL_TIME = 'all'
-
export const ALL_PERIODS = ['minute', 'hour', 'day', 'month', 'year']
export interface TBPeriodPairsProps {
@@ -103,7 +101,7 @@ export const tbPeriodPairs = (
},
{
label: t('project.all'),
- period: KEY_FOR_ALL_TIME,
+ period: 'all',
tbs: ['month', 'year'],
},
{
@@ -178,7 +176,7 @@ export const captchaTbPeriodPairs = (
},
{
label: t('project.all'),
- period: KEY_FOR_ALL_TIME,
+ period: 'all',
tbs: ['month', 'year'],
},
{
@@ -194,9 +192,9 @@ export const FILTERS_PERIOD_PAIRS = ['1d', '7d', '4w', '3M', '12M', 'custom', 'c
// TODO: add 'custom' later after an issue with it is resolved
// currently if you select a date range - it will not display errors within the last day of the date range
-export const ERROR_PERIOD_PAIRS = ['1h', '1d', '7d', '4w', '3M', '12M']
+export const ERROR_PERIOD_PAIRS = ['1h', '1d', '7d', '4w', '3M', '12M', 'all']
-export const FUNNELS_PERIOD_PAIRS = ['1h', '1d', '7d', '4w', '3M', '12M', 'custom']
+export const FUNNELS_PERIOD_PAIRS = ['1h', '1d', '7d', '4w', '3M', '12M', 'all', 'custom']
export const tbPeriodPairsCompare = (
t: typeof i18nextT,
diff --git a/web/app/pages/Captcha/View/ViewCaptcha.tsx b/web/app/pages/Captcha/View/ViewCaptcha.tsx
index 28cd7228a..786ab744b 100644
--- a/web/app/pages/Captcha/View/ViewCaptcha.tsx
+++ b/web/app/pages/Captcha/View/ViewCaptcha.tsx
@@ -26,7 +26,6 @@ import {
TimeFormat,
chartTypes,
TITLE_SUFFIX,
- KEY_FOR_ALL_TIME,
BROWSER_LOGO_MAP,
OS_LOGO_MAP,
OS_LOGO_MAP_DARK,
@@ -172,12 +171,11 @@ const ViewCaptcha = () => {
let newTimebucket = timeBucket
- if (period === KEY_FOR_ALL_TIME && !_isEmpty(timeBucketFromResponse)) {
+ if (period === 'all' && !_isEmpty(timeBucketFromResponse)) {
newTimebucket = _includes(timeBucketFromResponse, timeBucket) ? timeBucket : timeBucketFromResponse[0]
setPeriodPairs((prev) => {
- // find in prev state period === KEY_FOR_ALL_TIME and change tbs
const newPeriodPairs = _map(prev, (item) => {
- if (item.period === KEY_FOR_ALL_TIME) {
+ if (item.period === 'all') {
return {
...item,
tbs:
diff --git a/web/app/pages/Dashboard/PeriodSelector.tsx b/web/app/pages/Dashboard/PeriodSelector.tsx
index 09cec7b64..d7bb9a7d2 100644
--- a/web/app/pages/Dashboard/PeriodSelector.tsx
+++ b/web/app/pages/Dashboard/PeriodSelector.tsx
@@ -6,8 +6,6 @@ import { CalendarIcon } from 'lucide-react'
import { Fragment, useMemo } from 'react'
import { useTranslation } from 'react-i18next'
-import { KEY_FOR_ALL_TIME } from '~/lib/constants'
-
interface PeriodSelectorProps {
activePeriod: string
setActivePeriod: (period: string) => void
@@ -49,7 +47,7 @@ export const PeriodSelector = ({ activePeriod, setActivePeriod, isLoading }: Per
},
{
label: t('project.all'),
- period: KEY_FOR_ALL_TIME,
+ period: 'all',
},
]
}, [t])
diff --git a/web/app/pages/Project/View/ViewProject.tsx b/web/app/pages/Project/View/ViewProject.tsx
index 9ca272dc1..2cbb4962e 100644
--- a/web/app/pages/Project/View/ViewProject.tsx
+++ b/web/app/pages/Project/View/ViewProject.tsx
@@ -101,7 +101,6 @@ import {
FILTERS_PERIOD_PAIRS,
LS_IS_ACTIVE_COMPARE_KEY,
TITLE_SUFFIX,
- KEY_FOR_ALL_TIME,
MARKETPLACE_URL,
BROWSER_LOGO_MAP,
OS_LOGO_MAP,
@@ -1200,13 +1199,13 @@ const ViewProject = () => {
let newTimebucket = timeBucket
sdkInstance?._emitEvent('load', sdkData)
- if (period === KEY_FOR_ALL_TIME && !_isEmpty(data.timeBucket)) {
+ if (period === 'all' && !_isEmpty(data.timeBucket)) {
// @ts-expect-error
newTimebucket = _includes(data.timeBucket, timeBucket) ? timeBucket : data.timeBucket[0]
// @ts-expect-error
setPeriodPairs((prev) => {
const newPeriodPairs = _map(prev, (item) => {
- if (item.period === KEY_FOR_ALL_TIME) {
+ if (item.period === 'all') {
return {
...item,
// @ts-expect-error
@@ -1666,11 +1665,11 @@ const ViewProject = () => {
let newTimebucket = timeBucket
- if (period === KEY_FOR_ALL_TIME && !_isEmpty(dataPerf.timeBucket)) {
+ if (period === 'all' && !_isEmpty(dataPerf.timeBucket)) {
newTimebucket = _includes(dataPerf.timeBucket, timeBucket) ? timeBucket : dataPerf.timeBucket[0]
setPeriodPairs((prev) => {
const newPeriodPairs = _map(prev, (item) => {
- if (item.period === KEY_FOR_ALL_TIME) {
+ if (item.period === 'all') {
return {
...item,
tbs:
@@ -2635,7 +2634,7 @@ const ViewProject = () => {
q: '3M',
l: '12M',
z: '24M',
- a: KEY_FOR_ALL_TIME,
+ a: 'all',
u: 'custom',
c: 'compare',
}