From a8752098f654c866adbed6f1f6a1da6c32afbf6a Mon Sep 17 00:00:00 2001 From: Ephraim Atta-Duncan Date: Thu, 21 Mar 2024 00:48:49 +0000 Subject: [PATCH 1/7] fix: invalid datetime on graph --- ...rt copy.tsx => monthly-completed-documents-chart.tsx} | 2 +- apps/marketing/src/app/(marketing)/open/page.tsx | 9 +++++---- .../server-only/user/get-monthly-completed-document.ts | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) rename apps/marketing/src/app/(marketing)/open/{monthly-completed-documents-chart copy.tsx => monthly-completed-documents-chart.tsx} (97%) diff --git a/apps/marketing/src/app/(marketing)/open/monthly-completed-documents-chart copy.tsx b/apps/marketing/src/app/(marketing)/open/monthly-completed-documents-chart.tsx similarity index 97% rename from apps/marketing/src/app/(marketing)/open/monthly-completed-documents-chart copy.tsx rename to apps/marketing/src/app/(marketing)/open/monthly-completed-documents-chart.tsx index ce438145b..4efd31e76 100644 --- a/apps/marketing/src/app/(marketing)/open/monthly-completed-documents-chart copy.tsx +++ b/apps/marketing/src/app/(marketing)/open/monthly-completed-documents-chart.tsx @@ -47,7 +47,7 @@ export const MonthlyCompletedDocumentsChart = ({ fill="hsl(var(--primary))" radius={[4, 4, 0, 0]} maxBarSize={60} - label="Total Users" + label="Monthly Completed Documents" /> diff --git a/apps/marketing/src/app/(marketing)/open/page.tsx b/apps/marketing/src/app/(marketing)/open/page.tsx index 4f2b0d857..02cf9302f 100644 --- a/apps/marketing/src/app/(marketing)/open/page.tsx +++ b/apps/marketing/src/app/(marketing)/open/page.tsx @@ -13,7 +13,7 @@ import { CallToAction } from '~/components/(marketing)/call-to-action'; import { BarMetric } from './bar-metrics'; import { CapTable } from './cap-table'; import { FundingRaised } from './funding-raised'; -import { MonthlyCompletedDocumentsChart } from './monthly-completed-documents-chart copy'; +import { MonthlyCompletedDocumentsChart } from './monthly-completed-documents-chart'; import { MonthlyNewUsersChart } from './monthly-new-users-chart'; import { MonthlyTotalUsersChart } from './monthly-total-users-chart'; import { TeamMembers } from './team-members'; @@ -133,17 +133,18 @@ export default async function OpenPage() { { total_count: mergedPullRequests }, STARGAZERS_DATA, EARLY_ADOPTERS_DATA, + MONTHLY_USERS, + MONTHLY_COMPLETED_DOCUMENTS, ] = await Promise.all([ fetchGithubStats(), fetchOpenIssues(), fetchMergedPullRequests(), fetchStargazers(), fetchEarlyAdopters(), + getUserMonthlyGrowth(), + getCompletedDocumentsMonthly(), ]); - const MONTHLY_USERS = await getUserMonthlyGrowth(); - const MONTHLY_COMPLETED_DOCUMENTS = await getCompletedDocumentsMonthly(); - return (
diff --git a/packages/lib/server-only/user/get-monthly-completed-document.ts b/packages/lib/server-only/user/get-monthly-completed-document.ts index ef1bcd4b9..644643bb3 100644 --- a/packages/lib/server-only/user/get-monthly-completed-document.ts +++ b/packages/lib/server-only/user/get-monthly-completed-document.ts @@ -17,9 +17,9 @@ type GetCompletedDocumentsMonthlyQueryResult = Array<{ export const getCompletedDocumentsMonthly = async () => { const result = await prisma.$queryRaw` SELECT - DATE_TRUNC('month', "completedAt") AS "month", + DATE_TRUNC('month', "updatedAt") AS "month", COUNT("id") as "count", - SUM(COUNT("id")) OVER (ORDER BY DATE_TRUNC('month', "completedAt")) as "cume_count" + SUM(COUNT("id")) OVER (ORDER BY DATE_TRUNC('month', "updatedAt")) as "cume_count" FROM "Document" WHERE "status" = 'COMPLETED' GROUP BY "month" From 8c1686f113569c98ef61a3266f86e6309aefeeb3 Mon Sep 17 00:00:00 2001 From: Ephraim Atta-Duncan Date: Thu, 21 Mar 2024 01:25:23 +0000 Subject: [PATCH 2/7] feat: add total signed documents --- .../monthly-completed-documents-chart.tsx | 4 +- .../src/app/(marketing)/open/page.tsx | 24 +++++---- .../open/total-signed-documents-chart.tsx | 54 +++++++++++++++++++ 3 files changed, 70 insertions(+), 12 deletions(-) create mode 100644 apps/marketing/src/app/(marketing)/open/total-signed-documents-chart.tsx diff --git a/apps/marketing/src/app/(marketing)/open/monthly-completed-documents-chart.tsx b/apps/marketing/src/app/(marketing)/open/monthly-completed-documents-chart.tsx index 4efd31e76..77059f80a 100644 --- a/apps/marketing/src/app/(marketing)/open/monthly-completed-documents-chart.tsx +++ b/apps/marketing/src/app/(marketing)/open/monthly-completed-documents-chart.tsx @@ -38,7 +38,7 @@ export const MonthlyCompletedDocumentsChart = ({ labelStyle={{ color: 'hsl(var(--primary-foreground))', }} - formatter={(value) => [Number(value).toLocaleString('en-US'), 'Total Users']} + formatter={(value) => [Number(value).toLocaleString('en-US'), 'Completed Documents']} cursor={{ fill: 'hsl(var(--primary) / 10%)' }} /> @@ -47,7 +47,7 @@ export const MonthlyCompletedDocumentsChart = ({ fill="hsl(var(--primary))" radius={[4, 4, 0, 0]} maxBarSize={60} - label="Monthly Completed Documents" + label="Completed Documents" /> diff --git a/apps/marketing/src/app/(marketing)/open/page.tsx b/apps/marketing/src/app/(marketing)/open/page.tsx index 02cf9302f..ea7ffda14 100644 --- a/apps/marketing/src/app/(marketing)/open/page.tsx +++ b/apps/marketing/src/app/(marketing)/open/page.tsx @@ -6,8 +6,6 @@ import { getCompletedDocumentsMonthly } from '@documenso/lib/server-only/user/ge import { getUserMonthlyGrowth } from '@documenso/lib/server-only/user/get-user-monthly-growth'; import { FUNDING_RAISED } from '~/app/(marketing)/open/data'; -import { MetricCard } from '~/app/(marketing)/open/metric-card'; -import { SalaryBands } from '~/app/(marketing)/open/salary-bands'; import { CallToAction } from '~/components/(marketing)/call-to-action'; import { BarMetric } from './bar-metrics'; @@ -16,8 +14,10 @@ import { FundingRaised } from './funding-raised'; import { MonthlyCompletedDocumentsChart } from './monthly-completed-documents-chart'; import { MonthlyNewUsersChart } from './monthly-new-users-chart'; import { MonthlyTotalUsersChart } from './monthly-total-users-chart'; +import { SalaryBands } from './salary-bands'; import { TeamMembers } from './team-members'; import { OpenPageTooltip } from './tooltip'; +import { TotalSignedDocumentsChart } from './total-signed-documents-chart'; import { Typefully } from './typefully'; export const metadata: Metadata = { @@ -128,17 +128,17 @@ const fetchEarlyAdopters = async () => { export default async function OpenPage() { const [ - { forks_count: forksCount, stargazers_count: stargazersCount }, - { total_count: openIssues }, - { total_count: mergedPullRequests }, + // { forks_count: forksCount, stargazers_count: stargazersCount }, + // { total_count: openIssues }, + // { total_count: mergedPullRequests }, STARGAZERS_DATA, EARLY_ADOPTERS_DATA, MONTHLY_USERS, MONTHLY_COMPLETED_DOCUMENTS, ] = await Promise.all([ - fetchGithubStats(), - fetchOpenIssues(), - fetchMergedPullRequests(), + // fetchGithubStats(), + // fetchOpenIssues(), + // fetchMergedPullRequests(), fetchStargazers(), fetchEarlyAdopters(), getUserMonthlyGrowth(), @@ -166,7 +166,7 @@ export default async function OpenPage() {
-
+ {/*
-
+
*/} @@ -259,6 +259,10 @@ export default async function OpenPage() { data={MONTHLY_COMPLETED_DOCUMENTS} className="col-span-12 lg:col-span-6" /> +
diff --git a/apps/marketing/src/app/(marketing)/open/total-signed-documents-chart.tsx b/apps/marketing/src/app/(marketing)/open/total-signed-documents-chart.tsx new file mode 100644 index 000000000..239d15de9 --- /dev/null +++ b/apps/marketing/src/app/(marketing)/open/total-signed-documents-chart.tsx @@ -0,0 +1,54 @@ +'use client'; + +import { DateTime } from 'luxon'; +import { Bar, BarChart, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts'; + +import type { GetUserMonthlyGrowthResult } from '@documenso/lib/server-only/user/get-user-monthly-growth'; +import { cn } from '@documenso/ui/lib/utils'; + +export type TotalSignedDocumentsChartProps = { + className?: string; + data: GetUserMonthlyGrowthResult; +}; + +export const TotalSignedDocumentsChart = ({ className, data }: TotalSignedDocumentsChartProps) => { + const formattedData = [...data].reverse().map(({ month, cume_count: count }) => { + return { + month: DateTime.fromFormat(month, 'yyyy-MM').toFormat('LLLL'), + count: Number(count), + }; + }); + + return ( +
+
+

Total Signed Documents

+
+ +
+ + + + + + [Number(value).toLocaleString('en-US'), 'Signed Documents']} + cursor={{ fill: 'hsl(var(--primary) / 10%)' }} + /> + + + + +
+
+ ); +}; From facafe09971ab95cff479aed2a8d0567f11cd693 Mon Sep 17 00:00:00 2001 From: Ephraim Atta-Duncan Date: Thu, 21 Mar 2024 01:39:14 +0000 Subject: [PATCH 3/7] feat: place card titles in the box --- .../src/app/(marketing)/open/bar-metrics.tsx | 15 +++++---- .../src/app/(marketing)/open/cap-table.tsx | 10 +++--- .../app/(marketing)/open/funding-raised.tsx | 11 ++++--- .../monthly-completed-documents-chart.tsx | 11 +++---- .../open/monthly-new-users-chart.tsx | 11 +++---- .../open/monthly-total-users-chart.tsx | 11 +++---- .../src/app/(marketing)/open/page.tsx | 31 ++++++++++--------- .../open/total-signed-documents-chart.tsx | 11 +++---- .../src/app/(marketing)/open/typefully.tsx | 11 ++++--- .../src/components/(marketing)/callout.tsx | 2 +- .../src/components/(marketing)/hero.tsx | 2 +- 11 files changed, 62 insertions(+), 64 deletions(-) diff --git a/apps/marketing/src/app/(marketing)/open/bar-metrics.tsx b/apps/marketing/src/app/(marketing)/open/bar-metrics.tsx index 940adb8fc..fb9c61f11 100644 --- a/apps/marketing/src/app/(marketing)/open/bar-metrics.tsx +++ b/apps/marketing/src/app/(marketing)/open/bar-metrics.tsx @@ -1,11 +1,10 @@ 'use client'; -import { HTMLAttributes } from 'react'; +import type { HTMLAttributes } from 'react'; import { Bar, BarChart, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts'; import { formatMonth } from '@documenso/lib/client-only/format-month'; -import { cn } from '@documenso/ui/lib/utils'; export type BarMetricProps> = HTMLAttributes & { data: T; @@ -34,13 +33,13 @@ export const BarMetric = -
-

{title}

- {extraInfo} -
+
+
+
+

{title}

+ {extraInfo} +
-
diff --git a/apps/marketing/src/app/(marketing)/open/cap-table.tsx b/apps/marketing/src/app/(marketing)/open/cap-table.tsx index ba6a12dc4..05c122aa5 100644 --- a/apps/marketing/src/app/(marketing)/open/cap-table.tsx +++ b/apps/marketing/src/app/(marketing)/open/cap-table.tsx @@ -5,8 +5,6 @@ import { useEffect, useState } from 'react'; import { Cell, Legend, Pie, PieChart, Tooltip } from 'recharts'; -import { cn } from '@documenso/ui/lib/utils'; - import { CAP_TABLE } from './data'; const COLORS = ['#7fd843', '#a2e771', '#c6f2a4']; @@ -49,10 +47,12 @@ export const CapTable = ({ className, ...props }: CapTableProps) => { setIsSSR(false); }, []); return ( -
-

Cap Table

+
+
+
+

Cap Table

+
-
{!isSSR && ( & { data: Record[]; @@ -18,10 +17,12 @@ export const FundingRaised = ({ className, data, ...props }: FundingRaisedProps) })); return ( -
-

Total Funding Raised

+
+
+
+

Total Funding Raised

+
-
diff --git a/apps/marketing/src/app/(marketing)/open/monthly-completed-documents-chart.tsx b/apps/marketing/src/app/(marketing)/open/monthly-completed-documents-chart.tsx index 77059f80a..9626838ed 100644 --- a/apps/marketing/src/app/(marketing)/open/monthly-completed-documents-chart.tsx +++ b/apps/marketing/src/app/(marketing)/open/monthly-completed-documents-chart.tsx @@ -4,7 +4,6 @@ import { DateTime } from 'luxon'; import { Bar, BarChart, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts'; import type { GetUserMonthlyGrowthResult } from '@documenso/lib/server-only/user/get-user-monthly-growth'; -import { cn } from '@documenso/ui/lib/utils'; export type MonthlyCompletedDocumentsChartProps = { className?: string; @@ -23,12 +22,12 @@ export const MonthlyCompletedDocumentsChart = ({ }); return ( -
-
-

Completed Documents per Month

-
+
+
+
+

Completed Documents per Month

+
-
diff --git a/apps/marketing/src/app/(marketing)/open/monthly-new-users-chart.tsx b/apps/marketing/src/app/(marketing)/open/monthly-new-users-chart.tsx index 0df73e30c..fe7941336 100644 --- a/apps/marketing/src/app/(marketing)/open/monthly-new-users-chart.tsx +++ b/apps/marketing/src/app/(marketing)/open/monthly-new-users-chart.tsx @@ -4,7 +4,6 @@ import { DateTime } from 'luxon'; import { Bar, BarChart, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts'; import type { GetUserMonthlyGrowthResult } from '@documenso/lib/server-only/user/get-user-monthly-growth'; -import { cn } from '@documenso/ui/lib/utils'; export type MonthlyNewUsersChartProps = { className?: string; @@ -20,12 +19,12 @@ export const MonthlyNewUsersChart = ({ className, data }: MonthlyNewUsersChartPr }); return ( -
-
-

New Users

-
+
+
+
+

New Users

+
-
diff --git a/apps/marketing/src/app/(marketing)/open/monthly-total-users-chart.tsx b/apps/marketing/src/app/(marketing)/open/monthly-total-users-chart.tsx index 96ce34556..6ab5572ec 100644 --- a/apps/marketing/src/app/(marketing)/open/monthly-total-users-chart.tsx +++ b/apps/marketing/src/app/(marketing)/open/monthly-total-users-chart.tsx @@ -4,7 +4,6 @@ import { DateTime } from 'luxon'; import { Bar, BarChart, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts'; import type { GetUserMonthlyGrowthResult } from '@documenso/lib/server-only/user/get-user-monthly-growth'; -import { cn } from '@documenso/ui/lib/utils'; export type MonthlyTotalUsersChartProps = { className?: string; @@ -20,12 +19,12 @@ export const MonthlyTotalUsersChart = ({ className, data }: MonthlyTotalUsersCha }); return ( -
-
-

Total Users

-
+
+
+
+

Total Users

+
-
diff --git a/apps/marketing/src/app/(marketing)/open/page.tsx b/apps/marketing/src/app/(marketing)/open/page.tsx index ea7ffda14..31990519e 100644 --- a/apps/marketing/src/app/(marketing)/open/page.tsx +++ b/apps/marketing/src/app/(marketing)/open/page.tsx @@ -11,6 +11,7 @@ import { CallToAction } from '~/components/(marketing)/call-to-action'; import { BarMetric } from './bar-metrics'; import { CapTable } from './cap-table'; import { FundingRaised } from './funding-raised'; +import { MetricCard } from './metric-card'; import { MonthlyCompletedDocumentsChart } from './monthly-completed-documents-chart'; import { MonthlyNewUsersChart } from './monthly-new-users-chart'; import { MonthlyTotalUsersChart } from './monthly-total-users-chart'; @@ -128,17 +129,17 @@ const fetchEarlyAdopters = async () => { export default async function OpenPage() { const [ - // { forks_count: forksCount, stargazers_count: stargazersCount }, - // { total_count: openIssues }, - // { total_count: mergedPullRequests }, + { forks_count: forksCount, stargazers_count: stargazersCount }, + { total_count: openIssues }, + { total_count: mergedPullRequests }, STARGAZERS_DATA, EARLY_ADOPTERS_DATA, MONTHLY_USERS, MONTHLY_COMPLETED_DOCUMENTS, ] = await Promise.all([ - // fetchGithubStats(), - // fetchOpenIssues(), - // fetchMergedPullRequests(), + fetchGithubStats(), + fetchOpenIssues(), + fetchMergedPullRequests(), fetchStargazers(), fetchEarlyAdopters(), getUserMonthlyGrowth(), @@ -166,7 +167,7 @@ export default async function OpenPage() {
- {/*
+
-
*/} +
@@ -206,7 +207,7 @@ export default async function OpenPage() { data={STARGAZERS_DATA} metricKey="stars" - title="Github: Total Stars" + title="GitHub: Total Stars" label="Stars" className="col-span-12 lg:col-span-6" /> @@ -214,27 +215,27 @@ export default async function OpenPage() { data={STARGAZERS_DATA} metricKey="mergedPRs" - title="Github: Total Merged PRs" + title="GitHub: Total Merged PRs" label="Merged PRs" - chartHeight={300} + chartHeight={400} className="col-span-12 lg:col-span-6" /> data={STARGAZERS_DATA} metricKey="forks" - title="Github: Total Forks" + title="GitHub: Total Forks" label="Forks" - chartHeight={300} + chartHeight={400} className="col-span-12 lg:col-span-6" /> data={STARGAZERS_DATA} metricKey="openIssues" - title="Github: Total Open Issues" + title="GitHub: Total Open Issues" label="Open Issues" - chartHeight={300} + chartHeight={400} className="col-span-12 lg:col-span-6" /> diff --git a/apps/marketing/src/app/(marketing)/open/total-signed-documents-chart.tsx b/apps/marketing/src/app/(marketing)/open/total-signed-documents-chart.tsx index 239d15de9..c2b7561de 100644 --- a/apps/marketing/src/app/(marketing)/open/total-signed-documents-chart.tsx +++ b/apps/marketing/src/app/(marketing)/open/total-signed-documents-chart.tsx @@ -4,7 +4,6 @@ import { DateTime } from 'luxon'; import { Bar, BarChart, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts'; import type { GetUserMonthlyGrowthResult } from '@documenso/lib/server-only/user/get-user-monthly-growth'; -import { cn } from '@documenso/ui/lib/utils'; export type TotalSignedDocumentsChartProps = { className?: string; @@ -20,12 +19,12 @@ export const TotalSignedDocumentsChart = ({ className, data }: TotalSignedDocume }); return ( -
-
-

Total Signed Documents

-
+
+
+
+

Total Signed Documents

+
-
diff --git a/apps/marketing/src/app/(marketing)/open/typefully.tsx b/apps/marketing/src/app/(marketing)/open/typefully.tsx index a233904db..4f298fbb3 100644 --- a/apps/marketing/src/app/(marketing)/open/typefully.tsx +++ b/apps/marketing/src/app/(marketing)/open/typefully.tsx @@ -6,18 +6,19 @@ import Link from 'next/link'; import { FaXTwitter } from 'react-icons/fa6'; -import { cn } from '@documenso/ui/lib/utils'; import { Button } from '@documenso/ui/primitives/button'; export type TypefullyProps = HTMLAttributes; export const Typefully = ({ className, ...props }: TypefullyProps) => { return ( -
-

Twitter Stats

+
+
+
+

Twitter Stats

+
-
-
+

Documenso on X

diff --git a/apps/marketing/src/components/(marketing)/callout.tsx b/apps/marketing/src/components/(marketing)/callout.tsx index faa486c46..dfd358c71 100644 --- a/apps/marketing/src/components/(marketing)/callout.tsx +++ b/apps/marketing/src/components/(marketing)/callout.tsx @@ -53,7 +53,7 @@ export const Callout = ({ starCount }: CalloutProps) => { > From 94198e7584492bfc2b1db49526d291bc9cebba74 Mon Sep 17 00:00:00 2001 From: Timur Ercan Date: Thu, 21 Mar 2024 13:16:17 +0100 Subject: [PATCH 4/7] chore: text --- .../(marketing)/open/total-signed-documents-chart.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/marketing/src/app/(marketing)/open/total-signed-documents-chart.tsx b/apps/marketing/src/app/(marketing)/open/total-signed-documents-chart.tsx index c2b7561de..2a8393363 100644 --- a/apps/marketing/src/app/(marketing)/open/total-signed-documents-chart.tsx +++ b/apps/marketing/src/app/(marketing)/open/total-signed-documents-chart.tsx @@ -22,7 +22,7 @@ export const TotalSignedDocumentsChart = ({ className, data }: TotalSignedDocume
-

Total Signed Documents

+

Total Completed Documents

@@ -34,7 +34,10 @@ export const TotalSignedDocumentsChart = ({ className, data }: TotalSignedDocume labelStyle={{ color: 'hsl(var(--primary-foreground))', }} - formatter={(value) => [Number(value).toLocaleString('en-US'), 'Signed Documents']} + formatter={(value) => [ + Number(value).toLocaleString('en-US'), + 'Total Completed Documents', + ]} cursor={{ fill: 'hsl(var(--primary) / 10%)' }} /> @@ -43,7 +46,7 @@ export const TotalSignedDocumentsChart = ({ className, data }: TotalSignedDocume fill="hsl(var(--primary))" radius={[4, 4, 0, 0]} maxBarSize={60} - label="Signed Documents" + label="Total Completed Documents" /> From 72fd1eead2e0701e39ab7d47fc2d45b5581082d2 Mon Sep 17 00:00:00 2001 From: Ephraim Duncan <55143799+dephraiim@users.noreply.github.com> Date: Fri, 22 Mar 2024 06:25:12 +0000 Subject: [PATCH 5/7] fix: use correct date format (#1046) ### Before ![CleanShot 2024-03-21 at 17 23 09@2x](https://github.com/documenso/documenso/assets/55143799/d1cd22ca-399b-4ba2-bb82-b4dc869605c8) ### After ![CleanShot 2024-03-21 at 17 23 17@2x](https://github.com/documenso/documenso/assets/55143799/cdb814ea-01be-4bcb-9bad-df41030f320a) --- packages/lib/constants/date-formats.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/lib/constants/date-formats.ts b/packages/lib/constants/date-formats.ts index 5b36cefdf..6b0dd69c5 100644 --- a/packages/lib/constants/date-formats.ts +++ b/packages/lib/constants/date-formats.ts @@ -13,7 +13,7 @@ export const DATE_FORMATS = [ { key: 'YYYYMMDD', label: 'YYYY-MM-DD', - value: 'YYYY-MM-DD', + value: 'yyyy-MM-dd', }, { key: 'DDMMYYYY', From f5a1d9a625e91890d4d042295bce805d5e1025db Mon Sep 17 00:00:00 2001 From: Ephraim Atta-Duncan Date: Fri, 22 Mar 2024 08:08:37 +0000 Subject: [PATCH 6/7] fix: monthly count instead of cummulative --- .../app/(marketing)/open/monthly-completed-documents-chart.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/marketing/src/app/(marketing)/open/monthly-completed-documents-chart.tsx b/apps/marketing/src/app/(marketing)/open/monthly-completed-documents-chart.tsx index 9626838ed..8ad860062 100644 --- a/apps/marketing/src/app/(marketing)/open/monthly-completed-documents-chart.tsx +++ b/apps/marketing/src/app/(marketing)/open/monthly-completed-documents-chart.tsx @@ -14,7 +14,7 @@ export const MonthlyCompletedDocumentsChart = ({ className, data, }: MonthlyCompletedDocumentsChartProps) => { - const formattedData = [...data].reverse().map(({ month, cume_count: count }) => { + const formattedData = [...data].reverse().map(({ month, count }) => { return { month: DateTime.fromFormat(month, 'yyyy-MM').toFormat('LLLL'), count: Number(count), From 1725af71b6961f40bddbd0fe1c72fdfc4057554c Mon Sep 17 00:00:00 2001 From: Ephraim Duncan <55143799+dephraiim@users.noreply.github.com> Date: Sat, 23 Mar 2024 05:41:12 +0000 Subject: [PATCH 7/7] chore: add test to update username (#1049) --- .../e2e/test-update-user-name.spec.ts | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 packages/app-tests/e2e/test-update-user-name.spec.ts diff --git a/packages/app-tests/e2e/test-update-user-name.spec.ts b/packages/app-tests/e2e/test-update-user-name.spec.ts new file mode 100644 index 000000000..509db651b --- /dev/null +++ b/packages/app-tests/e2e/test-update-user-name.spec.ts @@ -0,0 +1,37 @@ +import { expect, test } from '@playwright/test'; + +import { getUserByEmail } from '@documenso/lib/server-only/user/get-user-by-email'; +import { seedUser } from '@documenso/prisma/seed/users'; + +import { manualLogin } from './fixtures/authentication'; + +test('update user name', async ({ page }) => { + const user = await seedUser(); + + await manualLogin({ + page, + email: user.email, + redirectPath: '/settings/profile', + }); + + await page.getByLabel('Full Name').fill('John Doe'); + + const canvas = page.locator('canvas'); + const box = await canvas.boundingBox(); + + if (box) { + await page.mouse.move(box.x + box.width / 2, box.y + box.height / 2); + await page.mouse.down(); + await page.mouse.move(box.x + box.width / 4, box.y + box.height / 4); + await page.mouse.up(); + } + + await page.getByRole('button', { name: 'Update profile' }).click(); + + // wait for it to finish + await expect(page.getByText('Profile updated', { exact: true })).toBeVisible(); + + await page.waitForURL('/settings/profile'); + + expect((await getUserByEmail({ email: user.email })).name).toEqual('John Doe'); +});