Skip to content

Merge pull request #2192 from OpenSignLabs/updates-27678195317#2194

Open
nxglabs wants to merge 10 commits into
mainfrom
staging
Open

Merge pull request #2192 from OpenSignLabs/updates-27678195317#2194
nxglabs wants to merge 10 commits into
mainfrom
staging

Conversation

@nxglabs

@nxglabs nxglabs commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

raktima-opensignlabs and others added 10 commits May 15, 2026 15:44
Merge pull request #2459 from nxglabs/staging
Merge pull request #2460 from nxglabs/sync-to-public_repo-25861367352
Merge pull request #2462 from nxglabs/staging
Merge pull request #2463 from nxglabs/sync-to-public_repo-26032162086
Merge pull request #2466 from nxglabs/raktima-main-patch-5
Merge pull request #2467 from nxglabs/sync-to-public_repo-26233821722
Merge pull request #2473 from nxglabs/raktima-patch-main-6
Merge pull request #2474 from nxglabs/sync-to-public_repo-26403170706
Merge pull request #2575 from nxglabs/staging
Merge pull request #2576 from nxglabs/sync-to-public_repo-27677371306
Copilot AI review requested due to automatic review settings June 18, 2026 07:54
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 (stats.isDirectory()) {
const indexInDir = path.join(filePath, "index.html");
return fs.stat(indexInDir, (dirErr, dirStats) => {
@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
open-sign Ready Ready Preview, Comment Jun 18, 2026 7:54am

Copilot AI left a comment

Copy link
Copy Markdown

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 introduces stricter workflow/completion handling for signing flows, extends document/template metadata (CC, strict send-in-order, normalized email), consolidates server-side email sending, and ships multiple PDF/editor UX improvements in the web app (zoom/drag/gridlines/prefill handling), alongside dependency upgrades.

Changes:

  • Add workflow utilities and “SendInOrderStrict” gating/completion logic, plus supporting schema migrations.
  • Add normalizedEmail storage + unique index migration, and tighten authorization in several cloud functions.
  • Improve mail sending (CC support, centralized sendSystemMail) and enhance PDF/widget UX (pinch zoom, guidelines, prefill, acroform cleanup), plus dependency bumps and a new production static server.

Reviewed changes

Copilot reviewed 94 out of 101 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
apps/OpenSignServer/utils/workflowUtils.js Adds shared helpers for completion/strict-order placeholder & audit-trail logic.
apps/OpenSignServer/utils/CountUtils.js Updates document count logic to support incrementing by an arbitrary amount.
apps/OpenSignServer/package.json Dependency/version bumps and overrides updates for server app.
apps/OpenSignServer/migrationdb/index.js Adds the normalizedEmail unique-index migration to migration runner.
apps/OpenSignServer/migrationdb/createNormalizedEmailUnqiue.js Creates MongoDB unique index for _User.normalizedEmail and records migration.
apps/OpenSignServer/index.js Tightens file-path detection for /files/ routes.
apps/OpenSignServer/databases/migrations/20260430000000-add_sendinorderstrict_field.cjs Adds SendInOrderStrict field to document/template schemas.
apps/OpenSignServer/databases/migrations/20260402211408-add_normalizedemail.cjs Adds normalizedEmail field to _User schema.
apps/OpenSignServer/databases/migrations/20260317000000-create_contracts_templatelinks.cjs Creates contracts_templateLinks schema to store template-link placeholder data.
apps/OpenSignServer/databases/migrations/20260316120000-add_cc_field_cjs.cjs Adds Cc arrays to document/template schemas.
apps/OpenSignServer/cloud/parsefunction/usersignup.js Stores normalizedEmail during signup.
apps/OpenSignServer/cloud/parsefunction/updateTenant.js Adds server-side role/tenant authorization for tenant updates.
apps/OpenSignServer/cloud/parsefunction/TemplateAfterSave.js Enhances logging for template inserts by including object id.
apps/OpenSignServer/cloud/parsefunction/sendSystemMail.js Introduces a centralized mail sender (SMTP/Mailgun) used by other functions.
apps/OpenSignServer/cloud/parsefunction/sendMailWithAttachment.js Adds CC support and ensures SMTP transport closes in finally.
apps/OpenSignServer/cloud/parsefunction/sendMailv3.js Adds CC support and ensures SMTP transport closes in finally.
apps/OpenSignServer/cloud/parsefunction/sendMailGmailProvider.js Adds CC header support and improves error logging.
apps/OpenSignServer/cloud/parsefunction/saveAsTemplate.js Reuses shared randomId and adds strict-order + CC + widget normalization when saving templates.
apps/OpenSignServer/cloud/parsefunction/recreateDocument.js Excludes sensitive fields, resets widget responses/defaults, and updates document count.
apps/OpenSignServer/cloud/parsefunction/pdf/PDF.js Integrates workflow helpers, strict-order gating, CC support, and uses sendSystemMail.
apps/OpenSignServer/cloud/parsefunction/pdf/GenerateCertificate.js Improves certificate generation (assets path, sorting audit entries, pagination, NA signature).
apps/OpenSignServer/cloud/parsefunction/getUserListByOrg.js Adds tenant/org-based authorization for listing org users.
apps/OpenSignServer/cloud/parsefunction/GetTemplate.js Includes Cc pointer array when fetching templates.
apps/OpenSignServer/cloud/parsefunction/getSignedUrl.js Uses /files/ path matching for local presigned URL logic.
apps/OpenSignServer/cloud/parsefunction/getDrive.js Excludes large document fields to reduce payload size.
apps/OpenSignServer/cloud/parsefunction/generateCertificatebydocId.js Removes obsolete commented-out code in certificate upload flow.
apps/OpenSignServer/cloud/parsefunction/filterDocs.js Excludes large document fields to reduce payload size.
apps/OpenSignServer/cloud/parsefunction/DocumentAftersave.js Enhances logging for document inserts by including object id.
apps/OpenSignServer/cloud/parsefunction/declinedocument.js Uses sendSystemMail, prevents decline mail to creator, and blocks declines on completed/archived docs.
apps/OpenSignServer/cloud/parsefunction/createDuplicate.js Copies strict-order + CC fields when duplicating templates.
apps/OpenSignServer/cloud/parsefunction/createDocumentFromApp.js Adds a new cloud function to create documents from app payloads and update counts.
apps/OpenSignServer/cloud/parsefunction/createBatchDocs.js Adds sendSystemMail usage, strict-order, CC propagation, and improves send-in-order handling.
apps/OpenSignServer/cloud/parsefunction/addUser.js Adds server-side tenant/org/team authorization, role restrictions, and tightens ACL handling.
apps/OpenSignServer/cloud/main.js Registers the new createdocumentfromapp cloud function.
apps/OpenSignServer/cloud/customRoute/docxtopdf.js Captures uploaded file size for downstream usage/tracking.
apps/OpenSignServer/cloud/customRoute/deleteAccount/deleteUtils.js Uses sendSystemMail instead of axios for OTP email.
apps/OpenSignServer/cloud/customRoute/deleteAccount/deleteFileUrl.js Tightens local file deletion guard to /files/.
apps/OpenSign/src/utils/widgetUtils.js Minor refactor for signature-widget detection helper.
apps/OpenSign/src/utils/prefillUtils.js Uses signed URLs for prefill processing and adds templateLinks update helper.
apps/OpenSign/src/utils/acroFieldExtractor.js Adds acroform/widget annotation cleanup utilities for PDFs.
apps/OpenSign/src/styles/signature.css Updates styling for a signature-related element (drop-shadow).
apps/OpenSign/src/reports/template/TemplatesReport.jsx Improves email-not-verified UX, translations, and various UI cleanups.
apps/OpenSign/src/reports/document/DocumentsReport.jsx Similar email-not-verified UX, resend error modal, and decline now uses cloud function.
apps/OpenSign/src/primitives/PdfDeclineModal.jsx Simplifies markup and improves text rendering.
apps/OpenSign/src/primitives/ModalUi.jsx Adds id prop and visualViewport handling for bottom-sheet keyboard overlap.
apps/OpenSign/src/polyfills.js Adds crypto.randomUUID polyfill.
apps/OpenSign/src/pages/SignyourselfPdf.jsx Improves widget placement logic, reduces rerenders, and integrates scroll/zoom context.
apps/OpenSign/src/pages/Preferences.jsx Minor UI cleanup (removes tooltip wrapper).
apps/OpenSign/src/pages/PdfRequestFiles.jsx Adds scroll context, viewer-safe placeholder guards, improved decline state handling, and widget placement fixes.
apps/OpenSign/src/pages/Login.jsx Fixes indentation/formatting issue in a helper call.
apps/OpenSign/src/pages/Form.jsx Adds strict-order, CC support, and replaces PDF flattening with acroform cleanup + password checks.
apps/OpenSign/src/json/FormJson.js Enables CC field for both document and template forms.
apps/OpenSign/src/index.jsx Wraps app in ScrollProvider context.
apps/OpenSign/src/hook/usePdfPinchZoom.js Reworks pinch-zoom to avoid flicker by applying DOM transforms and committing state on touchend.
apps/OpenSign/src/context/ScrollPdfContext.jsx Adds shared scrollRef context used for zoom/scroll behavior.
apps/OpenSign/src/context/GuidelinesContext.jsx Refactors guidelines to use refs (no rerender) and adds canvas-level guidelines.
apps/OpenSign/src/constant/const.js Adds predefined SCALE_STEPS constants.
apps/OpenSign/src/components/shared/fields/SignersInput.jsx Renames z-index prop and adjusts z-index usage around tooltips/select.
apps/OpenSign/src/components/shared/fields/SelectSigners.jsx Extends props and stores return from handleAddUser.
apps/OpenSign/src/components/pdf/WidgetsValueModal.jsx Better focus behavior, correct widget-page association, and value syncing.
apps/OpenSign/src/components/pdf/WidgetsDragPreview.jsx Fixes drag preview positioning under scroll/zoom and refactors for clarity.
apps/OpenSign/src/components/pdf/WidgetNameModal.jsx Adds rotation setting for signature/initial widgets.
apps/OpenSign/src/components/pdf/WidgetComponent.jsx Small formatting cleanup in widget list.
apps/OpenSign/src/components/pdf/SignerListPlace.jsx Removes large commented-out tooltip block.
apps/OpenSign/src/components/pdf/RenderAllPdfPage.jsx Replaces flattening with acroform cleanup + password checks in PDF merge.
apps/OpenSign/src/components/pdf/RecipientList.jsx Adds missing useTranslation import/usage.
apps/OpenSign/src/components/pdf/PrefillWidgetsModal.jsx Sorting improvements and prefill image handling tweaks.
apps/OpenSign/src/components/pdf/PlaceholderType.jsx Adds rotation rendering and prefill-modal behavior changes for widget display.
apps/OpenSign/src/components/pdf/PlaceholderCopy.jsx Fixes dimension property names when copying placeholders.
apps/OpenSign/src/components/pdf/PdfTools.jsx Replaces flattening with acroform cleanup + password checks in tools.
apps/OpenSign/src/components/pdf/PdfHeader.jsx Refactors finish label usage and adds viewer-gating placeholders (currently hardcoded false).
apps/OpenSign/src/components/pdf/Guidelines.jsx Refactors guidelines to register refs into GuidelinesContext.
apps/OpenSign/src/components/pdf/EditTemplate.jsx Adds strict-order + CC to template edit flow and payload.
apps/OpenSign/src/components/pdf/DragGridLinesLayer.js Switches to canvas-level guideline drawing and corrects scaling under zoom.
apps/OpenSign/src/components/pdf/CanvasGuidelines.jsx Adds canvas-level guideline elements for cross-page drags.
apps/OpenSign/src/components/pdf/AddRoleModal.jsx Updates React import (currently includes unused useState).
apps/OpenSign/src/components/opensigndrive/DriveBody.jsx Wraps DriveBody export in memo() for performance.
apps/OpenSign/src/components/Header.jsx Minor formatting/indentation change.
apps/OpenSign/src/components/bulksend/components/PrefillWidgets.jsx Sorts prefill widgets by page and y-position.
apps/OpenSign/src/components/bulksend/BulkSendUi.jsx Uses shared signature-widget detection and improves email validation rules.
apps/OpenSign/server.cjs Adds a custom production static server with SPA fallback while preserving dotfile paths.
apps/OpenSign/public/serve.json Adds serve rewrites excluding /.well-known/.
apps/OpenSign/package.json Dependency upgrades, removes serve from start, and uses custom server.cjs.

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

Comment on lines 7 to 9
async function saveUser(userDetails) {
const normalizedEmail = normalizeEmail(userDetails.email.toLowerCase().replace(/\s/g, ''));
const userQuery = new Parse.Query(Parse.User);
Comment on lines +28 to +32
docCls.set('Name', doc?.Name || 'untitled document');
docCls.set('URL', doc?.URL);
docCls.set('ExtUserPtr', doc.ExtUserPtr);
docCls.set('CreatedBy', doc.CreatedBy);

Comment on lines +91 to +93
// update documentCount in Users and tenant account
setDocumentCount(doc?.ExtUserPtr?.id);

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 +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 +1 to +2
import { PDFDocument } from "pdf-lib";

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 156 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}]`}
>
Comment on lines 1 to 4
import createContactIndex from './createContactIndex.js';
import createDocumentIndex from './createDocumentIndex.js';
import createNormalizedEmailUnique from './createNormalizedEmailUnqiue.js';

@@ -1,4 +1,4 @@
import React from "react";
import React, { useState } from "react";
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.

4 participants