mirror of
https://github.com/documenso/documenso.git
synced 2026-06-22 04:12:06 +10:00
feat: add envelope ids to certs (#2733)
This commit is contained in:
@@ -142,6 +142,7 @@ export const generateCertificatePdf = async (options: GenerateCertificatePdfOpti
|
||||
};
|
||||
}),
|
||||
envelopeOwner,
|
||||
envelopeId: envelope.id,
|
||||
qrToken: envelope.qrToken,
|
||||
hidePoweredBy: organisationClaim.flags.hidePoweredBy ?? false,
|
||||
pageWidth,
|
||||
|
||||
@@ -57,7 +57,7 @@ const textXs = 8;
|
||||
const fontMedium = '500';
|
||||
|
||||
const pageTopMargin = 60;
|
||||
const pageBottomMargin = 15;
|
||||
const pageBottomMargin = 27;
|
||||
const contentMaxWidth = 768;
|
||||
const rowPadding = 10;
|
||||
const titleFontSize = 18;
|
||||
@@ -595,7 +595,7 @@ export async function renderAuditLogs({
|
||||
|
||||
const groupedRows = groupRowsIntoPages({
|
||||
auditLogs,
|
||||
maxHeight: pageHeight,
|
||||
maxHeight: pageHeight - pageBottomMargin,
|
||||
contentWidth,
|
||||
i18n,
|
||||
overviewCard,
|
||||
@@ -622,6 +622,16 @@ export async function renderAuditLogs({
|
||||
stage.destroyChildren();
|
||||
const page = new Konva.Layer();
|
||||
|
||||
const footerText = new Konva.Text({
|
||||
x: margin,
|
||||
y: pageHeight - textXs - 10,
|
||||
text: `${i18n._(msg`Envelope ID`)}: ${envelope.id}`,
|
||||
fontFamily: 'Inter',
|
||||
fontSize: textXs,
|
||||
fill: textMutedForegroundLight,
|
||||
});
|
||||
page.add(footerText);
|
||||
|
||||
page.add(pageGroup);
|
||||
|
||||
// Add branding on the last page if there is space.
|
||||
@@ -657,6 +667,16 @@ export async function renderAuditLogs({
|
||||
y: pageTopMargin,
|
||||
} satisfies Partial<Konva.GroupConfig>);
|
||||
|
||||
const overflowFooterText = new Konva.Text({
|
||||
x: margin,
|
||||
y: pageHeight - textXs - 10,
|
||||
text: `${i18n._(msg`Envelope ID`)}: ${envelope.id}`,
|
||||
fontFamily: 'Inter',
|
||||
fontSize: textXs,
|
||||
fill: textMutedForegroundLight,
|
||||
});
|
||||
page.add(overflowFooterText);
|
||||
|
||||
page.add(brandingGroup);
|
||||
stage.add(page);
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ export type CertificateRecipient = {
|
||||
|
||||
type GenerateCertificateOptions = {
|
||||
recipients: CertificateRecipient[];
|
||||
envelopeId: string;
|
||||
qrToken: string | null;
|
||||
hidePoweredBy: boolean;
|
||||
i18n: I18n;
|
||||
@@ -88,7 +89,7 @@ const columnWidthPercentages = [30, 30, 40];
|
||||
const rowPadding = 12;
|
||||
const tableHeaderHeight = 38;
|
||||
const pageTopMargin = 72;
|
||||
const pageBottomMargin = 12;
|
||||
const pageBottomMargin = 24;
|
||||
const contentMaxWidth = 768;
|
||||
|
||||
const titleFontSize = 18;
|
||||
@@ -717,6 +718,7 @@ const renderTables = (options: RenderTablesOptions) => {
|
||||
|
||||
export async function renderCertificate({
|
||||
recipients,
|
||||
envelopeId,
|
||||
qrToken,
|
||||
hidePoweredBy,
|
||||
i18n,
|
||||
@@ -802,6 +804,16 @@ export async function renderCertificate({
|
||||
}
|
||||
}
|
||||
|
||||
const footerText = new Konva.Text({
|
||||
x: margin,
|
||||
y: pageHeight - textXs - 10,
|
||||
text: `${i18n._(msg`Envelope ID`)}: ${envelopeId}`,
|
||||
fontFamily: 'Inter',
|
||||
fontSize: textXs,
|
||||
fill: textMutedForegroundLight,
|
||||
});
|
||||
page.add(footerText);
|
||||
|
||||
page.add(group);
|
||||
stage.add(page);
|
||||
|
||||
@@ -820,6 +832,16 @@ export async function renderCertificate({
|
||||
y: pageTopMargin / 2, // Less padding since there's nothing else on this page.
|
||||
} satisfies Partial<Konva.GroupConfig>);
|
||||
|
||||
const overflowFooterText = new Konva.Text({
|
||||
x: margin,
|
||||
y: pageHeight - textXs - 10,
|
||||
text: `${i18n._(msg`Envelope ID`)}: ${envelopeId}`,
|
||||
fontFamily: 'Inter',
|
||||
fontSize: textXs,
|
||||
fill: textMutedForegroundLight,
|
||||
});
|
||||
page.add(overflowFooterText);
|
||||
|
||||
page.add(brandingGroup);
|
||||
stage.add(page);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user