mirror of
https://github.com/documenso/documenso.git
synced 2025-11-15 01:01:49 +10:00
feat(leaderboard): add Stripe subscription link to customer names
This commit enhances the leaderboard by adding a clickable link to each customer's name, which directs to their Stripe subscription page. It also removes the ID column and includes the planId in the signing volume data for improved user experience and easier access to subscription details.
This commit is contained in:
@ -18,6 +18,7 @@ export type SigningVolume = {
|
|||||||
name: string;
|
name: string;
|
||||||
signingVolume: number;
|
signingVolume: number;
|
||||||
createdAt: Date;
|
createdAt: Date;
|
||||||
|
planId: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
type LeaderboardTableProps = {
|
type LeaderboardTableProps = {
|
||||||
@ -46,12 +47,6 @@ export const LeaderboardTable = ({
|
|||||||
|
|
||||||
const columns = useMemo(() => {
|
const columns = useMemo(() => {
|
||||||
return [
|
return [
|
||||||
{
|
|
||||||
header: 'ID',
|
|
||||||
accessorKey: 'id',
|
|
||||||
cell: ({ row }) => <div>{row.original.id}</div>,
|
|
||||||
size: 60,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
header: () => (
|
header: () => (
|
||||||
<div
|
<div
|
||||||
@ -63,7 +58,21 @@ export const LeaderboardTable = ({
|
|||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
accessorKey: 'name',
|
accessorKey: 'name',
|
||||||
cell: ({ row }) => <div>{row.getValue('name')}</div>,
|
cell: ({ row }) => {
|
||||||
|
console.log('row.original', row.original);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<a
|
||||||
|
className="text-primary underline"
|
||||||
|
href={`https://dashboard.stripe.com/subscriptions/${row.original.planId}`}
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
{row.getValue('name')}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
},
|
||||||
size: 250,
|
size: 250,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -21,5 +21,7 @@ export async function search({ search, page, perPage, sortBy, sortOrder }: Searc
|
|||||||
|
|
||||||
const results = await getSigningVolume({ search, page, perPage, sortBy, sortOrder });
|
const results = await getSigningVolume({ search, page, perPage, sortBy, sortOrder });
|
||||||
|
|
||||||
|
console.log('results', results);
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,6 +64,11 @@ export async function getSigningVolume({
|
|||||||
id: true,
|
id: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Subscription: {
|
||||||
|
select: {
|
||||||
|
planId: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
team: {
|
team: {
|
||||||
@ -79,6 +84,11 @@ export async function getSigningVolume({
|
|||||||
id: true,
|
id: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
subscription: {
|
||||||
|
select: {
|
||||||
|
planId: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -102,6 +112,8 @@ export async function getSigningVolume({
|
|||||||
name,
|
name,
|
||||||
signingVolume,
|
signingVolume,
|
||||||
createdAt: subscription.createdAt,
|
createdAt: subscription.createdAt,
|
||||||
|
planId:
|
||||||
|
subscription.User?.Subscription?.[0]?.planId || subscription.team?.subscription?.planId,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -961,7 +961,7 @@ msgid "Create your account and start using state-of-the-art document signing. Op
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: apps/web/src/app/(dashboard)/admin/documents/document-results.tsx:62
|
#: apps/web/src/app/(dashboard)/admin/documents/document-results.tsx:62
|
||||||
#: apps/web/src/app/(dashboard)/admin/leaderboard/data-table-leaderboard.tsx:89
|
#: apps/web/src/app/(dashboard)/admin/leaderboard/data-table-leaderboard.tsx:98
|
||||||
#: apps/web/src/app/(dashboard)/documents/[id]/document-page-view-information.tsx:35
|
#: apps/web/src/app/(dashboard)/documents/[id]/document-page-view-information.tsx:35
|
||||||
#: apps/web/src/app/(dashboard)/documents/data-table.tsx:54
|
#: apps/web/src/app/(dashboard)/documents/data-table.tsx:54
|
||||||
#: apps/web/src/app/(dashboard)/settings/security/passkeys/user-passkeys-data-table.tsx:65
|
#: apps/web/src/app/(dashboard)/settings/security/passkeys/user-passkeys-data-table.tsx:65
|
||||||
@ -1989,7 +1989,7 @@ msgid "My templates"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: apps/web/src/app/(dashboard)/admin/documents/[id]/recipient-item.tsx:148
|
#: apps/web/src/app/(dashboard)/admin/documents/[id]/recipient-item.tsx:148
|
||||||
#: apps/web/src/app/(dashboard)/admin/leaderboard/data-table-leaderboard.tsx:61
|
#: apps/web/src/app/(dashboard)/admin/leaderboard/data-table-leaderboard.tsx:56
|
||||||
#: apps/web/src/app/(dashboard)/admin/users/[id]/page.tsx:99
|
#: apps/web/src/app/(dashboard)/admin/users/[id]/page.tsx:99
|
||||||
#: apps/web/src/app/(dashboard)/admin/users/data-table-users.tsx:66
|
#: apps/web/src/app/(dashboard)/admin/users/data-table-users.tsx:66
|
||||||
#: apps/web/src/app/(dashboard)/settings/security/passkeys/user-passkeys-data-table-actions.tsx:144
|
#: apps/web/src/app/(dashboard)/settings/security/passkeys/user-passkeys-data-table-actions.tsx:144
|
||||||
@ -2594,7 +2594,7 @@ msgstr ""
|
|||||||
msgid "Search by document title"
|
msgid "Search by document title"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: apps/web/src/app/(dashboard)/admin/leaderboard/data-table-leaderboard.tsx:140
|
#: apps/web/src/app/(dashboard)/admin/leaderboard/data-table-leaderboard.tsx:149
|
||||||
#: apps/web/src/app/(dashboard)/admin/users/data-table-users.tsx:144
|
#: apps/web/src/app/(dashboard)/admin/users/data-table-users.tsx:144
|
||||||
msgid "Search by name or email"
|
msgid "Search by name or email"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@ -2816,7 +2816,7 @@ msgstr ""
|
|||||||
msgid "Signing up..."
|
msgid "Signing up..."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: apps/web/src/app/(dashboard)/admin/leaderboard/data-table-leaderboard.tsx:75
|
#: apps/web/src/app/(dashboard)/admin/leaderboard/data-table-leaderboard.tsx:84
|
||||||
#: apps/web/src/app/(dashboard)/admin/leaderboard/page.tsx:46
|
#: apps/web/src/app/(dashboard)/admin/leaderboard/page.tsx:46
|
||||||
msgid "Signing Volume"
|
msgid "Signing Volume"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|||||||
@ -956,7 +956,7 @@ msgid "Create your account and start using state-of-the-art document signing. Op
|
|||||||
msgstr "Create your account and start using state-of-the-art document signing. Open and beautiful signing is within your grasp."
|
msgstr "Create your account and start using state-of-the-art document signing. Open and beautiful signing is within your grasp."
|
||||||
|
|
||||||
#: apps/web/src/app/(dashboard)/admin/documents/document-results.tsx:62
|
#: apps/web/src/app/(dashboard)/admin/documents/document-results.tsx:62
|
||||||
#: apps/web/src/app/(dashboard)/admin/leaderboard/data-table-leaderboard.tsx:89
|
#: apps/web/src/app/(dashboard)/admin/leaderboard/data-table-leaderboard.tsx:98
|
||||||
#: apps/web/src/app/(dashboard)/documents/[id]/document-page-view-information.tsx:35
|
#: apps/web/src/app/(dashboard)/documents/[id]/document-page-view-information.tsx:35
|
||||||
#: apps/web/src/app/(dashboard)/documents/data-table.tsx:54
|
#: apps/web/src/app/(dashboard)/documents/data-table.tsx:54
|
||||||
#: apps/web/src/app/(dashboard)/settings/security/passkeys/user-passkeys-data-table.tsx:65
|
#: apps/web/src/app/(dashboard)/settings/security/passkeys/user-passkeys-data-table.tsx:65
|
||||||
@ -2007,7 +2007,7 @@ msgid "My templates"
|
|||||||
msgstr "My templates"
|
msgstr "My templates"
|
||||||
|
|
||||||
#: apps/web/src/app/(dashboard)/admin/documents/[id]/recipient-item.tsx:148
|
#: apps/web/src/app/(dashboard)/admin/documents/[id]/recipient-item.tsx:148
|
||||||
#: apps/web/src/app/(dashboard)/admin/leaderboard/data-table-leaderboard.tsx:61
|
#: apps/web/src/app/(dashboard)/admin/leaderboard/data-table-leaderboard.tsx:56
|
||||||
#: apps/web/src/app/(dashboard)/admin/users/[id]/page.tsx:99
|
#: apps/web/src/app/(dashboard)/admin/users/[id]/page.tsx:99
|
||||||
#: apps/web/src/app/(dashboard)/admin/users/data-table-users.tsx:66
|
#: apps/web/src/app/(dashboard)/admin/users/data-table-users.tsx:66
|
||||||
#: apps/web/src/app/(dashboard)/settings/security/passkeys/user-passkeys-data-table-actions.tsx:144
|
#: apps/web/src/app/(dashboard)/settings/security/passkeys/user-passkeys-data-table-actions.tsx:144
|
||||||
@ -2612,7 +2612,7 @@ msgstr "Search"
|
|||||||
msgid "Search by document title"
|
msgid "Search by document title"
|
||||||
msgstr "Search by document title"
|
msgstr "Search by document title"
|
||||||
|
|
||||||
#: apps/web/src/app/(dashboard)/admin/leaderboard/data-table-leaderboard.tsx:140
|
#: apps/web/src/app/(dashboard)/admin/leaderboard/data-table-leaderboard.tsx:149
|
||||||
#: apps/web/src/app/(dashboard)/admin/users/data-table-users.tsx:144
|
#: apps/web/src/app/(dashboard)/admin/users/data-table-users.tsx:144
|
||||||
msgid "Search by name or email"
|
msgid "Search by name or email"
|
||||||
msgstr "Search by name or email"
|
msgstr "Search by name or email"
|
||||||
@ -2838,7 +2838,7 @@ msgstr "Signing in..."
|
|||||||
msgid "Signing up..."
|
msgid "Signing up..."
|
||||||
msgstr "Signing up..."
|
msgstr "Signing up..."
|
||||||
|
|
||||||
#: apps/web/src/app/(dashboard)/admin/leaderboard/data-table-leaderboard.tsx:75
|
#: apps/web/src/app/(dashboard)/admin/leaderboard/data-table-leaderboard.tsx:84
|
||||||
#: apps/web/src/app/(dashboard)/admin/leaderboard/page.tsx:46
|
#: apps/web/src/app/(dashboard)/admin/leaderboard/page.tsx:46
|
||||||
msgid "Signing Volume"
|
msgid "Signing Volume"
|
||||||
msgstr "Signing Volume"
|
msgstr "Signing Volume"
|
||||||
|
|||||||
Reference in New Issue
Block a user