mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
Compare commits
3 Commits
88371b665a
...
feat/impro
| Author | SHA1 | Date | |
|---|---|---|---|
| 49b61c6c07 | |||
| e49910c8ef | |||
| a4fe4b4951 |
@ -6,7 +6,7 @@ import { useLingui } from '@lingui/react';
|
|||||||
import { Trans } from '@lingui/react/macro';
|
import { Trans } from '@lingui/react/macro';
|
||||||
import { type Recipient, SigningStatus } from '@prisma/client';
|
import { type Recipient, SigningStatus } from '@prisma/client';
|
||||||
import { History } from 'lucide-react';
|
import { History } from 'lucide-react';
|
||||||
import { useForm } from 'react-hook-form';
|
import { useForm, useWatch } from 'react-hook-form';
|
||||||
import * as z from 'zod';
|
import * as z from 'zod';
|
||||||
|
|
||||||
import { useSession } from '@documenso/lib/client-only/providers/session';
|
import { useSession } from '@documenso/lib/client-only/providers/session';
|
||||||
@ -85,6 +85,11 @@ export const DocumentResendDialog = ({ document, recipients }: DocumentResendDia
|
|||||||
formState: { isSubmitting },
|
formState: { isSubmitting },
|
||||||
} = form;
|
} = form;
|
||||||
|
|
||||||
|
const selectedRecipients = useWatch({
|
||||||
|
control: form.control,
|
||||||
|
name: 'recipients',
|
||||||
|
});
|
||||||
|
|
||||||
const onFormSubmit = async ({ recipients }: TResendDocumentFormSchema) => {
|
const onFormSubmit = async ({ recipients }: TResendDocumentFormSchema) => {
|
||||||
try {
|
try {
|
||||||
await resendDocument({ documentId: document.id, recipients });
|
await resendDocument({ documentId: document.id, recipients });
|
||||||
@ -151,7 +156,7 @@ export const DocumentResendDialog = ({ document, recipients }: DocumentResendDia
|
|||||||
|
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
className="h-5 w-5 rounded-full"
|
className="h-5 w-5 rounded-full border border-neutral-400"
|
||||||
value={recipient.id}
|
value={recipient.id}
|
||||||
checked={value.includes(recipient.id)}
|
checked={value.includes(recipient.id)}
|
||||||
onCheckedChange={(checked: boolean) =>
|
onCheckedChange={(checked: boolean) =>
|
||||||
@ -182,7 +187,13 @@ export const DocumentResendDialog = ({ document, recipients }: DocumentResendDia
|
|||||||
</Button>
|
</Button>
|
||||||
</DialogClose>
|
</DialogClose>
|
||||||
|
|
||||||
<Button className="flex-1" loading={isSubmitting} type="submit" form={FORM_ID}>
|
<Button
|
||||||
|
className="flex-1"
|
||||||
|
loading={isSubmitting}
|
||||||
|
type="submit"
|
||||||
|
form={FORM_ID}
|
||||||
|
disabled={isSubmitting || selectedRecipients.length === 0}
|
||||||
|
>
|
||||||
<Trans>Send reminder</Trans>
|
<Trans>Send reminder</Trans>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -160,6 +160,14 @@ export const DocumentSigningPageView = ({
|
|||||||
return (
|
return (
|
||||||
<DocumentSigningRecipientProvider recipient={recipient} targetSigner={targetSigner}>
|
<DocumentSigningRecipientProvider recipient={recipient} targetSigner={targetSigner}>
|
||||||
<div className="mx-auto w-full max-w-screen-xl sm:px-6">
|
<div className="mx-auto w-full max-w-screen-xl sm:px-6">
|
||||||
|
{document.team.teamGlobalSettings.brandingEnabled &&
|
||||||
|
document.team.teamGlobalSettings.brandingLogo && (
|
||||||
|
<img
|
||||||
|
src={`/api/branding/logo/team/${document.teamId}`}
|
||||||
|
alt={`${document.team.name}'s Logo`}
|
||||||
|
className="mb-4 h-12 w-12 md:mb-2"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<h1
|
<h1
|
||||||
className="block max-w-[20rem] truncate text-2xl font-semibold sm:mt-4 md:max-w-[30rem] md:text-3xl"
|
className="block max-w-[20rem] truncate text-2xl font-semibold sm:mt-4 md:max-w-[30rem] md:text-3xl"
|
||||||
title={document.title}
|
title={document.title}
|
||||||
|
|||||||
@ -91,6 +91,12 @@ export const getDocumentAndSenderByToken = async ({
|
|||||||
select: {
|
select: {
|
||||||
name: true,
|
name: true,
|
||||||
teamEmail: true,
|
teamEmail: true,
|
||||||
|
teamGlobalSettings: {
|
||||||
|
select: {
|
||||||
|
brandingEnabled: true,
|
||||||
|
brandingLogo: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@ -714,7 +714,6 @@ export const AddSignersFormPartial = ({
|
|||||||
handleRecipientAutoCompleteSelect(index, suggestion)
|
handleRecipientAutoCompleteSelect(index, suggestion)
|
||||||
}
|
}
|
||||||
onSearchQueryChange={(query) => {
|
onSearchQueryChange={(query) => {
|
||||||
console.log('onSearchQueryChange', query);
|
|
||||||
field.onChange(query);
|
field.onChange(query);
|
||||||
setRecipientSearchQuery(query);
|
setRecipientSearchQuery(query);
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user