-
Notifications
You must be signed in to change notification settings - Fork 72
work on BPMN #1736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
work on BPMN #1736
Conversation
|
Warning Rate limit exceeded@dbarzin has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 4 minutes and 26 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (4)
WalkthroughAdds return type hints to BPMNController methods, corrects a BPMN translation key, fixes mismatched icon HTML in the admin sidebar, updates the built asset mapping in the manifest, and registers pdfMake fonts in the frontend JS. Changes
Sequence Diagram(s)(No sequence diagram provided — changes are structural and small adjustments to signatures, assets, translations, and markup rather than new control-flow.) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to data retention organization setting
📒 Files selected for processing (2)
public/build/manifest.json(1 hunks)resources/js/app.js(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- public/build/manifest.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Analyze (javascript-typescript)
resources/js/app.js
Outdated
| // Import fonts | ||
| import pdfMake from 'pdfmake/build/pdfmake'; | ||
| import pdfFonts from 'pdfmake/build/vfs_fonts'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Critical: Duplicate pdfmake import creates ambiguity.
Line 9 already imports pdfmake from the package root, but line 38 imports pdfMake (with different casing) from a specific build path. This creates confusion about which import is authoritative and may lead to unexpected behavior.
Recommended fix: Remove the duplicate import and use a consistent naming approach. Based on common pdfmake usage patterns, consolidate to a single import:
-// Import fonts
-import pdfMake from 'pdfmake/build/pdfmake';
-import pdfFonts from 'pdfmake/build/vfs_fonts';
+// Import fonts for pdfMake
+import pdfFonts from 'pdfmake/build/vfs_fonts';Then update line 45 to use the existing pdfmake import:
-pdfMake.vfs = pdfFonts.vfs ?? pdfFonts.default?.vfs;
+pdfmake.vfs = pdfFonts.vfs ?? pdfFonts.default?.vfs;However, verify the correct import pattern for pdfmake 0.2.18 first, as the package structure may have specific requirements.
🏁 Script executed:
#!/bin/bash
# Verify the correct import pattern and font setup for pdfmake 0.2.18
# Check package.json for pdfmake version
cat package.json | jq '.dependencies.pdfmake, .devDependencies.pdfmake'
# Look for other usages of pdfmake/pdfMake in the codebase
rg -n "import.*pdfmake" --type=js
# Check if there are any configuration files or documentation about pdfmake setup
fd -e js -e md -e txt README pdfmakeLength of output: 93759
Based on my verification of the correct pdfMake import pattern for browser/ES6 modules, which requires `import pdfMake from "pdfmake/build/pdfmake"` and `pdfMake.vfs = pdfFonts.pdfMake.vfs`, the review comment identifies a real issue but requires refinement:
**Remove duplicate pdfmake import and correct font vfs assignment.**
Line 9's `import pdfmake from 'pdfmake'` is incorrect for browser usage—it's the server-side Node.js entry point, not for ES6 browser modules. Line 38's import from `'pdfmake/build/pdfmake'` is correct. Additionally, line 45's font assignment should use `pdfFonts.pdfMake.vfs` not `pdfFonts.vfs`, as confirmed in the pdfmake-font-generator documentation pattern.
**Fix required at line 9:** Remove the entire import statement.
**Fix required at line 45:** Change `pdfMake.vfs = pdfFonts.vfs ?? pdfFonts.default?.vfs;` to `pdfMake.vfs = pdfFonts.pdfMake.vfs;`
---
🌐 Web query:
```web
pdfmake 0.2.18 correct import and fonts setup
💡 Result:
Use the pdfmake 0.2.x docs approach. Minimal working examples:
Client (browser / ES module)
- import pdfMake and the built vfs fonts, then attach the vfs:
import pdfMake from 'pdfmake/build/pdfmake';
import pdfFonts from 'pdfmake/build/vfs_fonts';
pdfMake.vfs = pdfFonts.pdfMake.vfs; - register custom font metadata (optional) before createPdf:
pdfMake.addFonts({
MyFont: {
normal: 'MyFont-Regular.ttf',
bold: 'MyFont-Bold.ttf',
italics: 'MyFont-Italic.ttf',
bolditalics: 'MyFont-BoldItalic.ttf'
}
}); - use in docDefinition: defaultStyle: { font: 'MyFont' } then pdfMake.createPdf(docDefinition).download();
Alternate client import (TypeScript / older examples)
import * as pdfMake from 'pdfmake/build/pdfmake';
import * as pdfFonts from 'pdfmake/build/vfs_fonts';
(pdfMake as any).addVirtualFileSystem(pdfFonts);
Server (Node)
- Use the PdfPrinter constructor and point to real font file paths:
import PdfPrinter from 'pdfmake';
const printer = new PdfPrinter({
Roboto: {
normal: './fonts/Roboto-Regular.ttf',
bold: './fonts/Roboto-Medium.ttf',
italics: './fonts/Roboto-Italic.ttf',
bolditalics: './fonts/Roboto-MediumItalic.ttf'
}
});
Notes
- For client-side custom fonts generate a vfs bundle (build-vfs.js) and include it (or use tools like pdfmake-font-generator).
- If using bundlers you may instead import 'pdfmake/build/vfs_fonts' (it will set pdfMake.vfs globally) — see docs for rollup/webpack caveats.
Sources: pdfmake docs (client-side imports, vfs and addFonts) and vfs/custom-fonts instructions. [1][2]
References
[1] pdfmake—Getting started / client-side examples (imports & vfs).
[2] pdfmake—Custom fonts (vfs build, pdfMake.addFonts / pdfMake.fonts).
Critical: Duplicate pdfmake import and incorrect vfs font path.
Line 9's import pdfmake from 'pdfmake' is the server-side Node.js entry point and should not be used in browser/ES6 modules. Line 38's import pdfMake from 'pdfmake/build/pdfmake' (camelCase, build path) is the correct browser import.
Additionally, line 45 assigns an incorrect vfs path. The code uses pdfFonts.vfs which does not exist; the correct path is pdfFonts.pdfMake.vfs.
Required fixes:
- Remove line 9 entirely:
import pdfmake from 'pdfmake'; - Keep lines 38–39 as-is (they are correct)
- Line 45: Change
pdfMake.vfs = pdfFonts.vfs ?? pdfFonts.default?.vfs;topdfMake.vfs = pdfFonts.pdfMake.vfs;
🤖 Prompt for AI Agents
In resources/js/app.js around lines 9 and 37–45, remove the server-side
duplicate import "import pdfmake from 'pdfmake';" (line 9), keep the browser/ES6
imports "import pdfMake from 'pdfmake/build/pdfmake';" and "import pdfFonts from
'pdfmake/build/vfs_fonts';" (lines 37–39), and update the vfs assignment to use
the correct path by replacing the current assignment with one that sets
pdfMake.vfs to pdfFonts.pdfMake.vfs.
resources/js/app.js
Outdated
| // Save fonts | ||
| pdfMake.vfs = pdfFonts.vfs ?? pdfFonts.default?.vfs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Verify font configuration timing and property access pattern.
The font configuration occurs after DataTable.Buttons.pdfMake(pdfmake) is called (line 42). Depending on how DataTables stores and uses the pdfMake reference, this timing might cause the fonts to be unavailable for PDF exports.
Additionally, the optional chaining pdfFonts.default?.vfs suggests uncertainty about the package structure. For pdfmake 0.2.18, verify:
- The correct property path to access fonts (
pdfFonts.vfsvspdfFonts.pdfMake.vfsvspdfFonts.default.vfs) - Whether fonts must be configured before or after passing pdfMake to DataTable.Buttons
🌐 Web query:
What is the correct way to configure pdfMake fonts with vfs_fonts in pdfmake version 0.2.18?
💡 Result:
Use the browser build and the build vfs file, then set pdfMake.vfs and register your font names. Example that works with pdfmake 0.2.18:
- Imports
- ES/TS:
import pdfMake from 'pdfmake/build/pdfmake';
import pdfFonts from 'pdfmake/build/vfs_fonts';
- Attach VFS and register fonts
- set the vfs (the vfs export is under pdfFonts.pdfMake.vfs) and add fonts (or use legacy pdfMake.fonts):
(pdfMake as any).vfs = pdfFonts.pdfMake.vfs;
pdfMake.addFonts?.({
MyFont: {
normal: 'MyFont-Regular.ttf',
bold: 'MyFont-Bold.ttf',
italics: 'MyFont-Italic.ttf',
bolditalics: 'MyFont-BoldItalic.ttf'
}
});
// or legacy:
pdfMake.fonts = { /* same object as above */ };
- Use the font in your docDefinition
{ defaultStyle: { font: 'MyFont' }, content: [ ... ] }
References: pdfmake docs (VFS / client-side instructions) and examples showing the import + vfs assignment. [1][2]
Sources:
[1] pdfmake docs — Custom fonts via VFS (client-side).
[2] pdfmake getting-started / examples showing import and (pdfMake as any).vfs = pdfFonts.pdfMake.vfs.
I need to verify the actual code structure in the repository before finalizing the review comment.
🏁 Script executed:
#!/bin/bash
# Check the full app.js context around lines 44-45
# Also capture imports and related pdfMake setup
head -50 resources/js/app.js | cat -nLength of output: 2313
🏁 Script executed:
#!/bin/bash
# Search for pdfMake and pdfFonts imports and usage
rg -n "pdfMake|pdfFonts" resources/js/app.js -C 5Length of output: 519
🏁 Script executed:
#!/bin/bash
# Check package.json for pdfmake version
rg '"pdfmake"' package.json -A 2 -B 2Length of output: 130
I found critical issues. Let me verify if these are the same or different pdfMake instances:
🏁 Script executed:
#!/bin/bash
# Check if pdfmake package default export and build/pdfmake are the same
# Search for any usage of the lowercase pdfmake vs camelCase pdfMake
rg -n "pdfmake\b|pdfMake\b" resources/js/app.jsLength of output: 504
🏁 Script executed:
#!/bin/bash
# Check pdfmake package structure - does the default export match build/pdfmake?
# This would help determine if line 9 and line 38 are the same object
npm info [email protected] 2>/dev/null | head -20 || echo "Info: pdfmake 0.2.18 structure needs verification from package exports"Length of output: 540
Fix incorrect pdfMake VFS font property path on line 45.
The current code uses an incorrect property path that doesn't exist in pdfmake 0.2.18. According to pdfmake documentation, the VFS must be assigned from pdfFonts.pdfMake.vfs, not pdfFonts.vfs ?? pdfFonts.default?.vfs. The fallback expressions will evaluate to undefined, leaving fonts unconfigured.
Change line 45 from:
pdfMake.vfs = pdfFonts.vfs ?? pdfFonts.default?.vfs;To:
pdfMake.vfs = pdfFonts.pdfMake.vfs;🤖 Prompt for AI Agents
In resources/js/app.js around lines 44 to 45, the pdfMake VFS assignment uses an
incorrect property path (pdfFonts.vfs ?? pdfFonts.default?.vfs) that results in
undefined for pdfmake v0.2.18; replace that assignment to use the correct
property path pdfFonts.pdfMake.vfs so pdfMake.vfs is set directly from
pdfFonts.pdfMake.vfs.
Summary by CodeRabbit
Bug Fixes
New Features
Chores