mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
Add ability to enable or disable allowed signature types: - Drawn - Typed - Uploaded **Tabbed style signature dialog**  **Document settings**  **Team preferences**  - Add multiselect to select allowed signatures in document and templates settings tab - Add multiselect to select allowed signatures in teams preferences - Removed "Enable typed signatures" from document/template edit page - Refactored signature pad to use tabs instead of an all in one signature pad Added E2E tests to check settings are applied correctly for documents and templates
63 lines
1.7 KiB
TypeScript
63 lines
1.7 KiB
TypeScript
import type { MessageDescriptor } from '@lingui/core';
|
|
import { msg } from '@lingui/core/macro';
|
|
import { DocumentDistributionMethod, DocumentStatus } from '@prisma/client';
|
|
|
|
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>;
|
|
|
|
export enum DocumentSignatureType {
|
|
DRAW = 'draw',
|
|
TYPE = 'type',
|
|
UPLOAD = 'upload',
|
|
}
|
|
|
|
type DocumentSignatureTypeData = {
|
|
label: MessageDescriptor;
|
|
value: DocumentSignatureType;
|
|
};
|
|
|
|
export const DOCUMENT_SIGNATURE_TYPES = {
|
|
[DocumentSignatureType.DRAW]: {
|
|
label: msg`Draw`,
|
|
value: DocumentSignatureType.DRAW,
|
|
},
|
|
[DocumentSignatureType.TYPE]: {
|
|
label: msg`Type`,
|
|
value: DocumentSignatureType.TYPE,
|
|
},
|
|
[DocumentSignatureType.UPLOAD]: {
|
|
label: msg`Upload`,
|
|
value: DocumentSignatureType.UPLOAD,
|
|
},
|
|
} satisfies Record<DocumentSignatureType, DocumentSignatureTypeData>;
|