chore: template attachments

This commit is contained in:
Catalin Pit
2025-07-07 13:31:55 +03:00
parent 30b240cba2
commit e19da93ce2
19 changed files with 583 additions and 195 deletions

View File

@ -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 ? (
<div className="flex flex-col items-end gap-2 sm:flex-row sm:items-start">
<LegacyFieldWarningPopover type="document" documentId={document.id} />
<AttachmentForm document={document} />
<AttachmentForm documentId={document.id} />
</div>
) : (
<div>
<AttachmentForm document={document} />
<AttachmentForm documentId={document.id} />
</div>
)}
</div>

View File

@ -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() {
<div className="mt-2 flex items-center gap-2 sm:mt-0 sm:self-end">
<TemplateDirectLinkDialogWrapper template={template} />
<AttachmentForm templateId={template.id} />
{template.useLegacyFieldInsertion && (
<div>