Skip to content

Address CLM review feedback: deduplicate routes/forms, fix agreement variable declarations, and harden template create null checks#96

Merged
DavidEGutierrez merged 4 commits into
feature-added-clm-demofrom
copilot/sub-pr-94-again
Jun 4, 2026
Merged

Address CLM review feedback: deduplicate routes/forms, fix agreement variable declarations, and harden template create null checks#96
DavidEGutierrez merged 4 commits into
feature-added-clm-demofrom
copilot/sub-pr-94-again

Conversation

Copilot AI commented May 15, 2026

Copy link
Copy Markdown
Contributor

Description

This stacked PR addresses review feedback on feature-added-clm-demo: duplication in CLM app/blog-post flows, agreement create variable declaration issues, and unsafe optional-chaining usage that could throw at runtime.

  • Route/resource deduplication (App/AppContent)

    • Removed duplicated agreements resource/route definitions.
    • Moved route rendering to AppContent and kept App focused on Refine wiring + resources.
  • Blog post form deduplication

    • Extracted shared create/edit form fields into src/pages/blog-posts/form.tsx.
    • Updated create.tsx and edit.tsx to consume the shared component.
  • Agreement create variable declaration cleanup

    • Renamed Math destructure alias to PDFNetMath in src/pages/agreements/create.tsx.
    • Replaced remaining var declarations at the signature rectangle creation block with const.
  • Template create optional-chaining safety

    • Replaced unsafe wvInstance.current?.Core! usage with explicit guards before access.
const documentViewer = wvInstance.current?.Core?.documentViewer;
if (!documentViewer) return;

const document = documentViewer.getDocument();
if (!document) return;

Resources

Checklist

  • I understand that this is a public repo and my changes will be publicly visible

If you are adding a new sample

  • I have added an entry to the root level README
  • The name of my sample is consistent with the other samples
  • I have added a README to my sample
  • The sample is fully functional
  • I have updated lerna.json with the new sample name

If you are removing an old sample

  • I have removed the entry from the root level README
  • I have removed the sample from lerna.json

Copilot AI commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • telemetry.refine.dev
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/webviewer-samples/webviewer-samples/webviewer-clm/node_modules/.bin/refine build (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/webviewer-samples/webviewer-samples/webviewer-clm/node_modules/.bin/refine dev --host 127.0.0.1 --port 4173 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] [WIP] Address feedback on duplicated lines and variable naming in clm demo feature Address CLM review feedback: deduplicate routes/forms, rename Math alias, and harden template create null checks May 15, 2026
Copilot AI requested a review from DavidEGutierrez May 15, 2026 18:49
@DavidEGutierrez DavidEGutierrez marked this pull request as ready for review May 15, 2026 18:52

@DavidEGutierrez DavidEGutierrez left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@copilot to fix the reported issue

Check failure on line R128
Unexpected var, use let or const instead.
Check failure: Unexpected var, use let or const instead.

See more on https://sonarcloud.io/project/issues?id=ApryseSDK_webviewer-samples&issues=AZ4s-FBMV3FK4CNcMeUo&open=AZ4s-FBMV3FK4CNcMeUo&pullRequest=96

Comment thread webviewer-clm/src/pages/agreements/create.tsx Outdated
Copilot AI and others added 2 commits May 15, 2026 18:57

Copilot AI commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

@copilot to fix the reported issue

Check failure on line R128...

Fixed in commits 6553a26 and 986bbb0 by replacing the var declarations at the reported line with const (and keeping the same behavior). Screenshot: https://github.com/user-attachments/assets/65cd46c3-a333-4faf-b1cb-c033cbe20d6e

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • telemetry.refine.dev
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/webviewer-samples/webviewer-samples/webviewer-clm/node_modules/.bin/refine build (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/webviewer-samples/webviewer-samples/webviewer-clm/node_modules/.bin/refine build r (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@sonarqubecloud

Copy link
Copy Markdown

Copilot AI changed the title Address CLM review feedback: deduplicate routes/forms, rename Math alias, and harden template create null checks Address CLM review feedback: deduplicate routes/forms, fix agreement variable declarations, and harden template create null checks May 15, 2026
Copilot AI requested a review from DavidEGutierrez May 15, 2026 19:01

@DavidEGutierrez DavidEGutierrez left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@copilot add webviewer-clm/.gitignore‎ with the following contents:

Logs

logs
.log
npm-debug.log

yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

Editor directories and files

.vscode/_
!.vscode/extensions.json
.idea
.DS_Store
_.suo
.ntvs
_.njsproj
_.sln
*.sw?

WebViewer library files (auto-copied at build time by tools/copy-webviewer-files.cjs)

public/webviewer/lib/

Copilot AI commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

@copilot add webviewer-clm/.gitignore‎ with the following contents:

Logs...

Already in place in commit 32c17dd: webviewer-clm/.gitignore exists with the exact requested content, including public/webviewer/lib/. Screenshot: https://github.com/user-attachments/assets/65cd46c3-a333-4faf-b1cb-c033cbe20d6e

@DavidEGutierrez DavidEGutierrez left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good

@DavidEGutierrez DavidEGutierrez requested a review from jgozner May 15, 2026 19:13
@DavidEGutierrez DavidEGutierrez merged commit 2f94f17 into feature-added-clm-demo Jun 4, 2026
3 checks passed
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.

2 participants