Conversation
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
| res.writeHead(200, headers); | ||
| return res.end(); | ||
| } | ||
| const stream = fs.createReadStream(filePath); |
| return res.end("Bad Request"); | ||
| } | ||
|
|
||
| fs.stat(filePath, (err, stats) => { |
| } | ||
| if (stats.isDirectory()) { | ||
| const indexInDir = path.join(filePath, "index.html"); | ||
| return fs.stat(indexInDir, (dirErr, dirStats) => { |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
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"; | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.