From e19da93ce25f7d7f1190640967c4930937f98288 Mon Sep 17 00:00:00 2001 From: Catalin Pit Date: Mon, 7 Jul 2025 13:31:55 +0300 Subject: [PATCH] chore: template attachments --- .../document/document-attachment-form.tsx} | 19 +- .../template/template-attachment-form.tsx | 181 ++++++++++++++++++ .../t.$teamUrl+/documents.$id.edit.tsx | 6 +- .../t.$teamUrl+/templates.$id.edit.tsx | 2 + ...hments.ts => find-document-attachments.ts} | 10 +- .../attachment/find-template-attachments.ts | 28 +++ .../attachment/set-document-attachments.ts | 7 +- .../attachment/set-template-attachments.ts | 80 ++++++++ packages/lib/translations/de/web.po | 59 +++--- packages/lib/translations/en/web.po | 18 +- packages/lib/translations/es/web.po | 62 +++--- packages/lib/translations/fr/web.po | 59 +++--- packages/lib/translations/it/web.po | 77 ++++---- packages/lib/translations/pl/web.po | 59 +++--- packages/lib/types/document.ts | 9 - packages/lib/types/template.ts | 9 - .../trpc/server/attachment-router/router.ts | 46 ++++- .../trpc/server/attachment-router/schema.ts | 36 ++++ .../trpc/server/template-router/schema.ts | 11 -- 19 files changed, 583 insertions(+), 195 deletions(-) rename apps/remix/app/components/{forms/attachment-form.tsx => general/document/document-attachment-form.tsx} (92%) create mode 100644 apps/remix/app/components/general/template/template-attachment-form.tsx rename packages/lib/server-only/attachment/{find-attachments.ts => find-document-attachments.ts} (65%) create mode 100644 packages/lib/server-only/attachment/find-template-attachments.ts create mode 100644 packages/lib/server-only/attachment/set-template-attachments.ts diff --git a/apps/remix/app/components/forms/attachment-form.tsx b/apps/remix/app/components/general/document/document-attachment-form.tsx similarity index 92% rename from apps/remix/app/components/forms/attachment-form.tsx rename to apps/remix/app/components/general/document/document-attachment-form.tsx index 0eb8734dc..774202446 100644 --- a/apps/remix/app/components/forms/attachment-form.tsx +++ b/apps/remix/app/components/general/document/document-attachment-form.tsx @@ -4,7 +4,6 @@ import { zodResolver } from '@hookform/resolvers/zod'; import { Trash } from 'lucide-react'; import { useFieldArray, useForm } from 'react-hook-form'; -import type { TDocument } from '@documenso/lib/types/document'; import { nanoid } from '@documenso/lib/universal/id'; import { AttachmentType } from '@documenso/prisma/generated/types'; import { trpc } from '@documenso/trpc/react'; @@ -31,15 +30,15 @@ import { Input } from '@documenso/ui/primitives/input'; import { useToast } from '@documenso/ui/primitives/use-toast'; export type AttachmentFormProps = { - document: TDocument; + documentId: number; }; -export const AttachmentForm = ({ document }: AttachmentFormProps) => { +export const AttachmentForm = ({ documentId }: AttachmentFormProps) => { const { toast } = useToast(); const { data: attachmentsData, refetch: refetchAttachments } = - trpc.attachment.getAttachments.useQuery({ - documentId: document.id, + trpc.attachment.getDocumentAttachments.useQuery({ + documentId, }); const { mutateAsync: setDocumentAttachments } = @@ -57,7 +56,7 @@ export const AttachmentForm = ({ document }: AttachmentFormProps) => { const form = useForm({ resolver: zodResolver(ZSetDocumentAttachmentsSchema), defaultValues: { - documentId: document.id, + documentId, attachments: attachmentsData ?? defaultAttachments, }, }); @@ -85,7 +84,7 @@ export const AttachmentForm = ({ document }: AttachmentFormProps) => { }; useEffect(() => { - if (attachmentsData) { + if (attachmentsData && attachmentsData.length > 0) { form.setValue('attachments', attachmentsData); } }, [attachmentsData]); @@ -93,7 +92,7 @@ export const AttachmentForm = ({ document }: AttachmentFormProps) => { const onSubmit = async (data: TSetDocumentAttachmentsSchema) => { try { await setDocumentAttachments({ - documentId: document.id, + documentId, attachments: data.attachments, }); @@ -118,9 +117,7 @@ export const AttachmentForm = ({ document }: AttachmentFormProps) => { return ( - + diff --git a/apps/remix/app/components/general/template/template-attachment-form.tsx b/apps/remix/app/components/general/template/template-attachment-form.tsx new file mode 100644 index 000000000..6606284bd --- /dev/null +++ b/apps/remix/app/components/general/template/template-attachment-form.tsx @@ -0,0 +1,181 @@ +import { useEffect } from 'react'; + +import { zodResolver } from '@hookform/resolvers/zod'; +import { Trash } from 'lucide-react'; +import { useFieldArray, useForm } from 'react-hook-form'; + +import { nanoid } from '@documenso/lib/universal/id'; +import { AttachmentType } from '@documenso/prisma/generated/types'; +import { trpc } from '@documenso/trpc/react'; +import type { TSetTemplateAttachmentsSchema } from '@documenso/trpc/server/attachment-router/schema'; +import { ZSetTemplateAttachmentsSchema } from '@documenso/trpc/server/attachment-router/schema'; +import { Button } from '@documenso/ui/primitives/button'; +import { + Dialog, + DialogContent, + DialogFooter, + DialogHeader, + DialogTitle, + DialogTrigger, +} from '@documenso/ui/primitives/dialog'; +import { + Form, + FormControl, + FormField, + FormItem, + FormLabel, + FormMessage, +} from '@documenso/ui/primitives/form/form'; +import { Input } from '@documenso/ui/primitives/input'; +import { useToast } from '@documenso/ui/primitives/use-toast'; + +export type AttachmentFormProps = { + templateId: number; +}; + +export const AttachmentForm = ({ templateId }: AttachmentFormProps) => { + const { toast } = useToast(); + + const { data: attachmentsData, refetch: refetchAttachments } = + trpc.attachment.getTemplateAttachments.useQuery({ + templateId, + }); + + const { mutateAsync: setTemplateAttachments } = + trpc.attachment.setTemplateAttachments.useMutation(); + + const defaultAttachments = [ + { + id: nanoid(12), + label: '', + url: '', + type: AttachmentType.LINK, + }, + ]; + + const form = useForm({ + resolver: zodResolver(ZSetTemplateAttachmentsSchema), + defaultValues: { + templateId, + attachments: attachmentsData ?? defaultAttachments, + }, + }); + + const { + fields: attachments, + append: appendAttachment, + remove: removeAttachment, + } = useFieldArray({ + control: form.control, + name: 'attachments', + }); + + const onAddAttachment = () => { + appendAttachment({ + id: nanoid(12), + label: '', + url: '', + type: AttachmentType.LINK, + }); + }; + + const onRemoveAttachment = (index: number) => { + removeAttachment(index); + }; + + useEffect(() => { + if (attachmentsData && attachmentsData.length > 0) { + form.setValue('attachments', attachmentsData); + } + }, [attachmentsData]); + + const onSubmit = async (data: TSetTemplateAttachmentsSchema) => { + try { + await setTemplateAttachments({ + templateId, + attachments: data.attachments, + }); + + toast({ + title: 'Attachment(s) updated', + description: 'The attachment(s) have been updated successfully', + }); + + await refetchAttachments(); + } catch (error) { + console.error(error); + + toast({ + title: 'Something went wrong', + description: 'We encountered an unknown error while attempting to create the attachments.', + variant: 'destructive', + duration: 5000, + }); + } + }; + + return ( + + + + + + + Attachments + +
+ +
+ {attachments.map((attachment, index) => ( +
+ ( + + Label + + + + + + )} + /> + + ( + + URL + + + + + + )} + /> + + +
+ ))} +
+ + + + +
+ +
+
+ ); +}; diff --git a/apps/remix/app/routes/_authenticated+/t.$teamUrl+/documents.$id.edit.tsx b/apps/remix/app/routes/_authenticated+/t.$teamUrl+/documents.$id.edit.tsx index 2ac9ea7ef..f1999fa4c 100644 --- a/apps/remix/app/routes/_authenticated+/t.$teamUrl+/documents.$id.edit.tsx +++ b/apps/remix/app/routes/_authenticated+/t.$teamUrl+/documents.$id.edit.tsx @@ -11,7 +11,7 @@ import { DocumentVisibility } from '@documenso/lib/types/document-visibility'; import { isDocumentCompleted } from '@documenso/lib/utils/document'; import { formatDocumentsPath } from '@documenso/lib/utils/teams'; -import { AttachmentForm } from '~/components/forms/attachment-form'; +import { AttachmentForm } from '~/components/general/document/document-attachment-form'; import { DocumentEditForm } from '~/components/general/document/document-edit-form'; import { DocumentStatus } from '~/components/general/document/document-status'; import { LegacyFieldWarningPopover } from '~/components/general/legacy-field-warning-popover'; @@ -138,11 +138,11 @@ export default function DocumentEditPage() { {document.useLegacyFieldInsertion ? (
- +
) : (
- +
)} diff --git a/apps/remix/app/routes/_authenticated+/t.$teamUrl+/templates.$id.edit.tsx b/apps/remix/app/routes/_authenticated+/t.$teamUrl+/templates.$id.edit.tsx index e3bd0eae3..366282103 100644 --- a/apps/remix/app/routes/_authenticated+/t.$teamUrl+/templates.$id.edit.tsx +++ b/apps/remix/app/routes/_authenticated+/t.$teamUrl+/templates.$id.edit.tsx @@ -9,6 +9,7 @@ import { formatTemplatesPath } from '@documenso/lib/utils/teams'; import { TemplateDirectLinkDialogWrapper } from '~/components/dialogs/template-direct-link-dialog-wrapper'; import { LegacyFieldWarningPopover } from '~/components/general/legacy-field-warning-popover'; +import { AttachmentForm } from '~/components/general/template/template-attachment-form'; import { TemplateDirectLinkBadge } from '~/components/general/template/template-direct-link-badge'; import { TemplateEditForm } from '~/components/general/template/template-edit-form'; import { TemplateType } from '~/components/general/template/template-type'; @@ -89,6 +90,7 @@ export default function TemplateEditPage() {
+ {template.useLegacyFieldInsertion && (
diff --git a/packages/lib/server-only/attachment/find-attachments.ts b/packages/lib/server-only/attachment/find-document-attachments.ts similarity index 65% rename from packages/lib/server-only/attachment/find-attachments.ts rename to packages/lib/server-only/attachment/find-document-attachments.ts index 07a581952..98e1888f2 100644 --- a/packages/lib/server-only/attachment/find-attachments.ts +++ b/packages/lib/server-only/attachment/find-document-attachments.ts @@ -2,13 +2,17 @@ import { prisma } from '@documenso/prisma'; import { buildTeamWhereQuery } from '../../utils/teams'; -export type FindAttachmentsOptions = { - documentId: number; +export type FindDocumentAttachmentsOptions = { + documentId?: number; userId: number; teamId: number; }; -export const findAttachments = async ({ documentId, userId, teamId }: FindAttachmentsOptions) => { +export const findDocumentAttachments = async ({ + documentId, + userId, + teamId, +}: FindDocumentAttachmentsOptions) => { const attachments = await prisma.attachment.findMany({ where: { document: { diff --git a/packages/lib/server-only/attachment/find-template-attachments.ts b/packages/lib/server-only/attachment/find-template-attachments.ts new file mode 100644 index 000000000..0e784a830 --- /dev/null +++ b/packages/lib/server-only/attachment/find-template-attachments.ts @@ -0,0 +1,28 @@ +import { prisma } from '@documenso/prisma'; + +import { buildTeamWhereQuery } from '../../utils/teams'; + +export type FindTemplateAttachmentsOptions = { + templateId: number; + userId: number; + teamId: number; +}; + +export const findTemplateAttachments = async ({ + templateId, + userId, + teamId, +}: FindTemplateAttachmentsOptions) => { + const attachments = await prisma.attachment.findMany({ + where: { + template: { + id: templateId, + team: buildTeamWhereQuery({ teamId, userId }), + }, + }, + }); + + console.log('attachments', attachments); + + return attachments; +}; diff --git a/packages/lib/server-only/attachment/set-document-attachments.ts b/packages/lib/server-only/attachment/set-document-attachments.ts index 7758bc302..5caa25c61 100644 --- a/packages/lib/server-only/attachment/set-document-attachments.ts +++ b/packages/lib/server-only/attachment/set-document-attachments.ts @@ -6,14 +6,12 @@ import { AppError } from '../../errors/app-error'; import { AppErrorCode } from '../../errors/app-error'; export type CreateAttachmentsOptions = { - documentId?: number; - templateId?: number; + documentId: number; attachments: Pick[]; }; export const setDocumentAttachments = async ({ documentId, - templateId, attachments, }: CreateAttachmentsOptions) => { const document = await prisma.document.findUnique({ @@ -55,13 +53,11 @@ export const setDocumentAttachments = async ({ label: attachment.label, url: attachment.url, type: attachment.type, - templateId, }, create: { label: attachment.label, url: attachment.url, type: attachment.type, - templateId, documentId, }, }); @@ -72,7 +68,6 @@ export const setDocumentAttachments = async ({ label: attachment.label, url: attachment.url, type: attachment.type, - templateId, documentId, }, }); diff --git a/packages/lib/server-only/attachment/set-template-attachments.ts b/packages/lib/server-only/attachment/set-template-attachments.ts new file mode 100644 index 000000000..3edd0730b --- /dev/null +++ b/packages/lib/server-only/attachment/set-template-attachments.ts @@ -0,0 +1,80 @@ +import type { Attachment } from '@prisma/client'; + +import { prisma } from '@documenso/prisma'; + +import { AppError } from '../../errors/app-error'; +import { AppErrorCode } from '../../errors/app-error'; + +export type CreateAttachmentsOptions = { + templateId: number; + attachments: Pick[]; +}; + +export const setTemplateAttachments = async ({ + templateId, + attachments, +}: CreateAttachmentsOptions) => { + const template = await prisma.template.findUnique({ + where: { + id: templateId, + }, + }); + + if (!template) { + throw new AppError(AppErrorCode.NOT_FOUND, { + message: 'Template not found', + }); + } + + const existingAttachments = await prisma.attachment.findMany({ + where: { + templateId, + }, + }); + + const newIds = attachments.map((a) => a.id).filter(Boolean); + const toDelete = existingAttachments.filter((existing) => !newIds.includes(existing.id)); + + if (toDelete.length > 0) { + await prisma.attachment.deleteMany({ + where: { + id: { in: toDelete.map((a) => a.id) }, + }, + }); + } + + const upsertedAttachments: Attachment[] = []; + + for (const attachment of attachments) { + if (attachment.id) { + const updated = await prisma.attachment.upsert({ + where: { id: attachment.id }, + update: { + label: attachment.label, + url: attachment.url, + type: attachment.type, + templateId, + }, + create: { + label: attachment.label, + url: attachment.url, + type: attachment.type, + templateId, + }, + }); + upsertedAttachments.push(updated); + } else { + const created = await prisma.attachment.create({ + data: { + label: attachment.label, + url: attachment.url, + type: attachment.type, + templateId, + }, + }); + upsertedAttachments.push(created); + } + } + + return upsertedAttachments; +}; diff --git a/packages/lib/translations/de/web.po b/packages/lib/translations/de/web.po index f51768049..18b127727 100644 --- a/packages/lib/translations/de/web.po +++ b/packages/lib/translations/de/web.po @@ -297,6 +297,10 @@ msgstr "{prefix} hat das Dokument aktualisiert" msgid "{prefix} updated the document access auth requirements" msgstr "{prefix} hat die Anforderungen an die Dokumentenzugriffsautorisierung aktualisiert" +#: packages/lib/utils/document-audit-logs.ts +msgid "{prefix} updated the document attachments" +msgstr "" + #: packages/lib/utils/document-audit-logs.ts msgid "{prefix} updated the document external ID" msgstr "{prefix} hat die externe ID des Dokuments aktualisiert" @@ -313,6 +317,10 @@ msgstr "{prefix} hat den Titel des Dokuments aktualisiert" msgid "{prefix} updated the document visibility" msgstr "{prefix} hat die Sichtbarkeit des Dokuments aktualisiert" +#: packages/lib/utils/document-audit-logs.ts +msgid "{prefix} viewed the document" +msgstr "" + #: apps/remix/app/components/general/direct-template/direct-template-page.tsx msgid "{recipientActionVerb} document" msgstr "{recipientActionVerb} Dokument" @@ -1427,6 +1435,10 @@ msgstr "Unterstützend" msgid "At least one signature type must be enabled" msgstr "Mindestens ein Signaturtyp muss aktiviert sein" +#: apps/remix/app/components/general/document-signing/document-signing-form.tsx +msgid "Attachments" +msgstr "" + #: apps/remix/app/routes/_authenticated+/admin+/documents.$id.tsx msgid "Attempts sealing the document again, useful for after a code change has occurred to resolve an erroneous document." msgstr "Versuche, das Dokument erneut zu versiegeln, nützlich nach einer Codeänderung, um ein fehlerhaftes Dokument zu beheben." @@ -1767,7 +1779,6 @@ msgstr "Klicken Sie hier, um zu beginnen" #: apps/remix/app/components/tables/settings-public-profile-templates-table.tsx #: apps/remix/app/components/general/template/template-page-view-recent-activity.tsx #: apps/remix/app/components/general/document/document-page-view-recent-activity.tsx -#: apps/remix/app/components/general/document/document-history-sheet.tsx msgid "Click here to retry" msgstr "Klicken Sie hier, um es erneut zu versuchen" @@ -2665,6 +2676,10 @@ msgstr "Dokument Alle" msgid "Document Approved" msgstr "Dokument genehmigt" +#: packages/lib/utils/document-audit-logs.ts +msgid "Document attachments updated" +msgstr "" + #: apps/remix/app/routes/_recipient+/sign.$token+/_index.tsx #: packages/lib/server-only/document/super-delete-document.ts #: packages/lib/server-only/document/delete-document.ts @@ -2749,11 +2764,6 @@ msgstr "Externe ID des Dokuments aktualisiert" msgid "Document found in your account" msgstr "Dokument in Ihrem Konto gefunden" -#: apps/remix/app/routes/_authenticated+/t.$teamUrl+/documents.$id._index.tsx -#: apps/remix/app/components/general/document/document-history-sheet.tsx -msgid "Document history" -msgstr "Dokumentverlauf" - #: apps/remix/app/routes/_internal+/[__htmltopdf]+/audit-log.tsx #: apps/remix/app/routes/_authenticated+/t.$teamUrl+/documents.$id.logs.tsx msgid "Document ID" @@ -2872,6 +2882,10 @@ msgstr "Dokumenten-Upload deaktiviert aufgrund unbezahlter Rechnungen" msgid "Document uploaded" msgstr "Dokument hochgeladen" +#: packages/lib/utils/document-audit-logs.ts +msgid "Document viewed" +msgstr "" + #: apps/remix/app/routes/_recipient+/sign.$token+/complete.tsx msgid "Document Viewed" msgstr "Dokument angesehen" @@ -3712,10 +3726,6 @@ msgstr "Hallo, {userName} <0>({userEmail})" msgid "Hide" msgstr "Ausblenden" -#: apps/remix/app/components/general/document/document-history-sheet.tsx -msgid "Hide additional information" -msgstr "Zusätzliche Informationen ausblenden" - #: apps/remix/app/components/general/generic-error-layout.tsx #: apps/remix/app/components/general/folder/folder-grid.tsx #: apps/remix/app/components/dialogs/folder-move-dialog.tsx @@ -5814,10 +5824,6 @@ msgstr "Teilen Sie Ihre Unterzeichnungserfahrung!" msgid "Show" msgstr "Anzeigen" -#: apps/remix/app/components/general/document/document-history-sheet.tsx -msgid "Show additional information" -msgstr "Zusätzliche Informationen anzeigen" - #: packages/ui/primitives/template-flow/add-template-placeholder-recipients.tsx #: packages/ui/primitives/document-flow/add-signers.tsx msgid "Show advanced settings" @@ -6633,7 +6639,8 @@ msgid "The following team has been deleted. You will no longer be able to access msgstr "Das folgende Team wurde gelöscht. Sie können nicht mehr auf dieses Team und seine Dokumente zugreifen." #: apps/remix/app/routes/_authenticated+/o.$orgUrl.settings.groups.$id.tsx -msgid "The organisation group you are looking for may have been removed, renamed or may have never\n" +msgid "" +"The organisation group you are looking for may have been removed, renamed or may have never\n" " existed." msgstr "Die Organisationsgruppe, nach der Sie suchen, wurde möglicherweise entfernt, umbenannt oder hat möglicherweise nie existiert." @@ -6642,12 +6649,14 @@ msgid "The organisation role that will be applied to all members in this group." msgstr "Die Organisationsrolle, die auf alle Mitglieder in dieser Gruppe angewendet wird." #: apps/remix/app/routes/_authenticated+/admin+/organisations.$id.tsx -msgid "The organisation you are looking for may have been removed, renamed or may have never\n" +msgid "" +"The organisation you are looking for may have been removed, renamed or may have never\n" " existed." msgstr "Die Organisation, nach der Sie suchen, wurde möglicherweise entfernt, umbenannt oder hat möglicherweise nie existiert." #: apps/remix/app/routes/_authenticated+/_layout.tsx -msgid "The organisation you are looking for may have been removed, renamed or may have never\n" +msgid "" +"The organisation you are looking for may have been removed, renamed or may have never\n" " existed." msgstr "Die Organisation, nach der Sie suchen, wurde möglicherweise entfernt, umbenannt oder hat möglicherweise nie existiert." @@ -6731,12 +6740,14 @@ msgid "The team email <0>{teamEmail} has been removed from the following tea msgstr "Die Team-E-Mail <0>{teamEmail} wurde aus dem folgenden Team entfernt" #: apps/remix/app/routes/_authenticated+/_layout.tsx -msgid "The team you are looking for may have been removed, renamed or may have never\n" +msgid "" +"The team you are looking for may have been removed, renamed or may have never\n" " existed." msgstr "Das Team, das Sie suchen, wurde möglicherweise entfernt, umbenannt oder hat möglicherweise nie existiert." #: apps/remix/app/routes/_authenticated+/t.$teamUrl+/_layout.tsx -msgid "The team you are looking for may have been removed, renamed or may have never\n" +msgid "" +"The team you are looking for may have been removed, renamed or may have never\n" " existed." msgstr "Das Team, das Sie suchen, könnte entfernt, umbenannt oder nie existiert haben." @@ -6774,7 +6785,8 @@ msgid "The URL for Documenso to send webhook events to." msgstr "Die URL für Documenso, um Webhook-Ereignisse zu senden." #: apps/remix/app/routes/_authenticated+/admin+/users.$id.tsx -msgid "The user you are looking for may have been removed, renamed or may have never\n" +msgid "" +"The user you are looking for may have been removed, renamed or may have never\n" " existed." msgstr "Der Benutzer, nach dem Sie suchen, wurde möglicherweise entfernt, umbenannt oder hat möglicherweise nie existiert." @@ -7241,7 +7253,6 @@ msgid "Unable to join this organisation at this time." msgstr "Zurzeit kann dieser Organisation nicht beigetreten werden." #: apps/remix/app/components/general/document/document-page-view-recent-activity.tsx -#: apps/remix/app/components/general/document/document-history-sheet.tsx msgid "Unable to load document history" msgstr "Kann den Dokumentverlauf nicht laden" @@ -8010,11 +8021,8 @@ msgstr "Wir konnten Ihre E-Mail derzeit nicht verifizieren." msgid "We were unable to verify your email. If your email is not verified already, please try again." msgstr "Wir konnten Ihre E-Mail nicht bestätigen. Wenn Ihre E-Mail noch nicht bestätigt wurde, versuchen Sie es bitte erneut." -#: packages/ui/primitives/document-flow/add-subject.tsx -msgid "We will generate signing links for with you, which you can send to the recipients through your method of choice." -msgstr "Wir generieren Signierlinks mit Ihnen, die Sie den Empfängern über Ihre bevorzugte Methode senden können." - #: apps/remix/app/components/dialogs/template-use-dialog.tsx +#: packages/ui/primitives/document-flow/add-subject.tsx msgid "We will generate signing links for you, which you can send to the recipients through your method of choice." msgstr "Wir werden Unterzeichnungslinks für Sie erstellen, die Sie an die Empfänger über Ihre bevorzugte Methode senden können." @@ -8728,4 +8736,3 @@ msgstr "Ihr Token wurde erfolgreich erstellt! Stellen Sie sicher, dass Sie es ko #: apps/remix/app/routes/_authenticated+/t.$teamUrl+/settings.tokens.tsx msgid "Your tokens will be shown here once you create them." msgstr "Ihre Tokens werden hier angezeigt, sobald Sie sie erstellt haben." - diff --git a/packages/lib/translations/en/web.po b/packages/lib/translations/en/web.po index a1994ef0e..01a0eed30 100644 --- a/packages/lib/translations/en/web.po +++ b/packages/lib/translations/en/web.po @@ -292,6 +292,10 @@ msgstr "{prefix} updated the document" msgid "{prefix} updated the document access auth requirements" msgstr "{prefix} updated the document access auth requirements" +#: packages/lib/utils/document-audit-logs.ts +msgid "{prefix} updated the document attachments" +msgstr "{prefix} updated the document attachments" + #: packages/lib/utils/document-audit-logs.ts msgid "{prefix} updated the document external ID" msgstr "{prefix} updated the document external ID" @@ -1426,6 +1430,10 @@ msgstr "Assisting" msgid "At least one signature type must be enabled" msgstr "At least one signature type must be enabled" +#: apps/remix/app/components/general/document-signing/document-signing-form.tsx +msgid "Attachments" +msgstr "Attachments" + #: apps/remix/app/routes/_authenticated+/admin+/documents.$id.tsx msgid "Attempts sealing the document again, useful for after a code change has occurred to resolve an erroneous document." msgstr "Attempts sealing the document again, useful for after a code change has occurred to resolve an erroneous document." @@ -2663,6 +2671,10 @@ msgstr "Document All" msgid "Document Approved" msgstr "Document Approved" +#: packages/lib/utils/document-audit-logs.ts +msgid "Document attachments updated" +msgstr "Document attachments updated" + #: apps/remix/app/routes/_recipient+/sign.$token+/_index.tsx #: packages/lib/server-only/document/super-delete-document.ts #: packages/lib/server-only/document/delete-document.ts @@ -4132,10 +4144,10 @@ msgstr "Manage subscription" msgid "Manage the {0} organisation" msgstr "Manage the {0} organisation" -#. placeholder {1}: organisation.name +#. placeholder {0}: organisation.name #: apps/remix/app/routes/_authenticated+/admin+/organisations.$id.tsx -msgid "Manage the {1} organisation subscription" -msgstr "Manage the {1} organisation subscription" +msgid "Manage the {0} organisation subscription" +msgstr "Manage the {0} organisation subscription" #: apps/remix/app/routes/_authenticated+/o.$orgUrl.settings.groups._index.tsx msgid "Manage the custom groups of members for your organisation." diff --git a/packages/lib/translations/es/web.po b/packages/lib/translations/es/web.po index 43c1321cc..6f86ace66 100644 --- a/packages/lib/translations/es/web.po +++ b/packages/lib/translations/es/web.po @@ -297,6 +297,10 @@ msgstr "{prefix} actualizó el documento" msgid "{prefix} updated the document access auth requirements" msgstr "{prefix} actualizó los requisitos de autorización de acceso al documento" +#: packages/lib/utils/document-audit-logs.ts +msgid "{prefix} updated the document attachments" +msgstr "" + #: packages/lib/utils/document-audit-logs.ts msgid "{prefix} updated the document external ID" msgstr "{prefix} actualizó el ID externo del documento" @@ -313,6 +317,10 @@ msgstr "{prefix} actualizó el título del documento" msgid "{prefix} updated the document visibility" msgstr "{prefix} actualizó la visibilidad del documento" +#: packages/lib/utils/document-audit-logs.ts +msgid "{prefix} viewed the document" +msgstr "" + #: apps/remix/app/components/general/direct-template/direct-template-page.tsx msgid "{recipientActionVerb} document" msgstr "{recipientActionVerb} documento" @@ -1427,6 +1435,10 @@ msgstr "Asistiendo" msgid "At least one signature type must be enabled" msgstr "Al menos un tipo de firma debe estar habilitado" +#: apps/remix/app/components/general/document-signing/document-signing-form.tsx +msgid "Attachments" +msgstr "" + #: apps/remix/app/routes/_authenticated+/admin+/documents.$id.tsx msgid "Attempts sealing the document again, useful for after a code change has occurred to resolve an erroneous document." msgstr "Intenta sellar el documento de nuevo, útil después de que se haya producido un cambio de código para resolver un documento erróneo." @@ -1767,7 +1779,6 @@ msgstr "Haga clic aquí para comenzar" #: apps/remix/app/components/tables/settings-public-profile-templates-table.tsx #: apps/remix/app/components/general/template/template-page-view-recent-activity.tsx #: apps/remix/app/components/general/document/document-page-view-recent-activity.tsx -#: apps/remix/app/components/general/document/document-history-sheet.tsx msgid "Click here to retry" msgstr "Haga clic aquí para reintentar" @@ -2665,6 +2676,10 @@ msgstr "Documentar Todo" msgid "Document Approved" msgstr "Documento Aprobado" +#: packages/lib/utils/document-audit-logs.ts +msgid "Document attachments updated" +msgstr "" + #: apps/remix/app/routes/_recipient+/sign.$token+/_index.tsx #: packages/lib/server-only/document/super-delete-document.ts #: packages/lib/server-only/document/delete-document.ts @@ -2749,11 +2764,6 @@ msgstr "ID externo del documento actualizado" msgid "Document found in your account" msgstr "Documento encontrado en tu cuenta" -#: apps/remix/app/routes/_authenticated+/t.$teamUrl+/documents.$id._index.tsx -#: apps/remix/app/components/general/document/document-history-sheet.tsx -msgid "Document history" -msgstr "Historial de documentos" - #: apps/remix/app/routes/_internal+/[__htmltopdf]+/audit-log.tsx #: apps/remix/app/routes/_authenticated+/t.$teamUrl+/documents.$id.logs.tsx msgid "Document ID" @@ -2872,6 +2882,10 @@ msgstr "La carga de documentos está deshabilitada debido a facturas impagadas" msgid "Document uploaded" msgstr "Documento subido" +#: packages/lib/utils/document-audit-logs.ts +msgid "Document viewed" +msgstr "" + #: apps/remix/app/routes/_recipient+/sign.$token+/complete.tsx msgid "Document Viewed" msgstr "Documento visto" @@ -3712,10 +3726,6 @@ msgstr "Hola, {userName} <0>({userEmail})" msgid "Hide" msgstr "Ocultar" -#: apps/remix/app/components/general/document/document-history-sheet.tsx -msgid "Hide additional information" -msgstr "Ocultar información adicional" - #: apps/remix/app/components/general/generic-error-layout.tsx #: apps/remix/app/components/general/folder/folder-grid.tsx #: apps/remix/app/components/dialogs/folder-move-dialog.tsx @@ -5814,10 +5824,6 @@ msgstr "¡Comparte tu experiencia de firma!" msgid "Show" msgstr "Mostrar" -#: apps/remix/app/components/general/document/document-history-sheet.tsx -msgid "Show additional information" -msgstr "Mostrar información adicional" - #: packages/ui/primitives/template-flow/add-template-placeholder-recipients.tsx #: packages/ui/primitives/document-flow/add-signers.tsx msgid "Show advanced settings" @@ -6633,7 +6639,8 @@ msgid "The following team has been deleted. You will no longer be able to access msgstr "El siguiente equipo ha sido eliminado. Ya no podrá acceder a este equipo y sus documentos" #: apps/remix/app/routes/_authenticated+/o.$orgUrl.settings.groups.$id.tsx -msgid "The organisation group you are looking for may have been removed, renamed or may have never\n" +msgid "" +"The organisation group you are looking for may have been removed, renamed or may have never\n" " existed." msgstr "El grupo de organización que está buscando puede haber sido eliminado, renombrado o puede que nunca haya existido." @@ -6642,12 +6649,14 @@ msgid "The organisation role that will be applied to all members in this group." msgstr "El rol de organización que se aplicará a todos los miembros de este grupo." #: apps/remix/app/routes/_authenticated+/admin+/organisations.$id.tsx -msgid "The organisation you are looking for may have been removed, renamed or may have never\n" +msgid "" +"The organisation you are looking for may have been removed, renamed or may have never\n" " existed." msgstr "La organización que está buscando puede haber sido eliminada, renombrada o puede que nunca haya existido." #: apps/remix/app/routes/_authenticated+/_layout.tsx -msgid "The organisation you are looking for may have been removed, renamed or may have never\n" +msgid "" +"The organisation you are looking for may have been removed, renamed or may have never\n" " existed." msgstr "La organización que está buscando puede haber sido eliminada, renombrada o puede que nunca haya existido." @@ -6731,14 +6740,17 @@ msgid "The team email <0>{teamEmail} has been removed from the following tea msgstr "El correo electrónico del equipo <0>{teamEmail} ha sido eliminado del siguiente equipo" #: apps/remix/app/routes/_authenticated+/_layout.tsx -msgid "The team you are looking for may have been removed, renamed or may have never\n" +msgid "" +"The team you are looking for may have been removed, renamed or may have never\n" " existed." msgstr "El equipo que está buscando puede haber sido eliminado, renombrado o puede que nunca haya existido." #: apps/remix/app/routes/_authenticated+/t.$teamUrl+/_layout.tsx -msgid "The team you are looking for may have been removed, renamed or may have never\n" +msgid "" +"The team you are looking for may have been removed, renamed or may have never\n" " existed." -msgstr "El equipo que buscas puede haber sido eliminado, renombrado o quizás nunca\n" +msgstr "" +"El equipo que buscas puede haber sido eliminado, renombrado o quizás nunca\n" " existió." #: apps/remix/app/components/dialogs/template-move-to-folder-dialog.tsx @@ -6775,7 +6787,8 @@ msgid "The URL for Documenso to send webhook events to." msgstr "La URL para Documenso para enviar eventos de webhook." #: apps/remix/app/routes/_authenticated+/admin+/users.$id.tsx -msgid "The user you are looking for may have been removed, renamed or may have never\n" +msgid "" +"The user you are looking for may have been removed, renamed or may have never\n" " existed." msgstr "El usuario que está buscando puede haber sido eliminado, renombrado o puede que nunca haya existido." @@ -7242,7 +7255,6 @@ msgid "Unable to join this organisation at this time." msgstr "No se puede unirse a esta organización en este momento." #: apps/remix/app/components/general/document/document-page-view-recent-activity.tsx -#: apps/remix/app/components/general/document/document-history-sheet.tsx msgid "Unable to load document history" msgstr "No se pudo cargar el historial del documento" @@ -8011,11 +8023,8 @@ msgstr "No pudimos verificar tu correo electrónico en este momento." msgid "We were unable to verify your email. If your email is not verified already, please try again." msgstr "No pudimos verificar tu correo electrónico. Si tu correo electrónico no está verificado ya, por favor inténtalo de nuevo." -#: packages/ui/primitives/document-flow/add-subject.tsx -msgid "We will generate signing links for with you, which you can send to the recipients through your method of choice." -msgstr "Generaremos enlaces de firma para ti, que podrás enviar a los destinatarios a través de tu método preferido." - #: apps/remix/app/components/dialogs/template-use-dialog.tsx +#: packages/ui/primitives/document-flow/add-subject.tsx msgid "We will generate signing links for you, which you can send to the recipients through your method of choice." msgstr "Generaremos enlaces de firma para ti, que podrás enviar a los destinatarios a través de tu método preferido." @@ -8729,4 +8738,3 @@ msgstr "¡Tu token se creó con éxito! ¡Asegúrate de copiarlo porque no podr #: apps/remix/app/routes/_authenticated+/t.$teamUrl+/settings.tokens.tsx msgid "Your tokens will be shown here once you create them." msgstr "Tus tokens se mostrarán aquí una vez que los crees." - diff --git a/packages/lib/translations/fr/web.po b/packages/lib/translations/fr/web.po index 93f70462e..6db3b47ed 100644 --- a/packages/lib/translations/fr/web.po +++ b/packages/lib/translations/fr/web.po @@ -297,6 +297,10 @@ msgstr "{prefix} a mis à jour le document" msgid "{prefix} updated the document access auth requirements" msgstr "{prefix} a mis à jour les exigences d'authentification d'accès au document" +#: packages/lib/utils/document-audit-logs.ts +msgid "{prefix} updated the document attachments" +msgstr "" + #: packages/lib/utils/document-audit-logs.ts msgid "{prefix} updated the document external ID" msgstr "{prefix} a mis à jour l'ID externe du document" @@ -313,6 +317,10 @@ msgstr "{prefix} a mis à jour le titre du document" msgid "{prefix} updated the document visibility" msgstr "{prefix} a mis à jour la visibilité du document" +#: packages/lib/utils/document-audit-logs.ts +msgid "{prefix} viewed the document" +msgstr "" + #: apps/remix/app/components/general/direct-template/direct-template-page.tsx msgid "{recipientActionVerb} document" msgstr "{recipientActionVerb} document" @@ -1427,6 +1435,10 @@ msgstr "En assistance" msgid "At least one signature type must be enabled" msgstr "Au moins un type de signature doit être activé" +#: apps/remix/app/components/general/document-signing/document-signing-form.tsx +msgid "Attachments" +msgstr "" + #: apps/remix/app/routes/_authenticated+/admin+/documents.$id.tsx msgid "Attempts sealing the document again, useful for after a code change has occurred to resolve an erroneous document." msgstr "Essaye de sceller le document à nouveau, utile après qu'un changement de code ait eu lieu pour résoudre un document erroné." @@ -1767,7 +1779,6 @@ msgstr "Cliquez ici pour commencer" #: apps/remix/app/components/tables/settings-public-profile-templates-table.tsx #: apps/remix/app/components/general/template/template-page-view-recent-activity.tsx #: apps/remix/app/components/general/document/document-page-view-recent-activity.tsx -#: apps/remix/app/components/general/document/document-history-sheet.tsx msgid "Click here to retry" msgstr "Cliquez ici pour réessayer" @@ -2665,6 +2676,10 @@ msgstr "Document Tout" msgid "Document Approved" msgstr "Document Approuvé" +#: packages/lib/utils/document-audit-logs.ts +msgid "Document attachments updated" +msgstr "" + #: apps/remix/app/routes/_recipient+/sign.$token+/_index.tsx #: packages/lib/server-only/document/super-delete-document.ts #: packages/lib/server-only/document/delete-document.ts @@ -2749,11 +2764,6 @@ msgstr "ID externe du document mis à jour" msgid "Document found in your account" msgstr "Document trouvé dans votre compte" -#: apps/remix/app/routes/_authenticated+/t.$teamUrl+/documents.$id._index.tsx -#: apps/remix/app/components/general/document/document-history-sheet.tsx -msgid "Document history" -msgstr "Historique du document" - #: apps/remix/app/routes/_internal+/[__htmltopdf]+/audit-log.tsx #: apps/remix/app/routes/_authenticated+/t.$teamUrl+/documents.$id.logs.tsx msgid "Document ID" @@ -2872,6 +2882,10 @@ msgstr "Importation de documents désactivé en raison de factures impayées" msgid "Document uploaded" msgstr "Document importé" +#: packages/lib/utils/document-audit-logs.ts +msgid "Document viewed" +msgstr "" + #: apps/remix/app/routes/_recipient+/sign.$token+/complete.tsx msgid "Document Viewed" msgstr "Document consulté" @@ -3712,10 +3726,6 @@ msgstr "Bonjour, {userName} <0>({userEmail})" msgid "Hide" msgstr "Cacher" -#: apps/remix/app/components/general/document/document-history-sheet.tsx -msgid "Hide additional information" -msgstr "Cacher des informations supplémentaires" - #: apps/remix/app/components/general/generic-error-layout.tsx #: apps/remix/app/components/general/folder/folder-grid.tsx #: apps/remix/app/components/dialogs/folder-move-dialog.tsx @@ -5814,10 +5824,6 @@ msgstr "Partagez votre expérience de signature !" msgid "Show" msgstr "Afficher" -#: apps/remix/app/components/general/document/document-history-sheet.tsx -msgid "Show additional information" -msgstr "Afficher des informations supplémentaires" - #: packages/ui/primitives/template-flow/add-template-placeholder-recipients.tsx #: packages/ui/primitives/document-flow/add-signers.tsx msgid "Show advanced settings" @@ -6633,7 +6639,8 @@ msgid "The following team has been deleted. You will no longer be able to access msgstr "L'équipe suivante a été supprimée. Vous ne pourrez plus accéder à cette équipe et à ses documents" #: apps/remix/app/routes/_authenticated+/o.$orgUrl.settings.groups.$id.tsx -msgid "The organisation group you are looking for may have been removed, renamed or may have never\n" +msgid "" +"The organisation group you are looking for may have been removed, renamed or may have never\n" " existed." msgstr "Le groupe d'organisation que vous cherchez peut avoir été supprimé, renommé ou n'a peut-être jamais existé." @@ -6642,12 +6649,14 @@ msgid "The organisation role that will be applied to all members in this group." msgstr "Le rôle d'organisation qui sera appliqué à tous les membres de ce groupe." #: apps/remix/app/routes/_authenticated+/admin+/organisations.$id.tsx -msgid "The organisation you are looking for may have been removed, renamed or may have never\n" +msgid "" +"The organisation you are looking for may have been removed, renamed or may have never\n" " existed." msgstr "L'organisation que vous cherchez peut avoir été supprimée, renommée ou n'a peut-être jamais existé." #: apps/remix/app/routes/_authenticated+/_layout.tsx -msgid "The organisation you are looking for may have been removed, renamed or may have never\n" +msgid "" +"The organisation you are looking for may have been removed, renamed or may have never\n" " existed." msgstr "L'organisation que vous cherchez peut avoir été supprimée, renommée ou n'a peut-être jamais existé." @@ -6731,12 +6740,14 @@ msgid "The team email <0>{teamEmail} has been removed from the following tea msgstr "L'email d'équipe <0>{teamEmail} a été supprimé de l'équipe suivante" #: apps/remix/app/routes/_authenticated+/_layout.tsx -msgid "The team you are looking for may have been removed, renamed or may have never\n" +msgid "" +"The team you are looking for may have been removed, renamed or may have never\n" " existed." msgstr "L'équipe que vous cherchez peut avoir été supprimée, renommée ou n'a peut-être jamais existé." #: apps/remix/app/routes/_authenticated+/t.$teamUrl+/_layout.tsx -msgid "The team you are looking for may have been removed, renamed or may have never\n" +msgid "" +"The team you are looking for may have been removed, renamed or may have never\n" " existed." msgstr "L'équipe que vous cherchez a peut-être été supprimée, renommée ou n'a peut-être jamais existé." @@ -6774,7 +6785,8 @@ msgid "The URL for Documenso to send webhook events to." msgstr "L'URL pour Documenso pour envoyer des événements webhook." #: apps/remix/app/routes/_authenticated+/admin+/users.$id.tsx -msgid "The user you are looking for may have been removed, renamed or may have never\n" +msgid "" +"The user you are looking for may have been removed, renamed or may have never\n" " existed." msgstr "L'utilisateur que vous cherchez peut avoir été supprimé, renommé ou n'a peut-être jamais existé." @@ -7241,7 +7253,6 @@ msgid "Unable to join this organisation at this time." msgstr "Impossible de rejoindre cette organisation pour le moment." #: apps/remix/app/components/general/document/document-page-view-recent-activity.tsx -#: apps/remix/app/components/general/document/document-history-sheet.tsx msgid "Unable to load document history" msgstr "Impossible de charger l'historique des documents" @@ -8010,11 +8021,8 @@ msgstr "Nous n'avons pas pu vérifier votre email pour le moment." msgid "We were unable to verify your email. If your email is not verified already, please try again." msgstr "Nous n'avons pas pu vérifier votre e-mail. Si votre e-mail n'est pas déjà vérifié, veuillez réessayer." -#: packages/ui/primitives/document-flow/add-subject.tsx -msgid "We will generate signing links for with you, which you can send to the recipients through your method of choice." -msgstr "Nous générerons des liens de signature pour vous, que vous pourrez envoyer aux destinataires par votre méthode de choix." - #: apps/remix/app/components/dialogs/template-use-dialog.tsx +#: packages/ui/primitives/document-flow/add-subject.tsx msgid "We will generate signing links for you, which you can send to the recipients through your method of choice." msgstr "Nous allons générer des liens de signature pour vous, que vous pouvez envoyer aux destinataires par votre méthode de choix." @@ -8728,4 +8736,3 @@ msgstr "Votre token a été créé avec succès ! Assurez-vous de le copier car #: apps/remix/app/routes/_authenticated+/t.$teamUrl+/settings.tokens.tsx msgid "Your tokens will be shown here once you create them." msgstr "Vos tokens seront affichés ici une fois que vous les aurez créés." - diff --git a/packages/lib/translations/it/web.po b/packages/lib/translations/it/web.po index 97738127a..f78b1c798 100644 --- a/packages/lib/translations/it/web.po +++ b/packages/lib/translations/it/web.po @@ -297,6 +297,10 @@ msgstr "{prefix} ha aggiornato il documento" msgid "{prefix} updated the document access auth requirements" msgstr "{prefix} ha aggiornato i requisiti di autenticazione per l'accesso al documento" +#: packages/lib/utils/document-audit-logs.ts +msgid "{prefix} updated the document attachments" +msgstr "" + #: packages/lib/utils/document-audit-logs.ts msgid "{prefix} updated the document external ID" msgstr "{prefix} ha aggiornato l'ID esterno del documento" @@ -313,6 +317,10 @@ msgstr "{prefix} ha aggiornato il titolo del documento" msgid "{prefix} updated the document visibility" msgstr "{prefix} ha aggiornato la visibilità del documento" +#: packages/lib/utils/document-audit-logs.ts +msgid "{prefix} viewed the document" +msgstr "" + #: apps/remix/app/components/general/direct-template/direct-template-page.tsx msgid "{recipientActionVerb} document" msgstr "{recipientActionVerb} documento" @@ -1427,6 +1435,10 @@ msgstr "Assistenza in corso" msgid "At least one signature type must be enabled" msgstr "Deve essere abilitato almeno un tipo di firma" +#: apps/remix/app/components/general/document-signing/document-signing-form.tsx +msgid "Attachments" +msgstr "" + #: apps/remix/app/routes/_authenticated+/admin+/documents.$id.tsx msgid "Attempts sealing the document again, useful for after a code change has occurred to resolve an erroneous document." msgstr "Tenta nuovamente di sigillare il documento, utile dopo una modifica al codice per risolvere un documento errato." @@ -1767,7 +1779,6 @@ msgstr "Clicca qui per iniziare" #: apps/remix/app/components/tables/settings-public-profile-templates-table.tsx #: apps/remix/app/components/general/template/template-page-view-recent-activity.tsx #: apps/remix/app/components/general/document/document-page-view-recent-activity.tsx -#: apps/remix/app/components/general/document/document-history-sheet.tsx msgid "Click here to retry" msgstr "Clicca qui per riprovare" @@ -2665,6 +2676,10 @@ msgstr "Documenta Tutto" msgid "Document Approved" msgstr "Documento Approvato" +#: packages/lib/utils/document-audit-logs.ts +msgid "Document attachments updated" +msgstr "" + #: apps/remix/app/routes/_recipient+/sign.$token+/_index.tsx #: packages/lib/server-only/document/super-delete-document.ts #: packages/lib/server-only/document/delete-document.ts @@ -2749,11 +2764,6 @@ msgstr "ID esterno del documento aggiornato" msgid "Document found in your account" msgstr "Documento trovato nel tuo account" -#: apps/remix/app/routes/_authenticated+/t.$teamUrl+/documents.$id._index.tsx -#: apps/remix/app/components/general/document/document-history-sheet.tsx -msgid "Document history" -msgstr "Cronologia del documento" - #: apps/remix/app/routes/_internal+/[__htmltopdf]+/audit-log.tsx #: apps/remix/app/routes/_authenticated+/t.$teamUrl+/documents.$id.logs.tsx msgid "Document ID" @@ -2872,6 +2882,10 @@ msgstr "Caricamento del documento disabilitato a causa di fatture non pagate" msgid "Document uploaded" msgstr "Documento caricato" +#: packages/lib/utils/document-audit-logs.ts +msgid "Document viewed" +msgstr "" + #: apps/remix/app/routes/_recipient+/sign.$token+/complete.tsx msgid "Document Viewed" msgstr "Documento visualizzato" @@ -3712,10 +3726,6 @@ msgstr "Ciao, {userName} <0>({userEmail})" msgid "Hide" msgstr "Nascondi" -#: apps/remix/app/components/general/document/document-history-sheet.tsx -msgid "Hide additional information" -msgstr "Nascondi informazioni aggiuntive" - #: apps/remix/app/components/general/generic-error-layout.tsx #: apps/remix/app/components/general/folder/folder-grid.tsx #: apps/remix/app/components/dialogs/folder-move-dialog.tsx @@ -5814,10 +5824,6 @@ msgstr "Condividi la tua esperienza di firma!" msgid "Show" msgstr "Mostra" -#: apps/remix/app/components/general/document/document-history-sheet.tsx -msgid "Show additional information" -msgstr "Mostra informazioni aggiuntive" - #: packages/ui/primitives/template-flow/add-template-placeholder-recipients.tsx #: packages/ui/primitives/document-flow/add-signers.tsx msgid "Show advanced settings" @@ -6633,9 +6639,11 @@ msgid "The following team has been deleted. You will no longer be able to access msgstr "Il seguente team è stato eliminato. Non potrai più accedere a questo team e ai suoi documenti" #: apps/remix/app/routes/_authenticated+/o.$orgUrl.settings.groups.$id.tsx -msgid "The organisation group you are looking for may have been removed, renamed or may have never\n" +msgid "" +"The organisation group you are looking for may have been removed, renamed or may have never\n" " existed." -msgstr "Il gruppo organizzativo che cerchi potrebbe essere stato rimosso, rinominato o potrebbe non essere mai\n" +msgstr "" +"Il gruppo organizzativo che cerchi potrebbe essere stato rimosso, rinominato o potrebbe non essere mai\n" " esistito." #: apps/remix/app/routes/_authenticated+/o.$orgUrl.settings.groups.$id.tsx @@ -6643,15 +6651,19 @@ msgid "The organisation role that will be applied to all members in this group." msgstr "Il ruolo organizzativo che verrà applicato a tutti i membri in questo gruppo." #: apps/remix/app/routes/_authenticated+/admin+/organisations.$id.tsx -msgid "The organisation you are looking for may have been removed, renamed or may have never\n" +msgid "" +"The organisation you are looking for may have been removed, renamed or may have never\n" " existed." -msgstr "L'organizzazione che cerchi potrebbe essere stata rimossa, rinominata o potrebbe non essere mai\n" +msgstr "" +"L'organizzazione che cerchi potrebbe essere stata rimossa, rinominata o potrebbe non essere mai\n" " esistita." #: apps/remix/app/routes/_authenticated+/_layout.tsx -msgid "The organisation you are looking for may have been removed, renamed or may have never\n" +msgid "" +"The organisation you are looking for may have been removed, renamed or may have never\n" " existed." -msgstr "L'organizzazione che cerchi potrebbe essere stata rimossa, rinominata o potrebbe non essere mai\n" +msgstr "" +"L'organizzazione che cerchi potrebbe essere stata rimossa, rinominata o potrebbe non essere mai\n" " esistita." #: apps/remix/app/components/general/generic-error-layout.tsx @@ -6734,15 +6746,19 @@ msgid "The team email <0>{teamEmail} has been removed from the following tea msgstr "L'email del team <0>{teamEmail} è stata rimossa dal seguente team" #: apps/remix/app/routes/_authenticated+/_layout.tsx -msgid "The team you are looking for may have been removed, renamed or may have never\n" +msgid "" +"The team you are looking for may have been removed, renamed or may have never\n" " existed." -msgstr "Il team che cerchi potrebbe essere stato rimosso, rinominato o potrebbe non essere mai\n" +msgstr "" +"Il team che cerchi potrebbe essere stato rimosso, rinominato o potrebbe non essere mai\n" " esistito." #: apps/remix/app/routes/_authenticated+/t.$teamUrl+/_layout.tsx -msgid "The team you are looking for may have been removed, renamed or may have never\n" +msgid "" +"The team you are looking for may have been removed, renamed or may have never\n" " existed." -msgstr "La squadra che stai cercando potrebbe essere stata rimossa, rinominata o potrebbe non essere mai\n" +msgstr "" +"La squadra che stai cercando potrebbe essere stata rimossa, rinominata o potrebbe non essere mai\n" " esistita." #: apps/remix/app/components/dialogs/template-move-to-folder-dialog.tsx @@ -6779,9 +6795,11 @@ msgid "The URL for Documenso to send webhook events to." msgstr "L'URL per Documenso per inviare eventi webhook." #: apps/remix/app/routes/_authenticated+/admin+/users.$id.tsx -msgid "The user you are looking for may have been removed, renamed or may have never\n" +msgid "" +"The user you are looking for may have been removed, renamed or may have never\n" " existed." -msgstr "L'utente che cerchi potrebbe essere stato rimosso, rinominato o potrebbe non essere mai\n" +msgstr "" +"L'utente che cerchi potrebbe essere stato rimosso, rinominato o potrebbe non essere mai\n" " esistito." #: apps/remix/app/components/dialogs/webhook-delete-dialog.tsx @@ -7247,7 +7265,6 @@ msgid "Unable to join this organisation at this time." msgstr "Impossibile unirsi a questa organizzazione in questo momento." #: apps/remix/app/components/general/document/document-page-view-recent-activity.tsx -#: apps/remix/app/components/general/document/document-history-sheet.tsx msgid "Unable to load document history" msgstr "Impossibile caricare la cronologia del documento" @@ -8016,11 +8033,8 @@ msgstr "Non siamo stati in grado di verificare la tua email in questo momento." msgid "We were unable to verify your email. If your email is not verified already, please try again." msgstr "Non siamo riusciti a verificare la tua email. Se la tua email non è già verificata, riprova." -#: packages/ui/primitives/document-flow/add-subject.tsx -msgid "We will generate signing links for with you, which you can send to the recipients through your method of choice." -msgstr "Genereremo link di firma con te, che potrai inviare ai destinatari tramite il tuo metodo preferito." - #: apps/remix/app/components/dialogs/template-use-dialog.tsx +#: packages/ui/primitives/document-flow/add-subject.tsx msgid "We will generate signing links for you, which you can send to the recipients through your method of choice." msgstr "Genereremo link di firma per te, che potrai inviare ai destinatari tramite il metodo di tua scelta." @@ -8734,4 +8748,3 @@ msgstr "Il tuo token è stato creato con successo! Assicurati di copiarlo perch #: apps/remix/app/routes/_authenticated+/t.$teamUrl+/settings.tokens.tsx msgid "Your tokens will be shown here once you create them." msgstr "I tuoi token verranno mostrati qui una volta creati." - diff --git a/packages/lib/translations/pl/web.po b/packages/lib/translations/pl/web.po index 02e1566d0..81c3a7a33 100644 --- a/packages/lib/translations/pl/web.po +++ b/packages/lib/translations/pl/web.po @@ -297,6 +297,10 @@ msgstr "Użytkownik {prefix} zaktualizował dokument" msgid "{prefix} updated the document access auth requirements" msgstr "{prefix} zaktualizowane wymagania dotyczące autoryzacji dostępu do dokumentu" +#: packages/lib/utils/document-audit-logs.ts +msgid "{prefix} updated the document attachments" +msgstr "" + #: packages/lib/utils/document-audit-logs.ts msgid "{prefix} updated the document external ID" msgstr "{prefix} zaktualizowane ID zewnętrzne dokumentu" @@ -313,6 +317,10 @@ msgstr "Użytkownik {prefix} zaktualizował tytuł dokumentu" msgid "{prefix} updated the document visibility" msgstr "Użytkownik {prefix} zaktualizował widoczność dokumentu" +#: packages/lib/utils/document-audit-logs.ts +msgid "{prefix} viewed the document" +msgstr "" + #: apps/remix/app/components/general/direct-template/direct-template-page.tsx msgid "{recipientActionVerb} document" msgstr "{recipientActionVerb} dokument" @@ -1427,6 +1435,10 @@ msgstr "Asystowanie" msgid "At least one signature type must be enabled" msgstr "Przynajmniej jeden typ podpisu musi być włączony" +#: apps/remix/app/components/general/document-signing/document-signing-form.tsx +msgid "Attachments" +msgstr "" + #: apps/remix/app/routes/_authenticated+/admin+/documents.$id.tsx msgid "Attempts sealing the document again, useful for after a code change has occurred to resolve an erroneous document." msgstr "Ponowne próby zapieczętowania dokumentu, przydatne po zmianie kodu w celu rozwiązania błędnego dokumentu." @@ -1767,7 +1779,6 @@ msgstr "Kliknij, aby rozpocząć" #: apps/remix/app/components/tables/settings-public-profile-templates-table.tsx #: apps/remix/app/components/general/template/template-page-view-recent-activity.tsx #: apps/remix/app/components/general/document/document-page-view-recent-activity.tsx -#: apps/remix/app/components/general/document/document-history-sheet.tsx msgid "Click here to retry" msgstr "Kliknij tutaj, aby spróbować ponownie" @@ -2665,6 +2676,10 @@ msgstr "Wszystkie dokumenty" msgid "Document Approved" msgstr "Dokument zatwierdzony" +#: packages/lib/utils/document-audit-logs.ts +msgid "Document attachments updated" +msgstr "" + #: apps/remix/app/routes/_recipient+/sign.$token+/_index.tsx #: packages/lib/server-only/document/super-delete-document.ts #: packages/lib/server-only/document/delete-document.ts @@ -2749,11 +2764,6 @@ msgstr "Zaktualizowane ID zewnętrzne dokumentu" msgid "Document found in your account" msgstr "Dokument znaleziony na Twoim koncie" -#: apps/remix/app/routes/_authenticated+/t.$teamUrl+/documents.$id._index.tsx -#: apps/remix/app/components/general/document/document-history-sheet.tsx -msgid "Document history" -msgstr "Historia dokumentu" - #: apps/remix/app/routes/_internal+/[__htmltopdf]+/audit-log.tsx #: apps/remix/app/routes/_authenticated+/t.$teamUrl+/documents.$id.logs.tsx msgid "Document ID" @@ -2872,6 +2882,10 @@ msgstr "Przesyłanie dokumentu wyłączone z powodu nieopłaconych faktur" msgid "Document uploaded" msgstr "Przesłano dokument" +#: packages/lib/utils/document-audit-logs.ts +msgid "Document viewed" +msgstr "" + #: apps/remix/app/routes/_recipient+/sign.$token+/complete.tsx msgid "Document Viewed" msgstr "Dokument został wyświetlony" @@ -3712,10 +3726,6 @@ msgstr "Cześć, {userName} <0>({userEmail})" msgid "Hide" msgstr "Ukryj" -#: apps/remix/app/components/general/document/document-history-sheet.tsx -msgid "Hide additional information" -msgstr "Ukryj dodatkowe informacje" - #: apps/remix/app/components/general/generic-error-layout.tsx #: apps/remix/app/components/general/folder/folder-grid.tsx #: apps/remix/app/components/dialogs/folder-move-dialog.tsx @@ -5814,10 +5824,6 @@ msgstr "Podziel się swoim doświadczeniem podpisywania!" msgid "Show" msgstr "Pokaż" -#: apps/remix/app/components/general/document/document-history-sheet.tsx -msgid "Show additional information" -msgstr "Pokaż dodatkowe informacje" - #: packages/ui/primitives/template-flow/add-template-placeholder-recipients.tsx #: packages/ui/primitives/document-flow/add-signers.tsx msgid "Show advanced settings" @@ -6633,7 +6639,8 @@ msgid "The following team has been deleted. You will no longer be able to access msgstr "Poniższy zespół został usunięty. Nie będziesz mógł już uzyskać dostępu do tego zespołu i jego dokumentów." #: apps/remix/app/routes/_authenticated+/o.$orgUrl.settings.groups.$id.tsx -msgid "The organisation group you are looking for may have been removed, renamed or may have never\n" +msgid "" +"The organisation group you are looking for may have been removed, renamed or may have never\n" " existed." msgstr "Grupa organizacji, której szukasz, mogła zostać usunięta, zmieniona nazwa lub mogła nigdy nie istnieć." @@ -6642,12 +6649,14 @@ msgid "The organisation role that will be applied to all members in this group." msgstr "Rola organizacji, która zostanie zastosowana do wszystkich członków tej grupy." #: apps/remix/app/routes/_authenticated+/admin+/organisations.$id.tsx -msgid "The organisation you are looking for may have been removed, renamed or may have never\n" +msgid "" +"The organisation you are looking for may have been removed, renamed or may have never\n" " existed." msgstr "Organizacja, której szukasz, mogła zostać usunięta, zmieniona nazwa lub mogła nigdy nie istnieć." #: apps/remix/app/routes/_authenticated+/_layout.tsx -msgid "The organisation you are looking for may have been removed, renamed or may have never\n" +msgid "" +"The organisation you are looking for may have been removed, renamed or may have never\n" " existed." msgstr "Organizacja, której szukasz, mogła zostać usunięta, zmieniona nazwa lub mogła nigdy nie istnieć." @@ -6731,12 +6740,14 @@ msgid "The team email <0>{teamEmail} has been removed from the following tea msgstr "Email zespołowy <0>{teamEmail} został usunięty z następującego zespołu" #: apps/remix/app/routes/_authenticated+/_layout.tsx -msgid "The team you are looking for may have been removed, renamed or may have never\n" +msgid "" +"The team you are looking for may have been removed, renamed or may have never\n" " existed." msgstr "Zespół, którego szukasz, mógł zostać usunięty, zmienić nazwę lub mógł nigdy nie istnieć." #: apps/remix/app/routes/_authenticated+/t.$teamUrl+/_layout.tsx -msgid "The team you are looking for may have been removed, renamed or may have never\n" +msgid "" +"The team you are looking for may have been removed, renamed or may have never\n" " existed." msgstr "Zespół, którego szukasz, mógł zostać usunięty, zmieniony na, albo nigdy nie istniał." @@ -6774,7 +6785,8 @@ msgid "The URL for Documenso to send webhook events to." msgstr "URL dla Documenso do wysyłania zdarzeń webhook." #: apps/remix/app/routes/_authenticated+/admin+/users.$id.tsx -msgid "The user you are looking for may have been removed, renamed or may have never\n" +msgid "" +"The user you are looking for may have been removed, renamed or may have never\n" " existed." msgstr "Użytkownik, którego szukasz, mógł zostać usunięty, zmieniony nazwę lub mógł nigdy nie istnieć." @@ -7241,7 +7253,6 @@ msgid "Unable to join this organisation at this time." msgstr "Nie można w tej chwili dołączyć do tej organizacji." #: apps/remix/app/components/general/document/document-page-view-recent-activity.tsx -#: apps/remix/app/components/general/document/document-history-sheet.tsx msgid "Unable to load document history" msgstr "Nie można załadować historii dokumentu" @@ -8010,11 +8021,8 @@ msgstr "Nie udało się zweryfikować Twojego e-maila w tym momencie." msgid "We were unable to verify your email. If your email is not verified already, please try again." msgstr "Nie udało się zweryfikować twojego e-maila. Jeśli twój e-mail nie jest jeszcze zweryfikowany, spróbuj ponownie." -#: packages/ui/primitives/document-flow/add-subject.tsx -msgid "We will generate signing links for with you, which you can send to the recipients through your method of choice." -msgstr "Wygenerujemy linki do podpisu dla Ciebie, które możesz wysłać do odbiorców w wybrany przez siebie sposób." - #: apps/remix/app/components/dialogs/template-use-dialog.tsx +#: packages/ui/primitives/document-flow/add-subject.tsx msgid "We will generate signing links for you, which you can send to the recipients through your method of choice." msgstr "Wygenerujemy dla Ciebie linki do podpisania, które możesz wysłać do odbiorców za pomocą wybranej metody." @@ -8728,4 +8736,3 @@ msgstr "Twój token został pomyślnie utworzony! Upewnij się, że go skopiujes #: apps/remix/app/routes/_authenticated+/t.$teamUrl+/settings.tokens.tsx msgid "Your tokens will be shown here once you create them." msgstr "Twoje tokeny będą tutaj wyświetlane po ich utworzeniu." - diff --git a/packages/lib/types/document.ts b/packages/lib/types/document.ts index 7da31054e..2b2fe8284 100644 --- a/packages/lib/types/document.ts +++ b/packages/lib/types/document.ts @@ -1,6 +1,5 @@ import type { z } from 'zod'; -import { AttachmentSchema } from '@documenso/prisma/generated/zod/modelSchema/AttachmentSchema'; import { DocumentDataSchema } from '@documenso/prisma/generated/zod/modelSchema/DocumentDataSchema'; import { DocumentMetaSchema } from '@documenso/prisma/generated/zod/modelSchema/DocumentMetaSchema'; import { DocumentSchema } from '@documenso/prisma/generated/zod/modelSchema/DocumentSchema'; @@ -74,14 +73,6 @@ export const ZDocumentSchema = DocumentSchema.pick({ }).nullable(), recipients: ZRecipientLiteSchema.array(), fields: ZFieldSchema.array(), - attachments: AttachmentSchema.pick({ - id: true, - label: true, - url: true, - type: true, - }) - .array() - .optional(), }); export type TDocument = z.infer; diff --git a/packages/lib/types/template.ts b/packages/lib/types/template.ts index b173c0843..f5f5dd6f0 100644 --- a/packages/lib/types/template.ts +++ b/packages/lib/types/template.ts @@ -1,6 +1,5 @@ import type { z } from 'zod'; -import { AttachmentSchema } from '@documenso/prisma/generated/zod/modelSchema/AttachmentSchema'; import { DocumentDataSchema } from '@documenso/prisma/generated/zod/modelSchema/DocumentDataSchema'; import { FolderSchema } from '@documenso/prisma/generated/zod/modelSchema/FolderSchema'; import TeamSchema from '@documenso/prisma/generated/zod/modelSchema/TeamSchema'; @@ -65,14 +64,6 @@ export const ZTemplateSchema = TemplateSchema.pick({ }), recipients: ZRecipientLiteSchema.array(), fields: ZFieldSchema.array(), - attachments: AttachmentSchema.pick({ - id: true, - label: true, - url: true, - type: true, - }) - .array() - .optional(), folder: FolderSchema.pick({ id: true, name: true, diff --git a/packages/trpc/server/attachment-router/router.ts b/packages/trpc/server/attachment-router/router.ts index e29575ccb..244f05e74 100644 --- a/packages/trpc/server/attachment-router/router.ts +++ b/packages/trpc/server/attachment-router/router.ts @@ -1,26 +1,32 @@ -import { findAttachments } from '@documenso/lib/server-only/attachment/find-attachments'; +import { findDocumentAttachments } from '@documenso/lib/server-only/attachment/find-document-attachments'; +import { findTemplateAttachments } from '@documenso/lib/server-only/attachment/find-template-attachments'; import { setDocumentAttachments } from '@documenso/lib/server-only/attachment/set-document-attachments'; +import { setTemplateAttachments } from '@documenso/lib/server-only/attachment/set-template-attachments'; import { authenticatedProcedure, router } from '../trpc'; import { ZGetDocumentAttachmentsResponseSchema, ZGetDocumentAttachmentsSchema, + ZGetTemplateAttachmentsResponseSchema, + ZGetTemplateAttachmentsSchema, ZSetDocumentAttachmentsResponseSchema, ZSetDocumentAttachmentsSchema, + ZSetTemplateAttachmentsResponseSchema, + ZSetTemplateAttachmentsSchema, } from './schema'; export const attachmentRouter = router({ /** * @private */ - getAttachments: authenticatedProcedure + getDocumentAttachments: authenticatedProcedure .input(ZGetDocumentAttachmentsSchema) .output(ZGetDocumentAttachmentsResponseSchema) .query(async ({ input, ctx }) => { const { documentId } = input; const { user } = ctx; - const attachments = await findAttachments({ + const attachments = await findDocumentAttachments({ documentId, userId: user.id, teamId: ctx.teamId, @@ -42,6 +48,40 @@ export const attachmentRouter = router({ attachments, }); + return updatedAttachments; + }), + + /** + * @private + */ + getTemplateAttachments: authenticatedProcedure + .input(ZGetTemplateAttachmentsSchema) + .output(ZGetTemplateAttachmentsResponseSchema) + .query(async ({ input, ctx }) => { + const { templateId } = input; + + const attachments = await findTemplateAttachments({ + templateId, + userId: ctx.user.id, + teamId: ctx.teamId, + }); + + return attachments; + }), + /** + * @private + */ + setTemplateAttachments: authenticatedProcedure + .input(ZSetTemplateAttachmentsSchema) + .output(ZSetTemplateAttachmentsResponseSchema) + .mutation(async ({ input, ctx }) => { + const { templateId, attachments } = input; + + const updatedAttachments = await setTemplateAttachments({ + templateId, + attachments, + }); + return updatedAttachments; }), }); diff --git a/packages/trpc/server/attachment-router/schema.ts b/packages/trpc/server/attachment-router/schema.ts index 428c73bc1..4ab3f5dd7 100644 --- a/packages/trpc/server/attachment-router/schema.ts +++ b/packages/trpc/server/attachment-router/schema.ts @@ -15,6 +15,19 @@ export const ZGetDocumentAttachmentsResponseSchema = z.array( }), ); +export const ZGetTemplateAttachmentsSchema = z.object({ + templateId: z.number(), +}); + +export const ZGetTemplateAttachmentsResponseSchema = z.array( + z.object({ + id: z.string(), + label: z.string(), + url: z.string(), + type: z.nativeEnum(AttachmentType), + }), +); + export const ZSetDocumentAttachmentsSchema = z.object({ documentId: z.number(), attachments: z.array( @@ -37,3 +50,26 @@ export const ZSetDocumentAttachmentsResponseSchema = z.array( type: z.nativeEnum(AttachmentType), }), ); + +export const ZSetTemplateAttachmentsSchema = z.object({ + templateId: z.number(), + attachments: z.array( + z.object({ + id: z.string(), + label: z.string().min(1, 'Label is required'), + url: z.string().url('Invalid URL'), + type: z.nativeEnum(AttachmentType), + }), + ), +}); + +export type TSetTemplateAttachmentsSchema = z.infer; + +export const ZSetTemplateAttachmentsResponseSchema = z.array( + z.object({ + id: z.string(), + label: z.string(), + url: z.string(), + type: z.nativeEnum(AttachmentType), + }), +); diff --git a/packages/trpc/server/template-router/schema.ts b/packages/trpc/server/template-router/schema.ts index 003dc3bf5..e0804ed9b 100644 --- a/packages/trpc/server/template-router/schema.ts +++ b/packages/trpc/server/template-router/schema.ts @@ -14,7 +14,6 @@ import { ZTemplateManySchema, ZTemplateSchema, } from '@documenso/lib/types/template'; -import AttachmentSchema from '@documenso/prisma/generated/zod/modelSchema/AttachmentSchema'; import { TemplateDirectLinkSchema } from '@documenso/prisma/generated/zod/modelSchema/TemplateDirectLinkSchema'; import { @@ -156,16 +155,6 @@ export const ZUpdateTemplateRequestSchema = z.object({ .optional(), type: z.nativeEnum(TemplateType).optional(), useLegacyFieldInsertion: z.boolean().optional(), - attachments: AttachmentSchema.pick({ - id: true, - label: true, - url: true, - }) - .extend({ - formId: z.string().min(1), - }) - .array() - .optional(), }) .optional(), meta: z