mirror of
https://github.com/documenso/documenso.git
synced 2025-11-12 07:43:16 +10:00
Compare commits
5 Commits
v1.11.1
...
chore/open
| Author | SHA1 | Date | |
|---|---|---|---|
| 0cfe256412 | |||
| 682e112711 | |||
| 3fc4d24cef | |||
| 65e09fa4bf | |||
| 21ecfde543 |
@ -6,6 +6,7 @@ import { z } from 'zod';
|
|||||||
|
|
||||||
import { setupI18nSSR } from '@documenso/lib/client-only/providers/i18n.server';
|
import { setupI18nSSR } from '@documenso/lib/client-only/providers/i18n.server';
|
||||||
import { getCompletedDocumentsMonthly } from '@documenso/lib/server-only/user/get-monthly-completed-document';
|
import { getCompletedDocumentsMonthly } from '@documenso/lib/server-only/user/get-monthly-completed-document';
|
||||||
|
import { getSignerConversionMonthly } from '@documenso/lib/server-only/user/get-signer-conversion';
|
||||||
import { getUserMonthlyGrowth } from '@documenso/lib/server-only/user/get-user-monthly-growth';
|
import { getUserMonthlyGrowth } from '@documenso/lib/server-only/user/get-user-monthly-growth';
|
||||||
|
|
||||||
import { FUNDING_RAISED } from '~/app/(marketing)/open/data';
|
import { FUNDING_RAISED } from '~/app/(marketing)/open/data';
|
||||||
@ -19,6 +20,7 @@ import { MonthlyCompletedDocumentsChart } from './monthly-completed-documents-ch
|
|||||||
import { MonthlyNewUsersChart } from './monthly-new-users-chart';
|
import { MonthlyNewUsersChart } from './monthly-new-users-chart';
|
||||||
import { MonthlyTotalUsersChart } from './monthly-total-users-chart';
|
import { MonthlyTotalUsersChart } from './monthly-total-users-chart';
|
||||||
import { SalaryBands } from './salary-bands';
|
import { SalaryBands } from './salary-bands';
|
||||||
|
import { SignerConversionChart } from './signer-conversion-chart';
|
||||||
import { TeamMembers } from './team-members';
|
import { TeamMembers } from './team-members';
|
||||||
import { OpenPageTooltip } from './tooltip';
|
import { OpenPageTooltip } from './tooltip';
|
||||||
import { TotalSignedDocumentsChart } from './total-signed-documents-chart';
|
import { TotalSignedDocumentsChart } from './total-signed-documents-chart';
|
||||||
@ -143,6 +145,7 @@ export default async function OpenPage() {
|
|||||||
EARLY_ADOPTERS_DATA,
|
EARLY_ADOPTERS_DATA,
|
||||||
MONTHLY_USERS,
|
MONTHLY_USERS,
|
||||||
MONTHLY_COMPLETED_DOCUMENTS,
|
MONTHLY_COMPLETED_DOCUMENTS,
|
||||||
|
MONTHLY_SIGNER_CONVERSION,
|
||||||
] = await Promise.all([
|
] = await Promise.all([
|
||||||
fetchGithubStats(),
|
fetchGithubStats(),
|
||||||
fetchOpenIssues(),
|
fetchOpenIssues(),
|
||||||
@ -151,6 +154,7 @@ export default async function OpenPage() {
|
|||||||
fetchEarlyAdopters(),
|
fetchEarlyAdopters(),
|
||||||
getUserMonthlyGrowth(),
|
getUserMonthlyGrowth(),
|
||||||
getCompletedDocumentsMonthly(),
|
getCompletedDocumentsMonthly(),
|
||||||
|
getSignerConversionMonthly(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -281,6 +285,17 @@ export default async function OpenPage() {
|
|||||||
data={MONTHLY_COMPLETED_DOCUMENTS}
|
data={MONTHLY_COMPLETED_DOCUMENTS}
|
||||||
className="col-span-12 lg:col-span-6"
|
className="col-span-12 lg:col-span-6"
|
||||||
/>
|
/>
|
||||||
|
<SignerConversionChart
|
||||||
|
className="col-span-12 lg:col-span-6"
|
||||||
|
title={_(msg`Signers that Signed Up`)}
|
||||||
|
data={MONTHLY_SIGNER_CONVERSION}
|
||||||
|
/>
|
||||||
|
<SignerConversionChart
|
||||||
|
className="col-span-12 lg:col-span-6"
|
||||||
|
title={_(msg`Total Signers that Signed Up`)}
|
||||||
|
data={MONTHLY_SIGNER_CONVERSION}
|
||||||
|
cumulative
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,64 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { DateTime } from 'luxon';
|
||||||
|
import { Bar, BarChart, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts';
|
||||||
|
|
||||||
|
import type { GetSignerConversionMonthlyResult } from '@documenso/lib/server-only/user/get-signer-conversion';
|
||||||
|
|
||||||
|
export type SignerConversionChartProps = {
|
||||||
|
className?: string;
|
||||||
|
title: string;
|
||||||
|
cumulative?: boolean;
|
||||||
|
data: GetSignerConversionMonthlyResult;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const SignerConversionChart = ({
|
||||||
|
className,
|
||||||
|
data,
|
||||||
|
title,
|
||||||
|
cumulative = false,
|
||||||
|
}: SignerConversionChartProps) => {
|
||||||
|
const formattedData = [...data].reverse().map(({ month, count, cume_count }) => {
|
||||||
|
return {
|
||||||
|
month: DateTime.fromFormat(month, 'yyyy-MM').toFormat('MMM yyyy'),
|
||||||
|
count: Number(count),
|
||||||
|
signed_count: Number(cume_count),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={className}>
|
||||||
|
<div className="border-border flex flex-1 flex-col justify-center rounded-2xl border p-6 pl-2">
|
||||||
|
<div className="mb-6 flex px-4">
|
||||||
|
<h3 className="text-lg font-semibold">{title}</h3>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ResponsiveContainer width="100%" height={400}>
|
||||||
|
<BarChart data={formattedData}>
|
||||||
|
<XAxis dataKey="month" />
|
||||||
|
<YAxis />
|
||||||
|
|
||||||
|
<Tooltip
|
||||||
|
labelStyle={{
|
||||||
|
color: 'hsl(var(--primary-foreground))',
|
||||||
|
}}
|
||||||
|
formatter={(value) => [
|
||||||
|
Number(value).toLocaleString('en-US'),
|
||||||
|
cumulative ? 'Total Signers' : 'Monthly Signers',
|
||||||
|
]}
|
||||||
|
cursor={{ fill: 'hsl(var(--primary) / 10%)' }}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Bar
|
||||||
|
dataKey={cumulative ? 'signed_count' : 'count'}
|
||||||
|
fill="hsl(var(--primary))"
|
||||||
|
radius={[4, 4, 0, 0]}
|
||||||
|
maxBarSize={60}
|
||||||
|
name={cumulative ? 'Total Signers' : 'Monthly Signers'}
|
||||||
|
/>
|
||||||
|
</BarChart>
|
||||||
|
</ResponsiveContainer>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
@ -145,7 +145,10 @@ export default async function AdminStatsPage() {
|
|||||||
msg`Monthly Active Users: Users that had at least one of their documents completed`,
|
msg`Monthly Active Users: Users that had at least one of their documents completed`,
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<SignerConversionChart title="Signers that Signed Up" data={signerConversionMonthly} />
|
<SignerConversionChart
|
||||||
|
title={_(msg`Signers that Signed Up`)}
|
||||||
|
data={signerConversionMonthly}
|
||||||
|
/>
|
||||||
<SignerConversionChart
|
<SignerConversionChart
|
||||||
title={_(msg`Total Signers that Signed Up`)}
|
title={_(msg`Total Signers that Signed Up`)}
|
||||||
data={signerConversionMonthly}
|
data={signerConversionMonthly}
|
||||||
|
|||||||
Reference in New Issue
Block a user