fix: remove legacy envelope uploads (#2303)

This commit is contained in:
David Nguyen
2025-12-11 14:09:38 +11:00
committed by GitHub
parent 43486d8448
commit 0cebdec637
7 changed files with 103 additions and 180 deletions
@@ -364,6 +364,25 @@ test('[TEAMS]: can create a template subfolder inside a template folder', async
test('[TEAMS]: can create a template inside a template folder', async ({ page }) => {
const { team, teamOwner } = await seedTeamDocuments();
const organisationClaim = await prisma.organisationClaim.findFirstOrThrow({
where: {
organisation: {
id: team.organisationId,
},
},
});
await prisma.organisationClaim.update({
where: {
id: organisationClaim.id,
},
data: {
flags: {
allowLegacyEnvelopes: true,
},
},
});
const folder = await seedBlankFolder(teamOwner, team.id, {
createFolderOptions: {
name: 'Team Client Templates',
@@ -380,16 +399,15 @@ test('[TEAMS]: can create a template inside a template folder', async ({ page })
await expect(page.getByText('Team Client Templates')).toBeVisible();
await page.getByRole('button', { name: 'Template (Legacy)' }).click();
// Upload document.
const [fileChooser] = await Promise.all([
page.waitForEvent('filechooser'),
page.getByRole('button', { name: 'Template (Legacy)' }).click(),
]);
await page.getByText('Upload Template Document').click();
await page.locator('input[type="file"]').nth(0).waitFor({ state: 'attached' });
await page
.locator('input[type="file"]')
.nth(0)
.setInputFiles(path.join(__dirname, '../../../assets/documenso-supporter-pledge.pdf'));
await fileChooser.setFiles(
path.join(__dirname, '../../../assets/documenso-supporter-pledge.pdf'),
);
await page.waitForTimeout(3000);
+4 -4
View File
@@ -31,7 +31,7 @@ export const ZClaimFlagsSchema = z.object({
authenticationPortal: z.boolean().optional(),
allowEnvelopes: z.boolean().optional(),
allowLegacyEnvelopes: z.boolean().optional(),
});
export type TClaimFlags = z.infer<typeof ZClaimFlagsSchema>;
@@ -84,9 +84,9 @@ export const SUBSCRIPTION_CLAIM_FEATURE_FLAGS: Record<
key: 'authenticationPortal',
label: 'Authentication portal',
},
allowEnvelopes: {
key: 'allowEnvelopes',
label: 'Allow envelopes',
allowLegacyEnvelopes: {
key: 'allowLegacyEnvelopes',
label: 'Allow Legacy Envelopes',
},
};
+12
View File
@@ -60,6 +60,18 @@ export const seedUser = async ({
},
include: {
teams: true,
organisationClaim: true,
},
});
await prisma.organisationClaim.update({
where: {
id: organisation.organisationClaim.id,
},
data: {
flags: {
allowLegacyEnvelopes: true,
},
},
});
@@ -17,7 +17,7 @@ const EnvelopePdfViewer = lazy(async () => import('./pdf-viewer-konva'));
export const PDFViewerKonvaLazy = (props: PDFViewerProps) => {
return (
<Suspense fallback={<div>Loading client component...</div>}>
<Suspense fallback={<div>Loading...</div>}>
<EnvelopePdfViewer {...props} />
</Suspense>
);