From 82337e4e3a6aeb6b0c61f4bccf3e8e2dc6b6890a Mon Sep 17 00:00:00 2001 From: Catalin Pit Date: Wed, 5 Feb 2025 12:02:21 +0200 Subject: [PATCH 1/3] fix: typed signature not working (#1635) The `typedSignatureEnabled` prop was removed from the `SignatureField` component, which broke the typed signature meaning that nobody could sign documents by typing their signature. --- .../app/(recipient)/d/[token]/sign-direct-template.tsx | 2 ++ .../src/app/(signing)/sign/[token]/signing-page-view.tsx | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/web/src/app/(recipient)/d/[token]/sign-direct-template.tsx b/apps/web/src/app/(recipient)/d/[token]/sign-direct-template.tsx index 73e4aa178..a0d92e595 100644 --- a/apps/web/src/app/(recipient)/d/[token]/sign-direct-template.tsx +++ b/apps/web/src/app/(recipient)/d/[token]/sign-direct-template.tsx @@ -189,6 +189,7 @@ export const SignDirectTemplateForm = ({ field={field} onSignField={onSignField} onUnsignField={onUnsignField} + typedSignatureEnabled={template.templateMeta?.typedSignatureEnabled} /> )) .with(FieldType.INITIALS, () => ( @@ -342,6 +343,7 @@ export const SignDirectTemplateForm = ({ onChange={(value) => { setSignature(value); }} + allowTypedSignature={template.templateMeta?.typedSignatureEnabled} /> diff --git a/apps/web/src/app/(signing)/sign/[token]/signing-page-view.tsx b/apps/web/src/app/(signing)/sign/[token]/signing-page-view.tsx index 9c129edb6..e38ff2b85 100644 --- a/apps/web/src/app/(signing)/sign/[token]/signing-page-view.tsx +++ b/apps/web/src/app/(signing)/sign/[token]/signing-page-view.tsx @@ -179,7 +179,13 @@ export const SigningPageView = ({ ) .map((field) => match(field.type) - .with(FieldType.SIGNATURE, () => ) + .with(FieldType.SIGNATURE, () => ( + + )) .with(FieldType.INITIALS, () => ) .with(FieldType.NAME, () => ) .with(FieldType.DATE, () => ( From ce1c93b2a663c5bfd4efcc2e689962a4ac5a0cad Mon Sep 17 00:00:00 2001 From: Mythie Date: Wed, 5 Feb 2025 21:03:15 +1100 Subject: [PATCH 2/3] v1.9.1-rc.1 --- apps/web/package.json | 2 +- package-lock.json | 6 +++--- package.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/web/package.json b/apps/web/package.json index c0caf4c66..2bc55c63b 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -1,6 +1,6 @@ { "name": "@documenso/web", - "version": "1.9.1-rc.0", + "version": "1.9.1-rc.1", "private": true, "license": "AGPL-3.0", "scripts": { diff --git a/package-lock.json b/package-lock.json index 9c49e7fa6..3d13aa2ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@documenso/root", - "version": "1.9.1-rc.0", + "version": "1.9.1-rc.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@documenso/root", - "version": "1.9.1-rc.0", + "version": "1.9.1-rc.1", "workspaces": [ "apps/*", "packages/*" @@ -106,7 +106,7 @@ }, "apps/web": { "name": "@documenso/web", - "version": "1.9.1-rc.0", + "version": "1.9.1-rc.1", "license": "AGPL-3.0", "dependencies": { "@documenso/api": "*", diff --git a/package.json b/package.json index 1fbace766..bc442208b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "private": true, - "version": "1.9.1-rc.0", + "version": "1.9.1-rc.1", "scripts": { "build": "turbo run build", "build:web": "turbo run build --filter=@documenso/web", From 2ff330f9d4c3a5cd16b37acbae2a825d8517c9d3 Mon Sep 17 00:00:00 2001 From: Ephraim Duncan <55143799+ephraimduncan@users.noreply.github.com> Date: Mon, 10 Feb 2025 11:55:12 +0000 Subject: [PATCH 3/3] chore: update local seed data (#1622) ## Description Add multiple example documents, pending documents, and templates for both admin and example users ## Changes Made - Added seeding of multiple example documents and templates for both example and admin users ## 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. - [x] I have addressed the code review feedback from the previous submission, if applicable. --- package-lock.json | 15 ++++ packages/prisma/seed/initial-seed.ts | 103 +++++++++++++++++++++------ 2 files changed, 95 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3d13aa2ae..36153b31a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35722,6 +35722,21 @@ "engines": { "node": ">=6" } + }, + "packages/trpc/node_modules/@next/swc-win32-ia32-msvc": { + "version": "14.2.6", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.6.tgz", + "integrity": "sha512-hNukAxq7hu4o5/UjPp5jqoBEtrpCbOmnUqZSKNJG8GrUVzfq0ucdhQFVrHcLRMvQcwqqDh1a5AJN9ORnNDpgBQ==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } } } } diff --git a/packages/prisma/seed/initial-seed.ts b/packages/prisma/seed/initial-seed.ts index d270b31fa..158b68475 100644 --- a/packages/prisma/seed/initial-seed.ts +++ b/packages/prisma/seed/initial-seed.ts @@ -5,6 +5,18 @@ import { hashSync } from '@documenso/lib/server-only/auth/hash'; import { prisma } from '..'; import { DocumentDataType, DocumentSource, Role, TeamMemberRole } from '../client'; +import { seedPendingDocument } from './documents'; +import { seedDirectTemplate, seedTemplate } from './templates'; + +const createDocumentData = async ({ documentData }: { documentData: string }) => { + return prisma.documentData.create({ + data: { + type: DocumentDataType.BYTES_64, + data: documentData, + initialData: documentData, + }, + }); +}; export const seedDatabase = async () => { const examplePdf = fs @@ -39,35 +51,80 @@ export const seedDatabase = async () => { update: {}, }); - const examplePdfData = await prisma.documentData.upsert({ - where: { - id: 'clmn0kv5k0000pe04vcqg5zla', - }, - create: { - id: 'clmn0kv5k0000pe04vcqg5zla', - type: DocumentDataType.BYTES_64, - data: examplePdf, - initialData: examplePdf, - }, - update: {}, - }); + for (let i = 1; i <= 4; i++) { + const documentData = await createDocumentData({ documentData: examplePdf }); - await prisma.document.create({ - data: { - source: DocumentSource.DOCUMENT, - title: 'Example Document', - documentDataId: examplePdfData.id, - userId: exampleUser.id, - recipients: { - create: { - name: String(adminUser.name), - email: adminUser.email, - token: Math.random().toString(36).slice(2, 9), + await prisma.document.create({ + data: { + source: DocumentSource.DOCUMENT, + title: `Example Document ${i}`, + documentDataId: documentData.id, + userId: exampleUser.id, + recipients: { + create: { + name: String(adminUser.name), + email: adminUser.email, + token: Math.random().toString(36).slice(2, 9), + }, }, }, + }); + } + + for (let i = 1; i <= 4; i++) { + const documentData = await createDocumentData({ documentData: examplePdf }); + + await prisma.document.create({ + data: { + source: DocumentSource.DOCUMENT, + title: `Document ${i}`, + documentDataId: documentData.id, + userId: adminUser.id, + recipients: { + create: { + name: String(exampleUser.name), + email: exampleUser.email, + token: Math.random().toString(36).slice(2, 9), + }, + }, + }, + }); + } + + await seedPendingDocument(exampleUser, [adminUser], { + key: 'example-pending', + createDocumentOptions: { + title: 'Pending Document', }, }); + await seedPendingDocument(adminUser, [exampleUser], { + key: 'admin-pending', + createDocumentOptions: { + title: 'Pending Document', + }, + }); + + await Promise.all([ + seedTemplate({ + title: 'Template 1', + userId: exampleUser.id, + }), + seedDirectTemplate({ + title: 'Direct Template 1', + userId: exampleUser.id, + }), + + seedTemplate({ + title: 'Template 1', + userId: adminUser.id, + }), + seedDirectTemplate({ + title: 'Direct Template 1', + userId: adminUser.id, + }), + ]); + const testUsers = [ 'test@documenso.com', 'test2@documenso.com',