mirror of
https://github.com/documenso/documenso.git
synced 2025-11-19 19:21:39 +10:00
chore: changes based on review
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
import { useLingui } from '@lingui/react';
|
import { useLingui } from '@lingui/react';
|
||||||
import { Trans } from '@lingui/react/macro';
|
import { Trans } from '@lingui/react/macro';
|
||||||
import type { RecipientRole } from '@prisma/client';
|
import { RecipientRole } from '@prisma/client';
|
||||||
import { match } from 'ts-pattern';
|
import { match } from 'ts-pattern';
|
||||||
|
|
||||||
import { RECIPIENT_ROLES_DESCRIPTION } from '@documenso/lib/constants/recipient-roles';
|
import { RECIPIENT_ROLES_DESCRIPTION } from '@documenso/lib/constants/recipient-roles';
|
||||||
@ -32,7 +32,6 @@ export const TemplateDocumentReminder = ({
|
|||||||
<TemplateDocumentImage className="mt-6" assetBaseUrl={assetBaseUrl} />
|
<TemplateDocumentImage className="mt-6" assetBaseUrl={assetBaseUrl} />
|
||||||
|
|
||||||
<Section>
|
<Section>
|
||||||
{/* Reminder specific text */}
|
|
||||||
<Text className="text-primary mx-auto mb-0 max-w-[80%] text-center text-lg font-semibold">
|
<Text className="text-primary mx-auto mb-0 max-w-[80%] text-center text-lg font-semibold">
|
||||||
<Trans>
|
<Trans>
|
||||||
Reminder: Please {_(actionVerb).toLowerCase()} your document
|
Reminder: Please {_(actionVerb).toLowerCase()} your document
|
||||||
@ -40,34 +39,33 @@ export const TemplateDocumentReminder = ({
|
|||||||
</Trans>
|
</Trans>
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
{/* Addressee */}
|
|
||||||
<Text className="my-1 text-center text-base text-slate-400">
|
<Text className="my-1 text-center text-base text-slate-400">
|
||||||
<Trans>Hi {recipientName},</Trans>
|
<Trans>Hi {recipientName},</Trans>
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
{/* Reminder Call to Action */}
|
|
||||||
<Text className="my-1 text-center text-base text-slate-400">
|
<Text className="my-1 text-center text-base text-slate-400">
|
||||||
{match(role)
|
{match(role)
|
||||||
.with('SIGNER', () => <Trans>Continue by signing the document.</Trans>)
|
.with(RecipientRole.SIGNER, () => <Trans>Continue by signing the document.</Trans>)
|
||||||
.with('VIEWER', () => <Trans>Continue by viewing the document.</Trans>)
|
.with(RecipientRole.VIEWER, () => <Trans>Continue by viewing the document.</Trans>)
|
||||||
.with('APPROVER', () => <Trans>Continue by approving the document.</Trans>)
|
.with(RecipientRole.APPROVER, () => <Trans>Continue by approving the document.</Trans>)
|
||||||
.with('CC', () => '')
|
.with(RecipientRole.CC, () => '')
|
||||||
.with('ASSISTANT', () => <Trans>Continue by assisting with the document.</Trans>)
|
.with(RecipientRole.ASSISTANT, () => (
|
||||||
|
<Trans>Continue by assisting with the document.</Trans>
|
||||||
|
))
|
||||||
.exhaustive()}
|
.exhaustive()}
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
{/* Primary Action Button */}
|
|
||||||
<Section className="mb-6 mt-8 text-center">
|
<Section className="mb-6 mt-8 text-center">
|
||||||
<Button
|
<Button
|
||||||
className="bg-documenso-500 inline-flex items-center justify-center rounded-lg px-6 py-3 text-center text-sm font-medium text-black no-underline"
|
className="bg-documenso-500 inline-flex items-center justify-center rounded-lg px-6 py-3 text-center text-sm font-medium text-black no-underline"
|
||||||
href={signDocumentLink}
|
href={signDocumentLink}
|
||||||
>
|
>
|
||||||
{match(role)
|
{match(role)
|
||||||
.with('SIGNER', () => <Trans>Sign Document</Trans>)
|
.with(RecipientRole.SIGNER, () => <Trans>Sign Document</Trans>)
|
||||||
.with('VIEWER', () => <Trans>View Document</Trans>)
|
.with(RecipientRole.VIEWER, () => <Trans>View Document</Trans>)
|
||||||
.with('APPROVER', () => <Trans>Approve Document</Trans>)
|
.with(RecipientRole.APPROVER, () => <Trans>Approve Document</Trans>)
|
||||||
.with('CC', () => '')
|
.with(RecipientRole.CC, () => '')
|
||||||
.with('ASSISTANT', () => <Trans>Assist Document</Trans>)
|
.with(RecipientRole.ASSISTANT, () => <Trans>Assist Document</Trans>)
|
||||||
.exhaustive()}
|
.exhaustive()}
|
||||||
</Button>
|
</Button>
|
||||||
</Section>
|
</Section>
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import { msg } from '@lingui/core/macro';
|
||||||
import { useLingui } from '@lingui/react';
|
import { useLingui } from '@lingui/react';
|
||||||
import type { RecipientRole } from '@prisma/client';
|
import type { RecipientRole } from '@prisma/client';
|
||||||
|
|
||||||
@ -30,7 +31,7 @@ export const DocumentReminderEmailTemplate = ({
|
|||||||
|
|
||||||
const action = i18n.t(RECIPIENT_ROLES_DESCRIPTION[role].actionVerb).toLowerCase();
|
const action = i18n.t(RECIPIENT_ROLES_DESCRIPTION[role].actionVerb).toLowerCase();
|
||||||
|
|
||||||
const previewTextString = `Reminder to ${action} ${documentName}`;
|
const previewTextString = i18n._(msg`Reminder to ${action} ${documentName}`);
|
||||||
|
|
||||||
const getAssetUrl = (path: string) => {
|
const getAssetUrl = (path: string) => {
|
||||||
return new URL(path, assetBaseUrl).toString();
|
return new URL(path, assetBaseUrl).toString();
|
||||||
|
|||||||
@ -20,6 +20,6 @@ export const DOCUMENT_AUDIT_LOG_EMAIL_FORMAT = {
|
|||||||
description: 'Document completed',
|
description: 'Document completed',
|
||||||
},
|
},
|
||||||
[DOCUMENT_EMAIL_TYPE.REMINDER]: {
|
[DOCUMENT_EMAIL_TYPE.REMINDER]: {
|
||||||
description: 'Reminder',
|
description: 'Signing Reminder',
|
||||||
},
|
},
|
||||||
} satisfies Record<keyof typeof DOCUMENT_EMAIL_TYPE, unknown>;
|
} satisfies Record<keyof typeof DOCUMENT_EMAIL_TYPE, unknown>;
|
||||||
|
|||||||
@ -35,10 +35,10 @@ export class InngestJobProvider extends BaseJobProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public defineJob<N extends string, T>(job: JobDefinition<N, T>): void {
|
public defineJob<N extends string, T>(job: JobDefinition<N, T>): void {
|
||||||
let fn: InngestFunction.Any;
|
let jobFunction: InngestFunction.Any;
|
||||||
|
|
||||||
if (job.trigger.type === 'cron') {
|
if (job.trigger.type === 'cron') {
|
||||||
fn = this._client.createFunction(
|
jobFunction = this._client.createFunction(
|
||||||
{
|
{
|
||||||
id: job.id,
|
id: job.id,
|
||||||
name: job.name,
|
name: job.name,
|
||||||
@ -60,7 +60,7 @@ export class InngestJobProvider extends BaseJobProvider {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
fn = this._client.createFunction(
|
jobFunction = this._client.createFunction(
|
||||||
{
|
{
|
||||||
id: job.id,
|
id: job.id,
|
||||||
name: job.name,
|
name: job.name,
|
||||||
@ -83,7 +83,7 @@ export class InngestJobProvider extends BaseJobProvider {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
this._functions.push(fn);
|
this._functions.push(jobFunction);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async triggerJob(options: SimpleTriggerJobOptions): Promise<void> {
|
public async triggerJob(options: SimpleTriggerJobOptions): Promise<void> {
|
||||||
|
|||||||
Reference in New Issue
Block a user