Skip to content

The Open Source DocuSign Alternative.

fix: show legacy ids on template and document view page (#2153)

Lucas Smith88d5a636c31b
diff --git a/apps/remix/app/components/general/document/document-page-view-information.tsx b/apps/remix/app/components/general/document/document-page-view-information.tsx
index d4607ca51..91dee53d1 100644
--- a/apps/remix/app/components/general/document/document-page-view-information.tsx
+++ b/apps/remix/app/components/general/document/document-page-view-information.tsx
@@ -7,6 +7,7 @@ import { DateTime } from 'luxon';
import { useIsMounted } from '@documenso/lib/client-only/hooks/use-is-mounted';
import type { TEnvelope } from '@documenso/lib/types/envelope';
+import { mapSecondaryIdToDocumentId } from '@documenso/lib/utils/envelope';
export type DocumentPageViewInformationProps = {
userId: number;
@@ -40,6 +41,10 @@ export const DocumentPageViewInformation = ({
.setLocale(i18n.locales?.[0] || i18n.locale)
.toRelative(),
},
+ {
+ description: msg`Document ID (Legacy)`,
+ value: mapSecondaryIdToDocumentId(envelope.secondaryId),
+ },
];
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isMounted, envelope, userId]);
diff --git a/apps/remix/app/components/general/template/template-page-view-information.tsx b/apps/remix/app/components/general/template/template-page-view-information.tsx
index 0b320cd11..41fb13b30 100644
--- a/apps/remix/app/components/general/template/template-page-view-information.tsx
+++ b/apps/remix/app/components/general/template/template-page-view-information.tsx
@@ -7,11 +7,13 @@ import type { User } from '@prisma/client';
import { DateTime } from 'luxon';
import { useIsMounted } from '@documenso/lib/client-only/hooks/use-is-mounted';
+import { mapSecondaryIdToTemplateId } from '@documenso/lib/utils/envelope';
export type TemplatePageViewInformationProps = {
userId: number;
template: {
userId: number;
+ secondaryId: string;
createdAt: Date;
updatedAt: Date;
user: Pick<User, 'id' | 'name' | 'email'>;
@@ -43,6 +45,10 @@ export const TemplatePageViewInformation = ({
.setLocale(i18n.locales?.[0] || i18n.locale)
.toRelative(),
},
+ {
+ description: msg`Template ID (Legacy)`,
+ value: mapSecondaryIdToTemplateId(template.secondaryId),
+ },
];
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isMounted, template, userId]);