Skip to content

Merge pull request #2460 from nxglabs/sync-to-public_repo-25861367352#2175

Open
nxglabs wants to merge 1 commit into
stagingfrom
updates-25926972891
Open

Merge pull request #2460 from nxglabs/sync-to-public_repo-25861367352#2175
nxglabs wants to merge 1 commit into
stagingfrom
updates-25926972891

Conversation

@nxglabs
Copy link
Copy Markdown
Collaborator

@nxglabs nxglabs commented May 15, 2026

Merge pull request #2459 from nxglabs/staging

Merge pull request #2459 from nxglabs/staging
Copilot AI review requested due to automatic review settings May 15, 2026 15:44
@vercel
Copy link
Copy Markdown

vercel Bot commented May 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
open-sign Ready Ready Preview, Comment May 15, 2026 3:45pm

Comment thread apps/OpenSign/server.cjs
res.writeHead(200, headers);
return res.end();
}
const stream = fs.createReadStream(filePath);
Comment thread apps/OpenSign/server.cjs
return res.end("Bad Request");
}

fs.stat(filePath, (err, stats) => {
Comment thread apps/OpenSign/server.cjs
}
if (!err && stats.isDirectory()) {
const indexInDir = path.join(filePath, "index.html");
return fs.stat(indexInDir, (e, s) => {
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR syncs a broad set of OpenSign server + web-app changes into the public repo, including new workflow helpers, document/template metadata additions (CC + strict send-in-order), email sending refactors, PDF/signing UX improvements, migrations, and dependency updates.

Changes:

  • Add strict-order + CC support across server/cloud functions, templates, documents, and related migrations; introduce normalized email field + Mongo unique index migration.
  • Refactor some email sending paths to use a shared sendSystemMail implementation and add additional signing/PDF handling improvements (certificate generation, prefill PDF signed-url handling, AcroForm clearing).
  • Update web-app UX/performance (pinch-zoom, guidelines rendering approach, widget rotation, modal keyboard positioning) and update dependencies / production serving.

Reviewed changes

Copilot reviewed 85 out of 92 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
apps/OpenSignServer/utils/workflowUtils.js New workflow helpers/constants for completion + strict-order logic.
apps/OpenSignServer/utils/CountUtils.js Extend document count updates to support bulk increments.
apps/OpenSignServer/package.json Dependency version bumps for server.
apps/OpenSignServer/migrationdb/index.js Register new Mongo migration for normalizedEmail unique index.
apps/OpenSignServer/migrationdb/createNormalizedEmailUnqiue.js Create unique Mongo index on _User.normalizedEmail.
apps/OpenSignServer/index.js Tighten file-path detection for /files/ routes.
apps/OpenSignServer/databases/migrations/20260430000000-add_sendinorderstrict_field.cjs Add SendInOrderStrict boolean field to document/template schemas.
apps/OpenSignServer/databases/migrations/20260402211408-add_normalizedemail.cjs Add _User.normalizedEmail string field.
apps/OpenSignServer/databases/migrations/20260317000000-create_contracts_templatelinks.cjs Create contracts_templateLinks class for template link storage.
apps/OpenSignServer/databases/migrations/20260316120000-add_cc_field_cjs.cjs Add Cc array field to document/template schemas.
apps/OpenSignServer/cloud/parsefunction/usersignup.js Populate normalizedEmail at signup time.
apps/OpenSignServer/cloud/parsefunction/TemplateAfterSave.js Log template creation with object id.
apps/OpenSignServer/cloud/parsefunction/sendSystemMail.js New shared system email sender (SMTP/Mailgun).
apps/OpenSignServer/cloud/parsefunction/sendMailWithAttachment.js Add CC support + ensure SMTP transport is closed.
apps/OpenSignServer/cloud/parsefunction/sendMailv3.js Add CC support + ensure SMTP transport is closed.
apps/OpenSignServer/cloud/parsefunction/sendMailGmailProvider.js Add CC header support; improve error logging.
apps/OpenSignServer/cloud/parsefunction/saveAsTemplate.js Carry CC + strict-order; normalize widget fields when templating.
apps/OpenSignServer/cloud/parsefunction/recreateDocument.js Exclude sensitive fields; normalize placeholder widget data; update counts.
apps/OpenSignServer/cloud/parsefunction/pdf/PDF.js Use workflow helpers for completion counting; CC support; mail sending refactor.
apps/OpenSignServer/cloud/parsefunction/pdf/GenerateCertificate.js Improve date handling, audit ordering, pagination, and signature fallbacks.
apps/OpenSignServer/cloud/parsefunction/GetTemplate.js Include Cc pointers when fetching templates.
apps/OpenSignServer/cloud/parsefunction/getSignedUrl.js Tighten /files/ detection for local presigned URLs.
apps/OpenSignServer/cloud/parsefunction/generateCertificatebydocId.js Remove commented-out legacy Parse.File upload code.
apps/OpenSignServer/cloud/parsefunction/DocumentAftersave.js Log document creation with object id.
apps/OpenSignServer/cloud/parsefunction/declinedocument.js Use sendSystemMail; avoid decline mail to creator; exclude archived/completed.
apps/OpenSignServer/cloud/parsefunction/createDuplicate.js Carry CC + strict-order when duplicating templates.
apps/OpenSignServer/cloud/parsefunction/createDocumentFromApp.js New cloud function to create a document from app-provided payload.
apps/OpenSignServer/cloud/parsefunction/createBatchDocs.js Use sendSystemMail; add CC + strict-order; bulk document count updates.
apps/OpenSignServer/cloud/main.js Register createdocumentfromapp cloud function.
apps/OpenSignServer/cloud/customRoute/deleteAccount/deleteUtils.js Use sendSystemMail instead of axios call to cloud function.
apps/OpenSignServer/cloud/customRoute/deleteAccount/deleteFileUrl.js Tighten /files/ detection for local file deletions.
apps/OpenSign/src/utils/widgetUtils.js Minor helper refactor; improve mail modal title logic.
apps/OpenSign/src/utils/prefillUtils.js Use signed URL for PDF prefill processing; add template-links updater.
apps/OpenSign/src/utils/acroFieldExtractor.js Add AcroForm/widget annotation clearing and encrypted PDF check helper.
apps/OpenSign/src/styles/signature.css Adjust signature block styling (drop-shadow).
apps/OpenSign/src/reports/template/TemplatesReport.jsx Add email-not-verified UX, translation usage cleanup, minor UI tweaks.
apps/OpenSign/src/reports/document/DocumentsReport.jsx Use decline cloud function; add email-not-verified UX + modal; variable cleanup.
apps/OpenSign/src/primitives/PdfDeclineModal.jsx Small markup simplification for decline modal body.
apps/OpenSign/src/primitives/ModalUi.jsx Add id prop; visualViewport bottom-sheet keyboard handling.
apps/OpenSign/src/polyfills.js Add crypto.randomUUID polyfill.
apps/OpenSign/src/pages/SignyourselfPdf.jsx Improve widget placement across pages; zoom behavior; reduce recomputation.
apps/OpenSign/src/pages/Preferences.jsx Remove tooltip in header; whitespace cleanup.
apps/OpenSign/src/pages/PdfRequestFiles.jsx Viewer/approver guards; decline handling; widget/page behavior improvements.
apps/OpenSign/src/pages/Login.jsx Fix indentation in handleUserExist.
apps/OpenSign/src/pages/Form.jsx Add strict-order + CC; switch PDF preprocessing to AcroForm clearing; better error handling.
apps/OpenSign/src/json/FormJson.js Enable CC field in document/template form configs.
apps/OpenSign/src/index.jsx Wrap app in ScrollProvider.
apps/OpenSign/src/hook/usePdfPinchZoom.js Rework pinch-zoom to be flicker-free via direct DOM transforms.
apps/OpenSign/src/context/ScrollPdfContext.jsx New context providing a shared scrollRef.
apps/OpenSign/src/context/GuidelinesContext.jsx Rework guidelines to use refs and avoid re-renders during drag/resize.
apps/OpenSign/src/constant/const.js Add SCALE_STEPS list.
apps/OpenSign/src/components/shared/fields/SignersInput.jsx Rename z-index prop and apply to tooltip/select wrapper.
apps/OpenSign/src/components/shared/fields/SelectSigners.jsx Extend props and minor add-handler adjustment.
apps/OpenSign/src/components/pdf/WidgetsValueModal.jsx Focus without scroll; robust radio option labels; widget navigation updates.
apps/OpenSign/src/components/pdf/WidgetsDragPreview.jsx Fix drag preview positioning relative to scroll/zoom.
apps/OpenSign/src/components/pdf/WidgetNameModal.jsx Add rotation option for signature/initial widgets.
apps/OpenSign/src/components/pdf/SignerListPlace.jsx Remove large commented block.
apps/OpenSign/src/components/pdf/RenderAllPdfPage.jsx Switch PDF preprocessing to AcroForm clearing; better encrypted handling.
apps/OpenSign/src/components/pdf/RecipientList.jsx Add missing useTranslation import.
apps/OpenSign/src/components/pdf/PrefillWidgetsModal.jsx Adjust prefill image state handling; avoid reset on mount; unique input ids.
apps/OpenSign/src/components/pdf/PlaceholderType.jsx Add rotation rendering; improve radio/checkbox sizing; prefill-modal display guards.
apps/OpenSign/src/components/pdf/PlaceholderCopy.jsx Fix copied placeholder width/height key casing.
apps/OpenSign/src/components/pdf/PdfTools.jsx Switch PDF preprocessing to AcroForm clearing; better encrypted handling/logging.
apps/OpenSign/src/components/pdf/PdfHeader.jsx Prepare gating for viewer roles; minor constant extraction.
apps/OpenSign/src/components/pdf/Guidelines.jsx Switch to ref-based guideline registration per page.
apps/OpenSign/src/components/pdf/EditTemplate.jsx Add strict-order + CC editing support.
apps/OpenSign/src/components/pdf/DragGridLinesLayer.js Rework guidelines for accurate drag positioning under zoom/scroll.
apps/OpenSign/src/components/pdf/CanvasGuidelines.jsx New canvas-level guideline overlay spanning pages.
apps/OpenSign/src/components/pdf/AddRoleModal.jsx Add useState import (currently unused).
apps/OpenSign/src/components/Header.jsx Indentation tweak around FullScreenButton.
apps/OpenSign/src/components/bulksend/BulkSendUi.jsx Use shared hasSignatureWidget helper; comment updates.
apps/OpenSign/server.cjs Add a small Node static server for build/ with SPA fallback and .well-known handling.
apps/OpenSign/public/serve.json Configure serve-style rewrites excluding .well-known.
apps/OpenSign/public/locales/es/translation.json Add new strings (strict order, CC, email verification, offline signing, etc.).
apps/OpenSign/public/locales/en/translation.json Add new strings (strict order, CC, email verification, etc.).
apps/OpenSign/package.json Dependency bumps; replace serve -s build with node server.cjs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +17 to +21
// A placeholder participates in completion unless it is a prefill entry or a viewer.
export function isCompletionRelevant(placeholder) {
if (!isParticipantBasic(placeholder)) return false;
return true;
}
Comment on lines +9 to +16
if (docsCount) {
const count = contractUser.get('DocumentCount')
? contractUser.get('DocumentCount') + Number(docsCount)
: 0 + Number(docsCount);
contractUser.set('DocumentCount', count);
} else {
contractUser.increment('DocumentCount', 1);
}
Comment on lines 1 to 4
import createContactIndex from './createContactIndex.js';
import createDocumentIndex from './createDocumentIndex.js';
import createNormalizedEmailUnique from './createNormalizedEmailUnqiue.js';

Comment on lines +20 to +42
if (migrationExists) {
console.log(' INFO The unqiue index for normalizedEmail is already present.');
return;
}

const collection = database.collection('_User');

// Create the unique index, but only on documents where NormalizedEmail exists
await collection.createIndex({ normalizedEmail: 1 }, { unique: true, sparse: true });

// Save the migration record in the migrationdb collection
await migrationCollection.insertOne({
_id: generateId(10),
name: migrationName,
_created_at: new Date(),
_updated_at: new Date(),
executedAt: new Date(),
details: 'Created unique index on NormalizedEmail',
});

console.log(' SUCCESS The unqiue index for normalizedEmail is already created.');
} catch (error) {
console.log(' ERROR Running unqiue index for normalizedEmail migration:', error);
Comment on lines 7 to 10
async function saveUser(userDetails) {
const normalizedEmail = normalizeEmail(userDetails.email.toLowerCase().replace(/\s/g, ''));
const userQuery = new Parse.Query(Parse.User);
userQuery.equalTo('username', userDetails.email);
Comment on lines +1 to +10
import { PDFDocument } from "pdf-lib";

export const clearAcroFields = async (pdfFile) => {
const pdfDoc = await PDFDocument.load(pdfFile, { ignoreEncryption: true });

try {
const acroFormEntry = pdfDoc.catalog.get(PDFName.of("AcroForm"));
const acroForm = pdfDoc.context.lookupMaybe
? pdfDoc.context.lookupMaybe(acroFormEntry)
: pdfDoc.context.lookup(acroFormEntry);
Comment on lines +13 to +22
// 🔐 Polyfill crypto.randomUUID for non-secure contexts (LAN IP, old browsers)
if (typeof globalThis.crypto === "undefined") {
globalThis.crypto = {};
}

if (!globalThis.crypto.randomUUID) {
globalThis.crypto.randomUUID = function () {
const bytes = new Uint8Array(16);
crypto.getRandomValues(bytes);

Comment on lines 154 to +168
@@ -163,7 +163,9 @@ const SignersInput = (props) => {
</span>
</label>
<div className="flex gap-x-[5px]">
<div className="w-full z-40">
<div
className={`w-full z-[${props?.zindex ? props.zindex : 40}]`}
>
@@ -1,4 +1,4 @@
import React from "react";
import React, { useState } from "react";
Comment on lines +404 to 407
// Approved entries also count toward audit trail completion summary.
const audittrailData = documentData?.[0]?.AuditTrail?.filter(
(data) => data.Activity === "Signed"
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants