The Open Source DocuSign Alternative.
TypeScript digital-signaturedocument-signingdocusign-alternativee-signatureesignesignaturenext-authnextjsopen-sourcepades-standardpdfpdf-signpdf-signaturepostgresqlprismaself-hostedsigningtypescript
feat: add extra info for recipient roles (#1105)
Catalin Pit3d3c53db023a
diff --git a/packages/ui/primitives/document-flow/add-signers.tsx b/packages/ui/primitives/document-flow/add-signers.tsxindex 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 = ({<SelectContent align="end"><SelectItem value={RecipientRole.SIGNER}><div className="flex items-center">- <span className="mr-2">{ROLE_ICONS[RecipientRole.SIGNER]}</span>- Signer+ <div className="flex w-[150px] items-center">+ <span className="mr-2">{ROLE_ICONS[RecipientRole.SIGNER]}</span>+ Needs to sign+ </div>+ <Tooltip>+ <TooltipTrigger>+ <InfoIcon className="h-4 w-4" />+ </TooltipTrigger>+ <TooltipContent className="text-foreground z-9999 max-w-md p-4">+ <p>+ The recipient is required to sign the document for it to be+ completed.+ </p>+ </TooltipContent>+ </Tooltip></div></SelectItem>- <SelectItem value={RecipientRole.CC}>+ <SelectItem value={RecipientRole.APPROVER}><div className="flex items-center">- <span className="mr-2">{ROLE_ICONS[RecipientRole.CC]}</span>- Receives copy+ <div className="flex w-[150px] items-center">+ <span className="mr-2">+ {ROLE_ICONS[RecipientRole.APPROVER]}+ </span>+ Needs to approve+ </div>+ <Tooltip>+ <TooltipTrigger>+ <InfoIcon className="h-4 w-4" />+ </TooltipTrigger>+ <TooltipContent className="text-foreground z-9999 max-w-md p-4">+ <p>+ The recipient is required to approve the document for it to+ be completed.+ </p>+ </TooltipContent>+ </Tooltip></div></SelectItem>- <SelectItem value={RecipientRole.APPROVER}>+ <SelectItem value={RecipientRole.VIEWER}><div className="flex items-center">- <span className="mr-2">{ROLE_ICONS[RecipientRole.APPROVER]}</span>- Approver+ <div className="flex w-[150px] items-center">+ <span className="mr-2">{ROLE_ICONS[RecipientRole.VIEWER]}</span>+ Needs to view+ </div>+ <Tooltip>+ <TooltipTrigger>+ <InfoIcon className="h-4 w-4" />+ </TooltipTrigger>+ <TooltipContent className="text-foreground z-9999 max-w-md p-4">+ <p>+ The recipient is required to view the document for it to be+ completed.+ </p>+ </TooltipContent>+ </Tooltip></div></SelectItem>- <SelectItem value={RecipientRole.VIEWER}>+ <SelectItem value={RecipientRole.CC}><div className="flex items-center">- <span className="mr-2">{ROLE_ICONS[RecipientRole.VIEWER]}</span>- Viewer+ <div className="flex w-[150px] items-center">+ <span className="mr-2">{ROLE_ICONS[RecipientRole.CC]}</span>+ Receives copy+ </div>+ <Tooltip>+ <TooltipTrigger>+ <InfoIcon className="h-4 w-4" />+ </TooltipTrigger>+ <TooltipContent className="text-foreground z-9999 max-w-md p-4">+ <p>+ The recipient is not required to take any action and+ receives a copy of the document after it is completed.+ </p>+ </TooltipContent>+ </Tooltip></div></SelectItem></SelectContent>diff --git a/packages/ui/primitives/template-flow/add-template-placeholder-recipients.tsx b/packages/ui/primitives/template-flow/add-template-placeholder-recipients.tsxindex 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 = ({<SelectContent className="" align="end"><SelectItem value={RecipientRole.SIGNER}><div className="flex items-center">- <span className="mr-2">{ROLE_ICONS[RecipientRole.SIGNER]}</span>- Signer+ <div className="flex w-[150px] items-center">+ <span className="mr-2">{ROLE_ICONS[RecipientRole.SIGNER]}</span>+ Needs to sign+ </div>+ <Tooltip>+ <TooltipTrigger>+ <InfoIcon className="h-4 w-4" />+ </TooltipTrigger>+ <TooltipContent className="text-foreground z-9999 max-w-md p-4">+ <p>+ The recipient is required to sign the document for it to be+ completed.+ </p>+ </TooltipContent>+ </Tooltip></div></SelectItem>- <SelectItem value={RecipientRole.CC}>+ <SelectItem value={RecipientRole.APPROVER}><div className="flex items-center">- <span className="mr-2">{ROLE_ICONS[RecipientRole.CC]}</span>- Receives copy+ <div className="flex w-[150px] items-center">+ <span className="mr-2">{ROLE_ICONS[RecipientRole.APPROVER]}</span>+ Needs to approve+ </div>+ <Tooltip>+ <TooltipTrigger>+ <InfoIcon className="h-4 w-4" />+ </TooltipTrigger>+ <TooltipContent className="text-foreground z-9999 max-w-md p-4">+ <p>+ The recipient is required to approve the document for it to be+ completed.+ </p>+ </TooltipContent>+ </Tooltip></div></SelectItem>- <SelectItem value={RecipientRole.APPROVER}>+ <SelectItem value={RecipientRole.VIEWER}><div className="flex items-center">- <span className="mr-2">{ROLE_ICONS[RecipientRole.APPROVER]}</span>- Approver+ <div className="flex w-[150px] items-center">+ <span className="mr-2">{ROLE_ICONS[RecipientRole.VIEWER]}</span>+ Needs to view+ </div>+ <Tooltip>+ <TooltipTrigger>+ <InfoIcon className="h-4 w-4" />+ </TooltipTrigger>+ <TooltipContent className="text-foreground z-9999 max-w-md p-4">+ <p>+ The recipient is required to view the document for it to be+ completed.+ </p>+ </TooltipContent>+ </Tooltip></div></SelectItem>- <SelectItem value={RecipientRole.VIEWER}>+ <SelectItem value={RecipientRole.CC}><div className="flex items-center">- <span className="mr-2">{ROLE_ICONS[RecipientRole.VIEWER]}</span>- Viewer+ <div className="flex w-[150px] items-center">+ <span className="mr-2">{ROLE_ICONS[RecipientRole.CC]}</span>+ Receives copy+ </div>+ <Tooltip>+ <TooltipTrigger>+ <InfoIcon className="h-4 w-4" />+ </TooltipTrigger>+ <TooltipContent className="text-foreground z-9999 max-w-md p-4">+ <p>+ The recipient is not required to take any action and receives a+ copy of the document after it is completed.+ </p>+ </TooltipContent>+ </Tooltip></div></SelectItem></SelectContent>