Compare commits

..
Author SHA1 Message Date
Lucas Smith 586b1f5cb5 v2.19.0 2026-09-29 14:37:03 +10:00
6 changed files with 8 additions and 26 deletions
@@ -12,7 +12,7 @@ import { ChevronDownIcon, ChevronsUpDownIcon, ChevronUpIcon } from 'lucide-react
import { useMemo } from 'react';
import { Link, useSearchParams } from 'react-router';
type OrderByColumn = 'documentCount' | 'emailCount' | 'apiCount' | 'emailReports' | 'teamCount' | 'totalCount';
type OrderByColumn = 'documentCount' | 'emailCount' | 'apiCount' | 'emailReports' | 'totalCount';
type OrderByDirection = 'asc' | 'desc';
const parseOrderByColumn = (value: string | undefined): OrderByColumn | undefined => {
@@ -21,7 +21,6 @@ const parseOrderByColumn = (value: string | undefined): OrderByColumn | undefine
value === 'emailCount' ||
value === 'apiCount' ||
value === 'emailReports' ||
value === 'teamCount' ||
value === 'totalCount'
) {
return value;
@@ -179,11 +178,6 @@ export const AdminOrganisationStatsTable = ({ displayMode = 'usage' }: AdminOrga
accessorKey: 'originalClaimId',
cell: ({ row }) => <span className="text-muted-foreground text-sm">{row.original.originalClaimId ?? '—'}</span>,
},
{
header: () => sortableHeader(t`Teams`, 'teamCount'),
accessorKey: 'teamCount',
cell: ({ row }) => row.original.teamCount,
},
{
header: t`Period`,
accessorKey: 'period',
@@ -246,9 +240,6 @@ export const AdminOrganisationStatsTable = ({ displayMode = 'usage' }: AdminOrga
<TableCell>
<Skeleton className="h-4 w-24 rounded-full" />
</TableCell>
<TableCell>
<Skeleton className="h-4 w-10 rounded-full" />
</TableCell>
<TableCell>
<Skeleton className="h-4 w-16 rounded-full" />
</TableCell>
+1 -1
View File
@@ -106,5 +106,5 @@
"vite-plugin-babel-macros": "^1.0.6",
"vite-tsconfig-paths": "^5.1.4"
},
"version": "2.18.0"
"version": "2.19.0"
}
+3 -3
View File
@@ -1,12 +1,12 @@
{
"name": "@documenso/root",
"version": "2.18.0",
"version": "2.19.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@documenso/root",
"version": "2.18.0",
"version": "2.19.0",
"hasInstallScript": true,
"workspaces": [
"apps/*",
@@ -193,7 +193,7 @@
},
"apps/remix": {
"name": "@documenso/remix",
"version": "2.18.0",
"version": "2.19.0",
"dependencies": {
"@cantoo/pdf-lib": "^2.5.3",
"@documenso/api": "*",
+1 -1
View File
@@ -5,7 +5,7 @@
"apps/*",
"packages/*"
],
"version": "2.18.0",
"version": "2.19.0",
"scripts": {
"postinstall": "patch-package",
"build": "turbo run build",
@@ -32,7 +32,7 @@ type FindOrganisationStatsOptions = {
claimId?: string;
page?: number;
perPage?: number;
orderByColumn?: 'documentCount' | 'emailCount' | 'apiCount' | 'emailReports' | 'teamCount' | 'totalCount';
orderByColumn?: 'documentCount' | 'emailCount' | 'apiCount' | 'emailReports' | 'totalCount';
orderByDirection?: 'asc' | 'desc';
};
@@ -95,12 +95,6 @@ export const findOrganisationStats = async ({
'OrganisationClaim.documentQuota as documentQuota',
'OrganisationClaim.emailQuota as emailQuota',
'OrganisationClaim.apiQuota as apiQuota',
// Teams have no monthly history, so this is the current count for every period.
eb
.selectFrom('Team')
.whereRef('Team.organisationId', '=', 'Organisation.id')
.select(sql<number>`count("Team"."id")`.as('count'))
.as('teamCount'),
totalCountExpression.as('totalCount'),
eb.fn.countAll().over().as('totalRows'),
])
@@ -110,7 +104,6 @@ export const findOrganisationStats = async ({
.with('emailCount', () => qb.orderBy('OrganisationMonthlyStat.emailCount', orderByDirection))
.with('apiCount', () => qb.orderBy('OrganisationMonthlyStat.apiCount', orderByDirection))
.with('emailReports', () => qb.orderBy('OrganisationMonthlyStat.emailReports', orderByDirection))
.with('teamCount', () => qb.orderBy('teamCount', orderByDirection))
.with('totalCount', () => qb.orderBy(totalCountExpression, orderByDirection))
.with(undefined, () =>
// Default ordering mirrors the desired SQL: email, api, document descending.
@@ -139,7 +132,6 @@ export const findOrganisationStats = async ({
emailCount: Number(row.emailCount),
apiCount: Number(row.apiCount),
emailReports: Number(row.emailReports),
teamCount: Number(row.teamCount),
documentQuota: row.documentQuota === null ? null : Number(row.documentQuota),
emailQuota: row.emailQuota === null ? null : Number(row.emailQuota),
apiQuota: row.apiQuota === null ? null : Number(row.apiQuota),
@@ -9,7 +9,7 @@ export const ZFindOrganisationStatsRequestSchema = ZFindSearchParamsSchema.exten
.optional(),
claimId: z.string().describe('Filter stats by the original subscription claim ID.').optional(),
orderByColumn: z
.enum(['documentCount', 'emailCount', 'apiCount', 'emailReports', 'teamCount', 'totalCount'])
.enum(['documentCount', 'emailCount', 'apiCount', 'emailReports', 'totalCount'])
.describe('The column to sort by.')
.optional(),
orderByDirection: z.enum(['asc', 'desc']).describe('Sort direction.').default('desc'),
@@ -27,7 +27,6 @@ export const ZFindOrganisationStatsResponseSchema = ZFindResultResponse.extend({
emailCount: z.number(),
apiCount: z.number(),
emailReports: z.number(),
teamCount: z.number(),
documentQuota: z.number().nullable(),
emailQuota: z.number().nullable(),
apiQuota: z.number().nullable(),