mirror of
https://github.com/documenso/documenso.git
synced 2026-07-11 05:25:08 +10:00
138d663c25
Merge origin/main into feat/external-2fa-codes. Resolve formatting conflicts caused by biome rollout; preserve both feature streams: PR's external 2FA token + signing-session 2FA proof additions plus main's RateLimit/RecipientExpired/signingReminders/date-auto-insert. In complete-document-with-token.ts, drop the duplicate early field-fetching block introduced when main moved that logic later with date auto-insert support; keep the EXTERNAL_TWO_FACTOR_AUTH check using derivedRecipientActionAuth.
78 lines
2.1 KiB
TypeScript
78 lines
2.1 KiB
TypeScript
/**
|
|
* Workaround for E2E tests to not import `msg`.
|
|
*/
|
|
import { DocumentSignatureType } from '@documenso/lib/utils/teams';
|
|
import type { MessageDescriptor } from '@lingui/core';
|
|
import { msg } from '@lingui/core/macro';
|
|
import { DocumentDistributionMethod, DocumentStatus } from '@prisma/client';
|
|
|
|
export { DocumentSignatureType };
|
|
|
|
/**
|
|
* Maximum count returned per status bucket in document stats. The server clamps
|
|
* each count to this value; the UI should display "10,000+" when it sees it.
|
|
*/
|
|
export const STATS_COUNT_CAP = 10_000;
|
|
|
|
export const DOCUMENT_STATUS: {
|
|
[status in DocumentStatus]: { description: MessageDescriptor };
|
|
} = {
|
|
[DocumentStatus.COMPLETED]: {
|
|
description: msg`Completed`,
|
|
},
|
|
[DocumentStatus.REJECTED]: {
|
|
description: msg`Rejected`,
|
|
},
|
|
[DocumentStatus.DRAFT]: {
|
|
description: msg`Draft`,
|
|
},
|
|
[DocumentStatus.PENDING]: {
|
|
description: msg`Pending`,
|
|
},
|
|
};
|
|
|
|
type DocumentDistributionMethodTypeData = {
|
|
value: DocumentDistributionMethod;
|
|
description: MessageDescriptor;
|
|
};
|
|
|
|
export const DOCUMENT_DISTRIBUTION_METHODS: Record<string, DocumentDistributionMethodTypeData> = {
|
|
[DocumentDistributionMethod.EMAIL]: {
|
|
value: DocumentDistributionMethod.EMAIL,
|
|
description: msg`Email`,
|
|
},
|
|
[DocumentDistributionMethod.NONE]: {
|
|
value: DocumentDistributionMethod.NONE,
|
|
description: msg`None`,
|
|
},
|
|
} satisfies Record<DocumentDistributionMethod, DocumentDistributionMethodTypeData>;
|
|
|
|
type DocumentSignatureTypeData = {
|
|
label: MessageDescriptor;
|
|
value: DocumentSignatureType;
|
|
};
|
|
|
|
export const DOCUMENT_SIGNATURE_TYPES = {
|
|
[DocumentSignatureType.DRAW]: {
|
|
label: msg({
|
|
message: `Draw`,
|
|
context: `Draw signature`,
|
|
}),
|
|
value: DocumentSignatureType.DRAW,
|
|
},
|
|
[DocumentSignatureType.TYPE]: {
|
|
label: msg({
|
|
message: `Type`,
|
|
context: `Type signature`,
|
|
}),
|
|
value: DocumentSignatureType.TYPE,
|
|
},
|
|
[DocumentSignatureType.UPLOAD]: {
|
|
label: msg({
|
|
message: `Upload`,
|
|
context: `Upload signature`,
|
|
}),
|
|
value: DocumentSignatureType.UPLOAD,
|
|
},
|
|
} satisfies Record<DocumentSignatureType, DocumentSignatureTypeData>;
|