From f5a8be5addafab3cb091ec47f242405b69715ea5 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Wed, 7 May 2025 23:30:09 -0700 Subject: [PATCH 1/5] Fixed README. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f67f585c..cf84d762 100644 --- a/README.md +++ b/README.md @@ -64,10 +64,10 @@ mysql://username:mypassword@localhost:3306/mydb ### Build the Application ```bash -npm build +npm run build ``` -*The build step will create tables in your database if you are installing for the first time. It will also create a login user with username **admin** and password **umami**.* +_The build step will create tables in your database if you are installing for the first time. It will also create a login user with username **admin** and password **umami**._ ### Start the Application @@ -75,7 +75,7 @@ npm build npm run start ``` -*By default, this will launch the application on `http://localhost:3000`. You will need to either [proxy](https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/) requests from your web server or change the [port](https://nextjs.org/docs/api-reference/cli#production) to serve the application directly.* +_By default, this will launch the application on `http://localhost:3000`. You will need to either [proxy](https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/) requests from your web server or change the [port](https://nextjs.org/docs/api-reference/cli#production) to serve the application directly._ --- From 4d54f50739d1883c7248cd0d1af88656e6f35c52 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Thu, 8 May 2025 00:12:44 -0700 Subject: [PATCH 2/5] PR fixes. --- src/queries/sql/reports/getAttribution.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/queries/sql/reports/getAttribution.ts b/src/queries/sql/reports/getAttribution.ts index aba987f6..e690d50f 100644 --- a/src/queries/sql/reports/getAttribution.ts +++ b/src/queries/sql/reports/getAttribution.ts @@ -84,7 +84,7 @@ async function relationalQuery( sum(coalesce(cast(number_value as decimal(10,2)), cast(string_value as decimal(10,2)))) value from event_data ed join website_event we - on we.event_id = ed.website_event_Id + on we.event_id = ed.website_event_id and we.website_id = ed.website_id join (select website_event_id from event_data @@ -395,10 +395,10 @@ async function clickhouseQuery( fbclid != '', 'Facebook / Meta', msclkid != '', 'Microsoft Ads', ttclid != '', 'TikTok Ads', - li_fat_id != '', ' LinkedIn Ads', + li_fat_id != '', 'LinkedIn Ads', twclid != '', 'Twitter Ads (X)','') name, ${currency ? 'sum(e.value)' : 'uniqExact(we.session_id)'} value - from model m + from model fm join website_event we on we.created_at = m.created_at and we.session_id = m.session_id From cd532fd53df1c93afed9689207413ad9740ca469 Mon Sep 17 00:00:00 2001 From: Francis Cao Date: Thu, 8 May 2025 09:05:44 -0700 Subject: [PATCH 3/5] fix minute x-axis date labels --- src/lib/charts.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/charts.ts b/src/lib/charts.ts index 957d4962..3eab7562 100644 --- a/src/lib/charts.ts +++ b/src/lib/charts.ts @@ -11,7 +11,7 @@ export function renderDateLabels(unit: string, locale: string) { switch (unit) { case 'minute': - return formatDate(d, 'p', locale).split(' ')[0]; + return formatDate(d, 'h:mm', locale).split(' ')[0]; case 'hour': return formatDate(d, 'p', locale); case 'day': From 3b24ea31751a1bc7b61baf91afd8e1ebe77d3015 Mon Sep 17 00:00:00 2001 From: Francis Cao Date: Thu, 8 May 2025 09:06:27 -0700 Subject: [PATCH 4/5] remove split code --- src/lib/charts.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/charts.ts b/src/lib/charts.ts index 3eab7562..7d4208e2 100644 --- a/src/lib/charts.ts +++ b/src/lib/charts.ts @@ -11,7 +11,7 @@ export function renderDateLabels(unit: string, locale: string) { switch (unit) { case 'minute': - return formatDate(d, 'h:mm', locale).split(' ')[0]; + return formatDate(d, 'h:mm', locale); case 'hour': return formatDate(d, 'p', locale); case 'day': From 98eb26fd9ee1b30f0aa0493999c4d4f766dcffe5 Mon Sep 17 00:00:00 2001 From: Francis Cao Date: Thu, 8 May 2025 09:15:27 -0700 Subject: [PATCH 5/5] fixed getAttribution table alias typo --- pnpm-lock.yaml | 2 -- src/queries/sql/reports/getAttribution.ts | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 20f2ff55..dfca7de5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -346,8 +346,6 @@ importers: specifier: ^5.5.3 version: 5.8.3 - src/generated/prisma: {} - packages: '@ampproject/remapping@2.3.0': diff --git a/src/queries/sql/reports/getAttribution.ts b/src/queries/sql/reports/getAttribution.ts index e690d50f..0c3d447a 100644 --- a/src/queries/sql/reports/getAttribution.ts +++ b/src/queries/sql/reports/getAttribution.ts @@ -398,7 +398,7 @@ async function clickhouseQuery( li_fat_id != '', 'LinkedIn Ads', twclid != '', 'Twitter Ads (X)','') name, ${currency ? 'sum(e.value)' : 'uniqExact(we.session_id)'} value - from model fm + from model m join website_event we on we.created_at = m.created_at and we.session_id = m.session_id