Skip to content

Conversation

@RishabhS7
Copy link
Contributor

@RishabhS7 RishabhS7 commented Sep 11, 2025

Summary

Redirect buttons to new v2 documents

Summary by CodeRabbit

  • New Features

    • Added support for additional OA (Legacy) document statuses across CO, EPN, BOL, INV, and WHR.
  • Chores

    • W3C VC documents now load from a versioned v2.0 dataset, improving consistency and alignment with updated data layouts. No UI or workflow changes.

@netlify
Copy link

netlify bot commented Sep 11, 2025

Deploy Preview for tradetrust-gallery ready!

Name Link
🔨 Latest commit 6c80f55
🔍 Latest deploy log https://app.netlify.com/projects/tradetrust-gallery/deploys/68c28a8a5d2edc0008340c50
😎 Deploy Preview https://deploy-preview-24--tradetrust-gallery.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link

coderabbitai bot commented Sep 11, 2025

Walkthrough

Updated document-to-file mappings in src/data/DocumentsData.ts: W3C entries now reference versioned w3c/v2_0/ paths; OA (Legacy) mappings were extended with additional status variants under OA/. No functional logic changed; only asset path targets were updated.

Changes

Cohort / File(s) Summary
Document data mapping updates
src/data/DocumentsData.ts
Pointed non-OA W3C mappings to w3c/v2_0/... JSON files. Added multiple OA legacy mappings (e.g., *_oa variants) referencing OA/.... No changes to functions or return types; only path mappings updated.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • rongquan1

Pre-merge checks (2 passed, 1 warning)

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The current description only provides a one-line Summary ("Redirect buttons to new v2 documents") and is missing the repository's required sections ('Changes', 'Issues', and 'Releases'); it should explicitly list the DocumentsData.ts mapping updates (W3C entries -> w3c/v2_0 and added OA legacy entries), state that exported APIs/signatures were not changed, and include related issue references and release timing. Please expand the PR description to follow the template: add a "Changes" section describing the file/path mapping updates and that control flow and public signatures are unchanged, an "Issues" section linking any related issue or story IDs, and a "Releases" section stating the target channel (e.g., latest) and ETA; including brief testing/impact notes will speed review.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title "fix: link new documents to frontend buttons" is concise and accurately reflects the primary change—redirecting frontend buttons to new document assets (the PR updates DocumentsData mappings to point W3C entries to w3c/v2_0 and extends OA legacy mappings). It is focused, task-oriented, and clear for a teammate scanning history.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Poem

I twitch my whiskers, hop with glee,
New paths mapped neatly, v2_0 we see.
OA keeps its vintage glow,
While versioned routes now clearly flow.
Thump-thump! I stamp a tidy beat—
JSON trails, precise and sweet. 🐇✨

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/link-v2-docs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/data/DocumentsData.ts (1)

68-76: Guard decodeOAString to avoid blank results for normal URLs.
Current logic returns '' for values like 'https://...'. Decode only when an 'oa::' shape is detected.

-const decodeOAString = (value: string) => {
-  try {
-    const parts = value.split(':');
-    const encodedPart = parts.slice(2).join(':');
-    return decodeURIComponent(encodedPart);
-  } catch {
-    return value;
-  }
-};
+const decodeOAString = (value: string) => {
+  try {
+    const parts = value.split(':');
+    if (parts.length < 3) return value; // already a normal URL (e.g., https://...)
+    const encodedPart = parts.slice(2).join(':');
+    const decoded = decodeURIComponent(encodedPart);
+    return decoded || value;
+  } catch {
+    return value;
+  }
+};
🧹 Nitpick comments (2)
src/data/DocumentsData.ts (2)

28-41: DRY the 'w3c/v2_0' base path and verify asset availability.
Makes future version bumps trivial; also confirm these files are deployed under /static.

Add a base constant (outside this block):

const W3C_BASE = 'w3c/v2_0';

Apply within this block (illustrative subset):

-    coo_default: 'w3c/v2_0/certificate-of-origin-default.json',
+    coo_default: `${W3C_BASE}/certificate-of-origin-default.json`,
-    inv_expired: 'w3c/v2_0/invoice-expired.json',
+    inv_expired: `${W3C_BASE}/invoice-expired.json`,

218-220: Typo in alt text: “Reciept” → “Receipt”.
Minor UX polish; safe to change without touching the image filename.

-      imageAlt: 'Warehouse Reciept',
+      imageAlt: 'Warehouse Receipt',
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bcf5a49 and 6c80f55.

📒 Files selected for processing (1)
  • src/data/DocumentsData.ts (1 hunks)
🔇 Additional comments (1)
src/data/DocumentsData.ts (1)

28-41: LGTM: W3C mappings now point to versioned v2_0 assets.
These updates align with the PR goal to redirect buttons to the new docs.

@RishabhS7 RishabhS7 merged commit be67b67 into main Sep 11, 2025
6 checks passed
@RishabhS7 RishabhS7 deleted the fix/link-v2-docs branch September 11, 2025 09:15
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.

3 participants