🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.
move actions outside
Bill Yang0f87a9b0bad0
diff --git a/client/src/app/actions/getBrowsers.ts b/client/src/actions/getBrowsers.tssimilarity index 100%rename from client/src/app/actions/getBrowsers.tsrename to client/src/actions/getBrowsers.tsdiff --git a/client/src/app/actions/getCountries.ts b/client/src/actions/getCountries.tssimilarity index 100%rename from client/src/app/actions/getCountries.tsrename to client/src/actions/getCountries.tsdiff --git a/client/src/app/actions/getDevices.ts b/client/src/actions/getDevices.tssimilarity index 100%rename from client/src/app/actions/getDevices.tsrename to client/src/actions/getDevices.tsdiff --git a/client/src/app/actions/getOperatingSystems.ts b/client/src/actions/getOperatingSystems.tssimilarity index 100%rename from client/src/app/actions/getOperatingSystems.tsrename to client/src/actions/getOperatingSystems.tsdiff --git a/client/src/app/actions/getPages.ts b/client/src/actions/getPages.tssimilarity index 100%rename from client/src/app/actions/getPages.tsrename to client/src/actions/getPages.tsdiff --git a/client/src/app/actions/getPageviews.ts b/client/src/actions/getPageviews.tssimilarity index 95%rename from client/src/app/actions/getPageviews.tsrename to client/src/actions/getPageviews.tsindex fb71300d5..24aadb26e 100644--- a/client/src/app/actions/getPageviews.ts+++ b/client/src/actions/getPageviews.ts@@ -2,7 +2,7 @@import { clickhouse } from "@/lib/clickhouse";import { getTimeStatement } from "./utils";-import { TimeBucket } from "../../lib/timeSelectionStore";+import { TimeBucket } from "../lib/timeSelectionStore";export type GetPageViewsResponse = { time: string; pageviews: number }[];diff --git a/client/src/app/actions/getReferrers.ts b/client/src/actions/getReferrers.tssimilarity index 100%rename from client/src/app/actions/getReferrers.tsrename to client/src/actions/getReferrers.tsdiff --git a/client/src/app/actions/utils.ts b/client/src/actions/utils.tssimilarity index 100%rename from client/src/app/actions/utils.tsrename to client/src/actions/utils.tsdiff --git a/client/src/app/components/MainSection/Chart.tsx b/client/src/app/components/MainSection/Chart.tsxindex 06f77b669..05a95f56f 100644--- a/client/src/app/components/MainSection/Chart.tsx+++ b/client/src/app/components/MainSection/Chart.tsx@@ -1,7 +1,7 @@"use client";import { Theme } from "@nivo/core";import { ResponsiveLine } from "@nivo/line";-import { GetPageViewsResponse } from "../../actions/getPageviews";+import { GetPageViewsResponse } from "../../../actions/getPageviews";import { DateTime } from "luxon";import { round } from "lodash";import { Time, useTimeSelection } from "../../../lib/timeSelectionStore";diff --git a/client/src/app/hooks/useGetBrowsers.ts b/client/src/app/hooks/useGetBrowsers.tsindex 3f64c795d..1ac53281e 100644--- a/client/src/app/hooks/useGetBrowsers.ts+++ b/client/src/app/hooks/useGetBrowsers.ts@@ -1,6 +1,6 @@import { useQuery } from "@tanstack/react-query";import { useTimeSelection } from "../../lib/timeSelectionStore";-import { getBrowsers } from "../actions/getBrowsers";+import { getBrowsers } from "../../actions/getBrowsers";import { getStartAndEndDate } from "./utils";export function useGetBrowsers() {diff --git a/client/src/app/hooks/useGetCountries.ts b/client/src/app/hooks/useGetCountries.tsindex e72296f50..57688f08e 100644--- a/client/src/app/hooks/useGetCountries.ts+++ b/client/src/app/hooks/useGetCountries.ts@@ -1,6 +1,6 @@import { useQuery } from "@tanstack/react-query";import { useTimeSelection } from "../../lib/timeSelectionStore";-import { getCountries } from "../actions/getCountries";+import { getCountries } from "../../actions/getCountries";import { getStartAndEndDate } from "./utils";export function useGetCountries() {diff --git a/client/src/app/hooks/useGetDevices.ts b/client/src/app/hooks/useGetDevices.tsindex 5d60c014e..e302db109 100644--- a/client/src/app/hooks/useGetDevices.ts+++ b/client/src/app/hooks/useGetDevices.ts@@ -1,6 +1,6 @@import { useQuery } from "@tanstack/react-query";import { useTimeSelection } from "../../lib/timeSelectionStore";-import { getDevices } from "../actions/getDevices";+import { getDevices } from "../../actions/getDevices";import { getStartAndEndDate } from "./utils";export function useGetDevices() {diff --git a/client/src/app/hooks/useGetOperatingSystems.ts b/client/src/app/hooks/useGetOperatingSystems.tsindex 8f9a033f6..934a5beb5 100644--- a/client/src/app/hooks/useGetOperatingSystems.ts+++ b/client/src/app/hooks/useGetOperatingSystems.ts@@ -1,7 +1,7 @@import { useQuery } from "@tanstack/react-query";import { useTimeSelection } from "../../lib/timeSelectionStore";import { getStartAndEndDate } from "./utils";-import { getOperatingSystems } from "../actions/getOperatingSystems";+import { getOperatingSystems } from "../../actions/getOperatingSystems";export function useGetOperatingSystems() {const { time } = useTimeSelection();diff --git a/client/src/app/hooks/useGetPages.ts b/client/src/app/hooks/useGetPages.tsindex 088d045d6..0e719f8dc 100644--- a/client/src/app/hooks/useGetPages.ts+++ b/client/src/app/hooks/useGetPages.ts@@ -1,7 +1,7 @@import { useQuery } from "@tanstack/react-query";import { useTimeSelection } from "../../lib/timeSelectionStore";import { getStartAndEndDate } from "./utils";-import { getPages } from "../actions/getPages";+import { getPages } from "../../actions/getPages";export function useGetPages() {const { time } = useTimeSelection();diff --git a/client/src/app/hooks/useGetPageviews.ts b/client/src/app/hooks/useGetPageviews.tsindex bdf4906b3..e686e9431 100644--- a/client/src/app/hooks/useGetPageviews.ts+++ b/client/src/app/hooks/useGetPageviews.ts@@ -1,6 +1,6 @@import { useQuery } from "@tanstack/react-query";import { useTimeSelection } from "../../lib/timeSelectionStore";-import { getPageViews } from "../actions/getPageviews";+import { getPageViews } from "../../actions/getPageviews";import { getStartAndEndDate } from "./utils";export function useGetPageviews() {diff --git a/client/src/app/hooks/useGetReferrers.ts b/client/src/app/hooks/useGetReferrers.tsindex 17357d5ef..425f8bb37 100644--- a/client/src/app/hooks/useGetReferrers.ts+++ b/client/src/app/hooks/useGetReferrers.ts@@ -1,6 +1,6 @@import { useQuery } from "@tanstack/react-query";import { useTimeSelection } from "../../lib/timeSelectionStore";-import { getReferrers } from "../actions/getReferrers";+import { getReferrers } from "../../actions/getReferrers";import { getStartAndEndDate } from "./utils";export function useGetReferrers() {diff --git a/client/src/lib/timeSelectionStore.ts b/client/src/lib/timeSelectionStore.tsindex d70bb4dcf..aef3b0099 100644--- a/client/src/lib/timeSelectionStore.ts+++ b/client/src/lib/timeSelectionStore.ts@@ -99,11 +99,7 @@ export const goForward = () => {if (time.mode === "day") {setTime({mode: "day",- day:- DateTime.fromISO(time.day).plus({ days: 1 }).toISODate() ??- "" > DateTime.now().toISODate()- ? DateTime.now().toISODate()- : DateTime.fromISO(time.day).plus({ days: 1 }).toISODate() ?? "",+ day: DateTime.fromISO(time.day).plus({ days: 1 }).toISODate() ?? "",});} else if (time.mode === "range") {const startDate = DateTime.fromISO(time.startDate);