Skip to content

🐸 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.ts
similarity index 100%
rename from client/src/app/actions/getBrowsers.ts
rename to client/src/actions/getBrowsers.ts
diff --git a/client/src/app/actions/getCountries.ts b/client/src/actions/getCountries.ts
similarity index 100%
rename from client/src/app/actions/getCountries.ts
rename to client/src/actions/getCountries.ts
diff --git a/client/src/app/actions/getDevices.ts b/client/src/actions/getDevices.ts
similarity index 100%
rename from client/src/app/actions/getDevices.ts
rename to client/src/actions/getDevices.ts
diff --git a/client/src/app/actions/getOperatingSystems.ts b/client/src/actions/getOperatingSystems.ts
similarity index 100%
rename from client/src/app/actions/getOperatingSystems.ts
rename to client/src/actions/getOperatingSystems.ts
diff --git a/client/src/app/actions/getPages.ts b/client/src/actions/getPages.ts
similarity index 100%
rename from client/src/app/actions/getPages.ts
rename to client/src/actions/getPages.ts
diff --git a/client/src/app/actions/getPageviews.ts b/client/src/actions/getPageviews.ts
similarity index 95%
rename from client/src/app/actions/getPageviews.ts
rename to client/src/actions/getPageviews.ts
index 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.ts
similarity index 100%
rename from client/src/app/actions/getReferrers.ts
rename to client/src/actions/getReferrers.ts
diff --git a/client/src/app/actions/utils.ts b/client/src/actions/utils.ts
similarity index 100%
rename from client/src/app/actions/utils.ts
rename to client/src/actions/utils.ts
diff --git a/client/src/app/components/MainSection/Chart.tsx b/client/src/app/components/MainSection/Chart.tsx
index 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.ts
index 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.ts
index 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.ts
index 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.ts
index 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.ts
index 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.ts
index 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.ts
index 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.ts
index 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);