feature(dashboard): add more settings for funnels

* wip
* feature(dashboard): add more settings for funnels
This commit is contained in:
Carl-Gerhard Lindesvärd
2024-10-21 10:13:57 +02:00
committed by GitHub
parent 4846390531
commit c4a2ea4858
15 changed files with 276 additions and 212 deletions

View File

@@ -129,14 +129,16 @@ export async function chQuery<T extends Record<string, any>>(
}
export function formatClickhouseDate(
_date: Date | string,
date: Date | string,
skipTime = false,
): string {
if (typeof _date === 'string') {
return _date.slice(0, 19).replace('T', ' ');
if (typeof date === 'string') {
if (skipTime) {
return date.slice(0, 10);
}
return date.slice(0, 19).replace('T', ' ');
}
const date = typeof _date === 'string' ? new Date(_date) : _date;
if (skipTime) {
return date.toISOString().split('T')[0]!;
}

View File

@@ -66,6 +66,8 @@ export function transformReport(
metric: report.metric ?? 'sum',
unit: report.unit ?? undefined,
criteria: (report.criteria as ICriteria) ?? undefined,
funnelGroup: report.funnelGroup ?? undefined,
funnelWindow: report.funnelWindow ?? undefined,
};
}