Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
briancao committed Oct 18, 2023
2 parents ca6da03 + 55ad5fb commit 214fade
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "umami",
"version": "2.7.0",
"version": "2.8.0",
"description": "A simple, fast, privacy-focused alternative to Google Analytics.",
"author": "Mike Cao <mike@mikecao.com>",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion src/app/(main)/websites/[id]/WebsiteMenuView.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default function WebsiteMenuView({ websiteId, websiteDomain }) {
return (
<div className={styles.layout}>
<div className={styles.menu}>
<LinkButton href={pathname} className={styles.back} variant="quiet">
<LinkButton href={pathname} className={styles.back} variant="quiet" scroll={false}>
<Icon rotate={180}>
<Icons.ArrowRight />
</Icon>
Expand Down
3 changes: 2 additions & 1 deletion src/components/common/LinkButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ import Link from 'next/link';
import { useLocale } from 'components/hooks';
import styles from './LinkButton.module.css';

export function LinkButton({ href, className, variant, children }) {
export function LinkButton({ href, className, variant, scroll = true, children }) {
const { dir } = useLocale();

return (
<Link
className={classNames(styles.button, className, { [styles[variant]]: true })}
href={href}
dir={dir}
scroll={scroll}
>
{children}
</Link>
Expand Down
1 change: 1 addition & 0 deletions src/queries/analytics/eventData/getEventDataEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ async function clickhouseQuery(
eventName: a.eventName,
fieldName: a.fieldName,
dataType: Number(a.dataType),
fieldValue: a.fieldValue,
total: Number(a.total),
};
});
Expand Down
6 changes: 4 additions & 2 deletions src/queries/analytics/getActiveVisitors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ async function relationalQuery(websiteId: string) {
);
}

async function clickhouseQuery(websiteId: string): Promise<{ x: number }[]> {
async function clickhouseQuery(websiteId: string): Promise<{ x: number }> {
const { rawQuery } = clickhouse;

return rawQuery(
const result = rawQuery(
`
select
count(distinct session_id) x
Expand All @@ -41,4 +41,6 @@ async function clickhouseQuery(websiteId: string): Promise<{ x: number }[]> {
return { x: Number(a.x) };
});
});

return result[0] ?? null;
}
2 changes: 1 addition & 1 deletion src/queries/analytics/sessions/getSessionMetrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ async function clickhouseQuery(
params,
).then(a => {
return Object.values(a).map(a => {
return { ...a, x: a.x, y: Number(a.y) };
return { x: a.x, y: Number(a.y), country: a.country };
});
});
}

0 comments on commit 214fade

Please sign in to comment.