-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
feat: allow VirtualColumns to be initially non-selectable
#11586
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
feat: allow VirtualColumns to be initially non-selectable
#11586
Conversation
WalkthroughA new Changes
Sequence Diagram(s)sequenceDiagram
participant TestSuite
participant Repository
participant CompanyEntity
participant QueryBuilder
TestSuite->>Repository: Save Company with nested Employees, Timesheets, Activities
Repository->>CompanyEntity: Persist entity and relations (with cascade)
TestSuite->>QueryBuilder: Find Company (default select)
QueryBuilder->>CompanyEntity: Retrieve columns (excluding select: false virtuals)
TestSuite->>QueryBuilder: AddSelect('totalReportedHours')
QueryBuilder->>CompanyEntity: Retrieve columns (including totalReportedHours)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (6)
🔇 Additional comments (15)
✨ 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 (
|
commit: |
| * Indicates if column is always selected by QueryBuilder and find operations. | ||
| * Default value is "true". | ||
| */ | ||
| select?: boolean |
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.
I don't see this value used in the changed code. Is there a test that checks that virtual column now can be un-selected?
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.
Yes: "should be able to read non-selectable virtual columns (with query builder)" checks if Company.totalReportedHours is returned correctly when that column is explicitly selected.
BTW, this feature already exists for regular Columns. This PR just enables it for VirtualColumns (basically in types only) + fixes a bug with adding the select twice.
gioboa
left a 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.
Thanks @alumni you are great 👏
Description of change
Allows the user to declare
VirtualColumns that by default are not selected, similar to regular columns. They can be explicitly selected usingQueryBuilder.addSelectorFindOptions.select.Fixes #11277
Pull-Request Checklist
masterbranchFixes #00000Summary by CodeRabbit
New Features
Bug Fixes
Tests
Refactor