-
Notifications
You must be signed in to change notification settings - Fork 201
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
Illiar/fix/v2 adjustments #3007
Conversation
|
WalkthroughThe pull request encompasses modifications across multiple files in the Ballerine project, focusing on form validation, error handling, and component interactions. Changes include adjusting validation parameters in the Changes
Suggested Reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (7)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 1
🧹 Nitpick comments (2)
apps/kyb-app/src/pages/CollectionFlow/versions/v2/components/organisms/CollectionFlowUI/hooks/usePriorityFields/utils/generate-priority-fields.ts (2)
27-29
: LGTM! Consider adding debug logging.The addition of optional chaining is a good defensive programming practice. However, consider adding debug logging when documents are undefined to help with troubleshooting.
- const document = documents?.find( + const document = documents?.find( (doc: TDocument) => doc.id === element.params?.template?.id, ); + if (!documents) { + console.debug( + `No documents found for element ${element.id} at path ${formatValueDestination( + element.valueDestination, + stack, + )}`, + ); + }
Line range hint
44-45
: TODO comments need attention.These TODO comments indicate incomplete implementation for extracting priority fields from other elements.
Would you like me to help implement the extraction of priority fields from other elements? I can analyze the codebase to understand the requirements and propose a solution.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (13)
apps/kyb-app/CHANGELOG.md
(1 hunks)apps/kyb-app/package.json
(2 hunks)apps/kyb-app/src/pages/CollectionFlow/versions/v2/components/organisms/CollectionFlowUI/CollectionFlowUI.tsx
(1 hunks)apps/kyb-app/src/pages/CollectionFlow/versions/v2/components/organisms/CollectionFlowUI/hooks/usePriorityFields/utils/generate-priority-fields.ts
(1 hunks)packages/react-pdf-toolkit/CHANGELOG.md
(1 hunks)packages/react-pdf-toolkit/package.json
(2 hunks)packages/ui/CHANGELOG.md
(1 hunks)packages/ui/package.json
(1 hunks)packages/ui/src/components/molecules/inputs/DatePickerInput/DatePickerInput.tsx
(1 hunks)packages/ui/src/components/organisms/Form/DynamicForm/fields/DocumentField/hooks/useDocumentUpload/helpers/create-or-update-fileid-or-file-in-documents/create-or-update-fileid-or-file-in-documents.ts
(1 hunks)packages/ui/src/components/organisms/Form/DynamicForm/hooks/external/useField/useField.ts
(2 hunks)packages/ui/src/components/organisms/Form/DynamicForm/hooks/external/useField/useField.unit.test.ts
(2 hunks)services/workflows-service/prisma/data-migrations
(1 hunks)
✅ Files skipped from review due to trivial changes (7)
- packages/ui/package.json
- packages/react-pdf-toolkit/CHANGELOG.md
- packages/react-pdf-toolkit/package.json
- apps/kyb-app/package.json
- packages/ui/CHANGELOG.md
- services/workflows-service/prisma/data-migrations
- apps/kyb-app/CHANGELOG.md
⏰ Context from checks skipped due to timeout of 90000ms (7)
- GitHub Check: Analyze (javascript)
- GitHub Check: test_windows
- GitHub Check: test_linux
- GitHub Check: build (windows-latest)
- GitHub Check: build (ubuntu-latest)
- GitHub Check: spell_check
- GitHub Check: lint
🔇 Additional comments (5)
apps/kyb-app/src/pages/CollectionFlow/versions/v2/components/organisms/CollectionFlowUI/CollectionFlowUI.tsx (1)
24-26
: Review validation timing and behavior changes.The validation parameter changes affect form behavior in significant ways:
- Validation no longer triggers on blur events
- All validation errors will be collected instead of stopping at the first error
- Validation delay increased to 500ms
Please confirm these changes align with the intended user experience, particularly:
- Users won't get immediate feedback when leaving a field
- Validation will run less frequently but show all errors at once
- The increased delay won't make the form feel unresponsive
✅ Verification successful
Validation parameter changes align with established patterns
The changes match existing validation configurations in the codebase:
validateOnBlur: false
is used in other form implementationsabortEarly: false
is the standard defaultvalidationDelay: 500ms
is the consistent default timing🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check for other validation delay configurations in the codebase rg "validationDelay|validateOnBlur|abortEarly" --type typescriptLength of output: 101
Script:
#!/bin/bash # Search for validation parameters in .ts and .tsx files rg "validationDelay|validateOnBlur|abortEarly" -g "*.ts" -g "*.tsx" -A 2 -B 2 # Also search for form configuration patterns rg "const.*validationParams|const.*formConfig" -g "*.ts" -g "*.tsx" -A 5 -B 1Length of output: 65122
packages/ui/src/components/organisms/Form/DynamicForm/hooks/external/useField/useField.ts (2)
46-46
: Optimization: Removed unnecessary dependency.Removing
setTouched
from theonChange
dependencies is a good optimization as it prevents unnecessary recreations of the handler.
29-29
: Consider the impact of faster rule execution.The executionDelay has been reduced from 500ms to 100ms, making rule evaluation more responsive but potentially increasing the frequency of evaluations.
Please verify that this change:
- Doesn't cause performance issues with complex rules
- Maintains a good balance between responsiveness and resource usage
✅ Verification successful
Execution delay change is safe and well-supported
The reduction to 100ms is safe because:
- The rule execution system uses debouncing to prevent excessive evaluations
- The change is localized to the useField hook, maintaining the default 500ms elsewhere
- The codebase has comprehensive test coverage for different execution delays
- No performance-related issues were found in the tests
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for other instances of executionDelay to ensure consistency rg "executionDelay.*[0-9]+" --type typescriptLength of output: 82
Script:
#!/bin/bash # Search for executionDelay in TypeScript files rg "executionDelay" -g "*.ts" -g "*.tsx" -A 2 -B 2 # Search for performance tests or benchmarks rg "performance|benchmark" -g "*.test.ts" -g "*.test.tsx" -g "*.spec.ts" -g "*.spec.tsx" # Look for rule execution patterns rg "rule.*execut|execut.*rule" -g "*.ts" -g "*.tsx" -A 2 -B 2Length of output: 28540
packages/ui/src/components/organisms/Form/DynamicForm/fields/DocumentField/hooks/useDocumentUpload/helpers/create-or-update-fileid-or-file-in-documents/create-or-update-fileid-or-file-in-documents.ts (1)
31-31
: Good: Added proper template cloning.Using
structuredClone
ensures a deep copy of the template, preventing unintended mutations of the original object.packages/ui/src/components/organisms/Form/DynamicForm/hooks/external/useField/useField.unit.test.ts (1)
276-276
: Test alignment: Updated executionDelay in tests.The test expectations have been properly updated to match the new executionDelay value in the implementation.
Also applies to: 298-298
Summary by CodeRabbit
Release Notes
Bug Fixes
Performance
Chores