harden eventData delete. Add translations. Closes #4435.

This commit is contained in:
Francis Cao committed 2026-08-10 12:41:41 -07:00
1 parent e89956597b
commit 3e729bc0e4
56 files changed
+383 -138

No files matched your search

@@ -30,31 +30,31 @@ export function Funnel({ id, name, type, parameters, websiteId, allowEdit = true
const operatorLabels = useOperatorLabels();
return (
<LoadingPanel data={data} isLoading={isLoading} error={error}>
<Grid gap>
<Grid columns="1fr auto" gap>
<Column gap>
<Row>
<Text size="lg" weight="bold">
{name}
</Text>
</Row>
<Grid gap>
<Grid columns="1fr auto" gap>
<Column gap>
<Row>
<Text size="lg" weight="bold">
{name}
</Text>
</Row>
</Column>
{allowEdit && !isSharePage && (
<Column>
<ReportEditButton
id={id}
name={name}
type={type}
title={t(labels.funnel)}
width="700px"
height="600px"
>
{({ close }) => <FunnelEditForm id={id} websiteId={websiteId} onClose={close} />}
</ReportEditButton>
</Column>
{allowEdit && !isSharePage && (
<Column>
<ReportEditButton
id={id}
name={name}
type={type}
title={t(labels.funnel)}
width="700px"
height="600px"
>
{({ close }) => <FunnelEditForm id={id} websiteId={websiteId} onClose={close} />}
</ReportEditButton>
</Column>
)}
</Grid>
)}
</Grid>
<LoadingPanel data={data} isLoading={isLoading} error={error}>
{data?.map(
(
{ type, value, filters, visitors, previous, dropped, dropoff, remaining }: FunnelResult,
@@ -142,7 +142,7 @@ export function Funnel({ id, name, type, parameters, websiteId, allowEdit = true
);
},
)}
</Grid>
</LoadingPanel>
</LoadingPanel>
</Grid>
);
}
@@ -46,63 +46,61 @@ export function Goal({
const isPage = parameters?.type === 'path';
return (
<LoadingPanel data={data} isLoading={isLoading} isFetching={isFetching} error={error}>
{data && (
<Grid gap>
<Grid columns="1fr auto" gap>
<Column gap>
<Row>
<Text size="lg" weight="bold">
{name}
</Text>
</Row>
</Column>
{allowEdit && !isSharePage && (
<Column>
<ReportEditButton
id={id}
name={name}
type={type}
title={t(labels.goal)}
minWidth="400px"
minHeight="300px"
>
{({ close }) => <GoalEditForm id={id} websiteId={websiteId} onClose={close} />}
</ReportEditButton>
</Column>
)}
</Grid>
<Row alignItems="center" justifyContent="space-between" gap>
<Text color="muted">{t(isPage ? labels.viewedPage : labels.triggeredEvent)}</Text>
<Text color="muted">{t(labels.conversionRate)}</Text>
</Row>
<Row alignItems="center" justifyContent="space-between" gap>
<Row alignItems="center" gap>
<Icon>{parameters.type === 'path' ? <File /> : <Lightning />}</Icon>
<Text>{parameters.value}</Text>
</Row>
<Row alignItems="center" gap>
<Icon>
<User />
</Icon>
<Text title={`${data?.num} / ${data?.total}`}>{`${formatLongNumber(
data?.num,
)} / ${formatLongNumber(data?.total)}`}</Text>
</Row>
</Row>
<Row alignItems="center" gap="6">
<ProgressBar
value={data?.num || 0}
min={0}
max={data?.total || 1}
style={{ width: '100%' }}
/>
<Text weight="bold" size="4xl">
{data?.total ? Math.round((+data?.num / +data?.total) * 100) : '0'}%
<Grid gap>
<Grid columns="1fr auto" gap>
<Column gap>
<Row>
<Text size="lg" weight="bold">
{name}
</Text>
</Row>
</Grid>
)}
</LoadingPanel>
</Column>
{allowEdit && !isSharePage && (
<Column>
<ReportEditButton
id={id}
name={name}
type={type}
title={t(labels.goal)}
minWidth="400px"
minHeight="300px"
>
{({ close }) => <GoalEditForm id={id} websiteId={websiteId} onClose={close} />}
</ReportEditButton>
</Column>
)}
</Grid>
<LoadingPanel data={data} isLoading={isLoading} isFetching={isFetching} error={error}>
<Row alignItems="center" justifyContent="space-between" gap>
<Text color="muted">{t(isPage ? labels.viewedPage : labels.triggeredEvent)}</Text>
<Text color="muted">{t(labels.conversionRate)}</Text>
</Row>
<Row alignItems="center" justifyContent="space-between" gap>
<Row alignItems="center" gap>
<Icon>{parameters.type === 'path' ? <File /> : <Lightning />}</Icon>
<Text>{parameters.value}</Text>
</Row>
<Row alignItems="center" gap>
<Icon>
<User />
</Icon>
<Text title={`${data?.num} / ${data?.total}`}>{`${formatLongNumber(
data?.num,
)} / ${formatLongNumber(data?.total)}`}</Text>
</Row>
</Row>
<Row alignItems="center" gap="6">
<ProgressBar
value={data?.num || 0}
min={0}
max={data?.total || 1}
style={{ width: '100%' }}
/>
<Text weight="bold" size="4xl">
{data?.total ? Math.round((+data?.num / +data?.total) * 100) : '0'}%
</Text>
</Row>
</LoadingPanel>
</Grid>
);
}