Goal/Funnel mobile friendly changes. Polish event-data filters UI/UX

This commit is contained in:
Francis Cao
2026-03-28 10:28:59 -07:00
parent 35680918c0
commit 09e5196ea3
12 changed files with 472 additions and 343 deletions
+8 -2
View File
@@ -84,6 +84,7 @@ async function relationalQuery(
select 1 from event_data _ed${stepIndex}_${fi}
where _ed${stepIndex}_${fi}.website_event_id = ${eventAlias}.event_id
and _ed${stepIndex}_${fi}.website_id = {{websiteId::uuid}}
and _ed${stepIndex}_${fi}.created_at between {{startDate}} and {{endDate}}
and _ed${stepIndex}_${fi}.data_key = {{${keyParam}}}
and case when _ed${stepIndex}_${fi}.data_type = 2 then replace(_ed${stepIndex}_${fi}.string_value, '.0000', '') else _ed${stepIndex}_${fi}.string_value end ${op} {{${valParam}}}
)`;
@@ -210,6 +211,7 @@ async function clickhouseQuery(
stepIndex: number,
stepFilters: Array<FunnelStepFilter> | undefined,
params: Record<string, string>,
eventAlias: string,
): string {
if (!stepFilters?.length) return '';
@@ -231,9 +233,10 @@ async function clickhouseQuery(
}
params[valParam] = val;
return `and event_id in (
return `and ${eventAlias}.event_id in (
select event_id from event_data
where website_id = {websiteId:UUID}
and created_at between {startDate:DateTime64} and {endDate:DateTime64}
and data_key = {${keyParam}:String}
and multiIf(data_type = 2, replaceAll(string_value, '.0000', ''), string_value) ${op} {${valParam}:String}
)`;
@@ -269,8 +272,11 @@ async function clickhouseQuery(
paramValue = cv.value.replace(/^\*|\*$/g, '%');
}
const eventAlias = levelNumber === 1 ? 'level0' : 'y';
const eventDataClause =
!isURL && cv.filters?.length ? buildEventDataFilters(i, cv.filters, extraParams) : '';
!isURL && cv.filters?.length
? buildEventDataFilters(i, cv.filters, extraParams, eventAlias)
: '';
if (levelNumber === 1) {
pv.levelOneQuery = `\n