-
Notifications
You must be signed in to change notification settings - Fork 1
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
Ensure column order in table view #769
base: main
Are you sure you want to change the base?
Conversation
d359850
to
a814866
Compare
WalkthroughThe pull request modifies the Changes
Assessment against linked issues
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 90000ms (1)
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 (1)
test/unit/middleware/dataview.middleware.test.js (1)
122-122
: Add additional test cases for edge scenariosThe current test suite would benefit from additional test cases to verify:
- Behaviour when neither 'name' nor 'reference' fields exist
- Behaviour when only one of the fields exists
- Order preservation of remaining fields
Here's an example of additional test cases:
it('preserves existing order when name and reference fields are absent', () => { const req = { entities: [{ id: 1, foo: 'bar', baz: 'qux' }], uniqueDatasetFields: ['foo', 'baz'] } const res = {} const next = vi.fn() constructTableParams(req, res, next) expect(req.tableParams.columns).toEqual(['foo', 'baz']) expect(req.tableParams.fields).toEqual(['foo', 'baz']) }) it('handles single leading field correctly', () => { const req = { entities: [{ id: 1, name: 'First', foo: 'bar' }], uniqueDatasetFields: ['foo', 'name'] } const res = {} const next = vi.fn() constructTableParams(req, res, next) expect(req.tableParams.columns).toEqual(['name', 'foo']) expect(req.tableParams.fields).toEqual(['name', 'foo']) })
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/middleware/dataview.middleware.js
(1 hunks)test/unit/middleware/dataview.middleware.test.js
(1 hunks)
🔇 Additional comments (1)
test/unit/middleware/dataview.middleware.test.js (1)
110-122
: Fix typo and enhance test coverageThe test case has the same issues as previously identified:
- Typo in the description: 'refernce' should be 'reference'
- Test should verify both 'name' and 'reference' columns
- Test data could be more comprehensive
Apply the suggested fix from the previous review to address these issues.
Coverage Report
File Coverage
|
What type of PR is this? (check all applicable)
Description
This PR ensures the "name" and "reference" columns come first in the table view.
Related Tickets & Documents
Closes #755
QA Instructions, Screenshots, Recordings
From what I can see the column order matches the desired one, but mostly by happy accident than anything else.
Added/updated tests?
QA sign off
Summary by CodeRabbit
New Features
Tests
These changes improve the organisation of dataset fields during table rendering, ensuring consistent and predictable column ordering.