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!

Merge branch 'main' into feature/custom-events-to-chart

Andrii R3a96ce5ab178
diff --cc src/pages/Project/View/ViewProject.tsx
index 18480ff18,860bfd683..73f38f540
--- a/src/pages/Project/View/ViewProject.tsx
+++ b/src/pages/Project/View/ViewProject.tsx
@@@ -206,8 -203,7 +212,8 @@@ const ViewProject = (
const timeFormat = useMemo(() => user.timeFormat || TimeFormat['12-hour'], [user])
const [ref, size] = useSize() as any
const rotateXAxias = useMemo(() => (size.width > 0 && size.width < 500), [size])
- const [chartType, setChartType] = useState<string>(getItem('chartType') || chartTypes.line)
+ const customEventsChartData = useMemo(() => _pickBy(customEventsPrefs[id], (value, keyCustomEvents) => _includes(activeChartMetricsCustomEvents, keyCustomEvents)), [customEventsPrefs, id, activeChartMetricsCustomEvents])
+ const [chartType, setChartType] = useState<string>(getItem('chartType') as string || chartTypes.line)
const tabs: {
id: string
diff --cc src/redux/reducers/ui/cache.ts
index dbc1e29ae,3deefd577..f141a32c7
--- a/src/redux/reducers/ui/cache.ts
+++ b/src/redux/reducers/ui/cache.ts
@@@ -21,21 -20,25 +20,27 @@@ export const getInitialViewPrefs = (LS_
}
interface IInitialState {
- analytics: any
- analyticsPerf: any
- captchaAnalytics: any
- captchaProjectsViewPrefs: any
- projectViewPrefs: any
- customEventsPrefs: any
+ analytics: any
+ analyticsPerf: any
+ captchaAnalytics: any
+ captchaProjectsViewPrefs: any
++ customEventsPrefs: any
+ projectViewPrefs: {
+ [key: string]: {
+ period: string
+ timeBucket: string
+ rangeDate?: Date[]
+ },
+ } | null
}
const initialState: IInitialState = {
analytics: {},
analyticsPerf: {},
captchaAnalytics: {},
- captchaProjectsViewPrefs: getInitialViewPrefs(LS_CAPTCHA_VIEW_PREFS_SETTING),
+ captchaProjectsViewPrefs: getInitialViewPrefs(LS_CAPTCHA_VIEW_PREFS_SETTING) || {},
projectViewPrefs: getInitialViewPrefs(LS_VIEW_PREFS_SETTING),
+ customEventsPrefs: {},
}
const cacheSlice = createSlice({