-
diff --git a/apps/remix/app/components/general/folder/folder-grid.tsx b/apps/remix/app/components/general/folder/folder-grid.tsx
index 182c1b81c..fa5cb3612 100644
--- a/apps/remix/app/components/general/folder/folder-grid.tsx
+++ b/apps/remix/app/components/general/folder/folder-grid.tsx
@@ -6,7 +6,6 @@ import { FolderIcon, HomeIcon } from 'lucide-react';
import { Link } from 'react-router';
import { useCurrentOrganisation } from '@documenso/lib/client-only/providers/organisation';
-import { IS_ENVELOPES_ENABLED } from '@documenso/lib/constants/app';
import { formatDocumentsPath, formatTemplatesPath } from '@documenso/lib/utils/teams';
import { trpc } from '@documenso/trpc/react';
import { type TFolderWithSubfolders } from '@documenso/trpc/server/folder-router/schema';
@@ -17,7 +16,7 @@ import { FolderDeleteDialog } from '~/components/dialogs/folder-delete-dialog';
import { FolderMoveDialog } from '~/components/dialogs/folder-move-dialog';
import { FolderUpdateDialog } from '~/components/dialogs/folder-update-dialog';
import { TemplateCreateDialog } from '~/components/dialogs/template-create-dialog';
-import { DocumentUploadButton } from '~/components/general/document/document-upload-button';
+import { DocumentUploadButtonLegacy } from '~/components/general/document/document-upload-button-legacy';
import { FolderCard, FolderCardEmpty } from '~/components/general/folder/folder-card';
import { useCurrentTeam } from '~/providers/team';
@@ -99,14 +98,12 @@ export const FolderGrid = ({ type, parentId }: FolderGridProps) => {
- {(IS_ENVELOPES_ENABLED || organisation.organisationClaim.flags.allowEnvelopes) && (
-
- )}
+
{type === FolderType.DOCUMENT ? (
-
+ // If you delete this, delete the component as well.
) : (
-
+ // If you delete this, delete the component as well.
)}
diff --git a/packages/app-tests/e2e/folders/team-account-folders.spec.ts b/packages/app-tests/e2e/folders/team-account-folders.spec.ts
index 390c880f8..08ca3e2e3 100644
--- a/packages/app-tests/e2e/folders/team-account-folders.spec.ts
+++ b/packages/app-tests/e2e/folders/team-account-folders.spec.ts
@@ -81,7 +81,7 @@ test('[TEAMS]: can create a document inside a document folder', async ({ page })
redirectPath: `/t/${team.url}/documents/f/${teamFolder.id}`,
});
- const fileInput = page.locator('input[type="file"]').nth(1);
+ const fileInput = page.locator('input[type="file"]').nth(2);
await fileInput.waitFor({ state: 'attached' });
await fileInput.setInputFiles(
@@ -368,7 +368,7 @@ 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: 'New Template' }).click();
+ await page.getByRole('button', { name: 'Template (Legacy)' }).click();
await page.getByText('Upload Template Document').click();
@@ -842,7 +842,7 @@ test('[TEAMS]: documents inherit folder visibility', async ({ page }) => {
// Upload document.
const [fileChooser] = await Promise.all([
page.waitForEvent('filechooser'),
- page.getByRole('button', { name: 'Upload Document' }).click(),
+ page.getByRole('button', { name: 'Document (Legacy)' }).click(),
]);
await fileChooser.setFiles(
diff --git a/packages/lib/constants/app.ts b/packages/lib/constants/app.ts
index 43e6d6d8a..a89380cc2 100644
--- a/packages/lib/constants/app.ts
+++ b/packages/lib/constants/app.ts
@@ -15,5 +15,3 @@ export const API_V2_BETA_URL = '/api/v2-beta';
export const API_V2_URL = '/api/v2';
export const SUPPORT_EMAIL = env('NEXT_PUBLIC_SUPPORT_EMAIL') ?? 'support@documenso.com';
-
-export const IS_ENVELOPES_ENABLED = env('NEXT_PUBLIC_FEATURE_ENVELOPES_ENABLED') === 'true';
diff --git a/packages/ui/primitives/document-upload.tsx b/packages/ui/primitives/document-upload-button.tsx
similarity index 85%
rename from packages/ui/primitives/document-upload.tsx
rename to packages/ui/primitives/document-upload-button.tsx
index b4c7daf95..7945b5f86 100644
--- a/packages/ui/primitives/document-upload.tsx
+++ b/packages/ui/primitives/document-upload-button.tsx
@@ -2,6 +2,7 @@ import type { MessageDescriptor } from '@lingui/core';
import { msg } from '@lingui/core/macro';
import { useLingui } from '@lingui/react';
import { Trans } from '@lingui/react/macro';
+import { EnvelopeType } from '@prisma/client';
import { Upload } from 'lucide-react';
import type { DropEvent, FileRejection } from 'react-dropzone';
import { useDropzone } from 'react-dropzone';
@@ -16,29 +17,32 @@ import { isPersonalLayout } from '@documenso/lib/utils/organisations';
import { Button } from './button';
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './tooltip';
-export type DocumentDropzoneProps = {
+export type DocumentUploadButtonProps = {
className?: string;
disabled?: boolean;
loading?: boolean;
disabledMessage?: MessageDescriptor;
onDrop?: (_files: File[]) => void | Promise;
onDropRejected?: (fileRejections: FileRejection[], event: DropEvent) => void;
- type?: 'document' | 'template' | 'envelope';
+ type: EnvelopeType;
+ internalVersion: '1' | '2';
maxFiles?: number;
[key: string]: unknown;
};
-export const DocumentDropzone = ({
+export const DocumentUploadButton = ({
className,
loading,
onDrop,
onDropRejected,
disabled,
disabledMessage = msg`You cannot upload documents at this time.`,
- type = 'document',
+ type,
+ internalVersion,
+
maxFiles,
...props
-}: DocumentDropzoneProps) => {
+}: DocumentUploadButtonProps) => {
const { _ } = useLingui();
const { organisations } = useSession();
@@ -51,7 +55,7 @@ export const DocumentDropzone = ({
accept: {
'application/pdf': ['.pdf'],
},
- multiple: type === 'envelope',
+ multiple: internalVersion === '2',
disabled,
maxFiles,
onDrop: (acceptedFiles) => {
@@ -64,9 +68,10 @@ export const DocumentDropzone = ({
});
const heading = {
- document: msg`Upload Document`,
- template: msg`Upload Template Document`,
- envelope: msg`Upload Envelope`,
+ [EnvelopeType.DOCUMENT]:
+ internalVersion === '1' ? msg`Document (Legacy)` : msg`Upload Document`,
+ [EnvelopeType.TEMPLATE]:
+ internalVersion === '1' ? msg`Template (Legacy)` : msg`Upload Template`,
};
if (disabled && IS_BILLING_ENABLED()) {