mirror of
https://github.com/documenso/documenso.git
synced 2025-11-17 02:01:33 +10:00
feat: add envelopes (#2025)
This PR is handles the changes required to support envelopes. The new envelope editor/signing page will be hidden during release. The core changes here is to migrate the documents and templates model to a centralized envelopes model. Even though Documents and Templates are removed, from the user perspective they will still exist as we remap envelopes to documents and templates.
This commit is contained in:
@ -2,6 +2,7 @@ import type { Page } from '@playwright/test';
|
||||
import { expect, test } from '@playwright/test';
|
||||
|
||||
import { getTemplateById } from '@documenso/lib/server-only/template/get-template-by-id';
|
||||
import { mapSecondaryIdToTemplateId } from '@documenso/lib/utils/envelope';
|
||||
import { seedBlankTemplate } from '@documenso/prisma/seed/templates';
|
||||
import { seedUser } from '@documenso/prisma/seed/users';
|
||||
|
||||
@ -16,7 +17,7 @@ const setupTemplate = async (page: Page) => {
|
||||
await apiSignin({
|
||||
page,
|
||||
email: user.email,
|
||||
redirectPath: `/templates/${template.id}/edit`,
|
||||
redirectPath: `/t/${team.url}/templates/${mapSecondaryIdToTemplateId(template.secondaryId)}/edit`,
|
||||
});
|
||||
|
||||
return { user, team, template };
|
||||
@ -41,7 +42,10 @@ test.describe('AutoSave Settings Step - Templates', () => {
|
||||
|
||||
await expect(async () => {
|
||||
const retrievedTemplate = await getTemplateById({
|
||||
id: template.id,
|
||||
id: {
|
||||
type: 'envelopeId',
|
||||
id: template.id,
|
||||
},
|
||||
userId: user.id,
|
||||
teamId: team.id,
|
||||
});
|
||||
@ -65,7 +69,10 @@ test.describe('AutoSave Settings Step - Templates', () => {
|
||||
|
||||
await expect(async () => {
|
||||
const retrievedTemplate = await getTemplateById({
|
||||
id: template.id,
|
||||
id: {
|
||||
type: 'envelopeId',
|
||||
id: template.id,
|
||||
},
|
||||
userId: user.id,
|
||||
teamId: team.id,
|
||||
});
|
||||
@ -87,7 +94,10 @@ test.describe('AutoSave Settings Step - Templates', () => {
|
||||
|
||||
await expect(async () => {
|
||||
const retrievedTemplate = await getTemplateById({
|
||||
id: template.id,
|
||||
id: {
|
||||
type: 'envelopeId',
|
||||
id: template.id,
|
||||
},
|
||||
userId: user.id,
|
||||
teamId: team.id,
|
||||
});
|
||||
@ -109,7 +119,10 @@ test.describe('AutoSave Settings Step - Templates', () => {
|
||||
|
||||
await expect(async () => {
|
||||
const retrievedTemplate = await getTemplateById({
|
||||
id: template.id,
|
||||
id: {
|
||||
type: 'envelopeId',
|
||||
id: template.id,
|
||||
},
|
||||
userId: user.id,
|
||||
teamId: team.id,
|
||||
});
|
||||
@ -131,7 +144,10 @@ test.describe('AutoSave Settings Step - Templates', () => {
|
||||
|
||||
await expect(async () => {
|
||||
const retrievedTemplate = await getTemplateById({
|
||||
id: template.id,
|
||||
id: {
|
||||
type: 'envelopeId',
|
||||
id: template.id,
|
||||
},
|
||||
userId: user.id,
|
||||
teamId: team.id,
|
||||
});
|
||||
@ -154,7 +170,10 @@ test.describe('AutoSave Settings Step - Templates', () => {
|
||||
|
||||
await expect(async () => {
|
||||
const retrievedTemplate = await getTemplateById({
|
||||
id: template.id,
|
||||
id: {
|
||||
type: 'envelopeId',
|
||||
id: template.id,
|
||||
},
|
||||
userId: user.id,
|
||||
teamId: team.id,
|
||||
});
|
||||
@ -175,7 +194,10 @@ test.describe('AutoSave Settings Step - Templates', () => {
|
||||
|
||||
await expect(async () => {
|
||||
const retrievedTemplate = await getTemplateById({
|
||||
id: template.id,
|
||||
id: {
|
||||
type: 'envelopeId',
|
||||
id: template.id,
|
||||
},
|
||||
userId: user.id,
|
||||
teamId: team.id,
|
||||
});
|
||||
@ -197,7 +219,10 @@ test.describe('AutoSave Settings Step - Templates', () => {
|
||||
|
||||
await expect(async () => {
|
||||
const retrievedTemplate = await getTemplateById({
|
||||
id: template.id,
|
||||
id: {
|
||||
type: 'envelopeId',
|
||||
id: template.id,
|
||||
},
|
||||
userId: user.id,
|
||||
teamId: team.id,
|
||||
});
|
||||
@ -229,7 +254,10 @@ test.describe('AutoSave Settings Step - Templates', () => {
|
||||
|
||||
await expect(async () => {
|
||||
const retrievedTemplate = await getTemplateById({
|
||||
id: template.id,
|
||||
id: {
|
||||
type: 'envelopeId',
|
||||
id: template.id,
|
||||
},
|
||||
userId: user.id,
|
||||
teamId: team.id,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user