fix: link new documents to frontend buttons#24
Conversation
✅ Deploy Preview for tradetrust-gallery ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
WalkthroughUpdated 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Pre-merge checks (2 passed, 1 warning)❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Poem
✨ Finishing touches
🧪 Generate unit tests
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. Comment |
There was a problem hiding this comment.
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
📒 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.
Summary
Redirect buttons to new v2 documents
Summary by CodeRabbit
New Features
Chores