From 3bc9b5ada008ea07a2f4735be93b4926f99862fb Mon Sep 17 00:00:00 2001 From: Adithya Krishna Date: Wed, 17 Apr 2024 04:08:41 +0530 Subject: [PATCH 1/3] chore: fix text padding --- apps/web/src/app/(signing)/sign/[token]/complete/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/app/(signing)/sign/[token]/complete/page.tsx b/apps/web/src/app/(signing)/sign/[token]/complete/page.tsx index cfed976e5..1b7adfe70 100644 --- a/apps/web/src/app/(signing)/sign/[token]/complete/page.tsx +++ b/apps/web/src/app/(signing)/sign/[token]/complete/page.tsx @@ -131,7 +131,7 @@ export default async function CompletedSigningPage({ )) .with({ deletedAt: null }, () => ( -
+
Waiting for others to sign
From 8fe67e167cef22614f4e678f0096cd58cb6ff1f3 Mon Sep 17 00:00:00 2001 From: David Nguyen Date: Wed, 17 Apr 2024 19:13:54 +0700 Subject: [PATCH 2/3] fix: duplicate templates (#1104) ## Description Fix the issue where duplicate templates can be created ## Changes Made - Prevent duplicate templates by correctly disabling elements - Clear the PDF when the form is reset - General UI changes to new template dialog for consistency - Add description for new template dialog - Add close button for new template dialog ## Testing Performed Manual testing ## Checklist - [X] I have tested these changes locally and they work as expected. - [X] I have followed the project's coding style guidelines. ## Summary by CodeRabbit - **New Features** - Introduced new components in the template creation dialog for better usability: `DialogClose`, `DialogDescription`, and `DialogFooter`. - Enhanced file upload handling and display. - Added a cancel button and a create template button to the dialog footer for improved navigation. - **Refactor** - Updated the dialog content and form layout for a more intuitive user experience. - Refactored form structure and labels for clarity. - **Removed Features** - Removed the `Label` component from the dialog. --- .../templates/new-template-dialog.tsx | 111 ++++++++++-------- 1 file changed, 59 insertions(+), 52 deletions(-) diff --git a/apps/web/src/app/(dashboard)/templates/new-template-dialog.tsx b/apps/web/src/app/(dashboard)/templates/new-template-dialog.tsx index 37d60f946..ab05ac3dc 100644 --- a/apps/web/src/app/(dashboard)/templates/new-template-dialog.tsx +++ b/apps/web/src/app/(dashboard)/templates/new-template-dialog.tsx @@ -18,7 +18,10 @@ import { Button } from '@documenso/ui/primitives/button'; import { Card, CardContent } from '@documenso/ui/primitives/card'; import { Dialog, + DialogClose, DialogContent, + DialogDescription, + DialogFooter, DialogHeader, DialogTitle, DialogTrigger, @@ -34,7 +37,6 @@ import { FormMessage, } from '@documenso/ui/primitives/form/form'; import { Input } from '@documenso/ui/primitives/input'; -import { Label } from '@documenso/ui/primitives/label'; import { useToast } from '@documenso/ui/primitives/use-toast'; const ZCreateTemplateFormSchema = z.object({ @@ -61,8 +63,7 @@ export const NewTemplateDialog = ({ teamId, templateRootPath }: NewTemplateDialo resolver: zodResolver(ZCreateTemplateFormSchema), }); - const { mutateAsync: createTemplate, isLoading: isCreatingTemplate } = - trpc.template.createTemplate.useMutation(); + const { mutateAsync: createTemplate } = trpc.template.createTemplate.useMutation(); const [showNewTemplateDialog, setShowNewTemplateDialog] = useState(false); const [uploadedFile, setUploadedFile] = useState<{ file: File; fileBase64: string } | null>(); @@ -140,6 +141,7 @@ export const NewTemplateDialog = ({ teamId, templateRootPath }: NewTemplateDialo useEffect(() => { if (!showNewTemplateDialog) { form.reset(); + setUploadedFile(null); } }, [form, showNewTemplateDialog]); @@ -154,20 +156,23 @@ export const NewTemplateDialog = ({ teamId, templateRootPath }: NewTemplateDialo - New Template + New Template + + Templates allow you to quickly generate documents with pre-filled recipients and fields. + -
-
- + + +
( - Name your template + Template name - + @@ -180,55 +185,57 @@ export const NewTemplateDialog = ({ teamId, templateRootPath }: NewTemplateDialo )} /> -
- +
+ {uploadedFile ? ( + + + -
- {uploadedFile ? ( - - - +
+
+
+
+
-
-
-
-
-
+

+ Uploaded Document +

-

- Uploaded Document -

- - - {uploadedFile.file.name} - - - - ) : ( - - )} -
+ + {uploadedFile.file.name} + + + + ) : ( + + )}
-
- + + + -
- - -
+ +
+ + ); From 3d3c53db023a5910792740bb52d575e79e841d9c Mon Sep 17 00:00:00 2001 From: Catalin Pit <25515812+catalinpit@users.noreply.github.com> Date: Wed, 17 Apr 2024 15:36:54 +0300 Subject: [PATCH 3/3] feat: add extra info for recipient roles (#1105) ## Description Add additional information for each role to help document owners understand what each role involves. ## Changes Made ![CleanShot 2024-04-16 at 10 24 19](https://github.com/documenso/documenso/assets/25515812/bac6cd7d-fbe2-4987-ac17-de08db882eda) ![CleanShot 2024-04-16 at 10 24 27](https://github.com/documenso/documenso/assets/25515812/1bd23021-e971-451a-8e36-df5db57687f7) ![CleanShot 2024-04-16 at 10 24 35](https://github.com/documenso/documenso/assets/25515812/e658e86e-7fa1-4a40-9ed9-317964388e61) ## Testing Performed Tested the changes locally. ## Checklist - [x] I have tested these changes locally and they work as expected. - [ ] I have added/updated tests that prove the effectiveness of these changes. - [ ] I have updated the documentation to reflect these changes, if applicable. - [x] I have followed the project's coding style guidelines. - [ ] I have addressed the code review feedback from the previous submission, if applicable. ## Summary by CodeRabbit - **New Features** - Updated recipient role terminology and added tooltips in the `AddSignersFormPartial` component: - "Signer" changed to "Needs to sign" with tooltip - "Receives copy" changed to "Needs to approve" with tooltip - "Approver" changed to "Needs to view" with tooltip - "Viewer" changed to "Receives copy" with tooltip - Enhanced select dropdown options with icons and tooltips for different recipient roles in the `AddTemplatePlaceholderRecipients` component. --------- Co-authored-by: Timur Ercan --- .../primitives/document-flow/add-signers.tsx | 80 +++++++++++++++--- .../add-template-placeholder-recipients.tsx | 81 +++++++++++++++---- 2 files changed, 134 insertions(+), 27 deletions(-) diff --git a/packages/ui/primitives/document-flow/add-signers.tsx b/packages/ui/primitives/document-flow/add-signers.tsx index 27839a453..25169bcec 100644 --- a/packages/ui/primitives/document-flow/add-signers.tsx +++ b/packages/ui/primitives/document-flow/add-signers.tsx @@ -361,29 +361,83 @@ export const AddSignersFormPartial = ({
- {ROLE_ICONS[RecipientRole.SIGNER]} - Signer -
-
- - -
- {ROLE_ICONS[RecipientRole.CC]} - Receives copy +
+ {ROLE_ICONS[RecipientRole.SIGNER]} + Needs to sign +
+ + + + + +

+ The recipient is required to sign the document for it to be + completed. +

+
+
- {ROLE_ICONS[RecipientRole.APPROVER]} - Approver +
+ + {ROLE_ICONS[RecipientRole.APPROVER]} + + Needs to approve +
+ + + + + +

+ The recipient is required to approve the document for it to + be completed. +

+
+
- {ROLE_ICONS[RecipientRole.VIEWER]} - Viewer +
+ {ROLE_ICONS[RecipientRole.VIEWER]} + Needs to view +
+ + + + + +

+ The recipient is required to view the document for it to be + completed. +

+
+
+
+
+ + +
+
+ {ROLE_ICONS[RecipientRole.CC]} + Receives copy +
+ + + + + +

+ The recipient is not required to take any action and + receives a copy of the document after it is completed. +

+
+
diff --git a/packages/ui/primitives/template-flow/add-template-placeholder-recipients.tsx b/packages/ui/primitives/template-flow/add-template-placeholder-recipients.tsx index 08cfc4957..e415f1aac 100644 --- a/packages/ui/primitives/template-flow/add-template-placeholder-recipients.tsx +++ b/packages/ui/primitives/template-flow/add-template-placeholder-recipients.tsx @@ -4,7 +4,7 @@ import React, { useId, useState } from 'react'; import { zodResolver } from '@hookform/resolvers/zod'; import { AnimatePresence, motion } from 'framer-motion'; -import { Plus, Trash } from 'lucide-react'; +import { InfoIcon, Plus, Trash } from 'lucide-react'; import { useSession } from 'next-auth/react'; import { Controller, useFieldArray, useForm } from 'react-hook-form'; @@ -25,6 +25,7 @@ import type { DocumentFlowStep } from '../document-flow/types'; import { ROLE_ICONS } from '../recipient-role-icons'; import { Select, SelectContent, SelectItem, SelectTrigger } from '../select'; import { useStep } from '../stepper'; +import { Tooltip, TooltipContent, TooltipTrigger } from '../tooltip'; import type { TAddTemplatePlacholderRecipientsFormSchema } from './add-template-placeholder-recipients.types'; import { ZAddTemplatePlacholderRecipientsFormSchema } from './add-template-placeholder-recipients.types'; @@ -159,29 +160,81 @@ export const AddTemplatePlaceholderRecipientsFormPartial = ({
- {ROLE_ICONS[RecipientRole.SIGNER]} - Signer -
-
- - -
- {ROLE_ICONS[RecipientRole.CC]} - Receives copy +
+ {ROLE_ICONS[RecipientRole.SIGNER]} + Needs to sign +
+ + + + + +

+ The recipient is required to sign the document for it to be + completed. +

+
+
- {ROLE_ICONS[RecipientRole.APPROVER]} - Approver +
+ {ROLE_ICONS[RecipientRole.APPROVER]} + Needs to approve +
+ + + + + +

+ The recipient is required to approve the document for it to be + completed. +

+
+
- {ROLE_ICONS[RecipientRole.VIEWER]} - Viewer +
+ {ROLE_ICONS[RecipientRole.VIEWER]} + Needs to view +
+ + + + + +

+ The recipient is required to view the document for it to be + completed. +

+
+
+
+
+ + +
+
+ {ROLE_ICONS[RecipientRole.CC]} + Receives copy +
+ + + + + +

+ The recipient is not required to take any action and receives a + copy of the document after it is completed. +

+
+