-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add fields request to reduced schedule #1386
Conversation
When we added fields to the schedule, it looks like we missed doing it on the reduced schedule.. not the end of the world, but it used to fail silently.. now it doesn’t
WalkthroughThe pull request modifies the Changes
Sequence DiagramsequenceDiagram
participant App as Reduced Schedule App
participant Radio as Radio Service
participant Entities as Entities Collection
App->>Radio: Request fetch:actions:collection
Radio->>Entities: Fetch with filter and fields
Entities-->>Radio: Return filtered and field-limited collection
Radio-->>App: Provide actions collection
Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
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 (
|
@@ -98,7 +98,8 @@ export default App.extend({ | |||
}, | |||
beforeStart() { | |||
const filter = this.getState().getEntityFilter(); | |||
return Radio.request('entities', 'fetch:actions:collection', { data: { filter } }); | |||
const fields = { flows: ['name', 'state'] }; |
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.
The pattern we're matching is here
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: 0
🧹 Nitpick comments (1)
src/js/apps/patients/schedule/reduced-schedule/reduced_schedule_app.js (1)
101-102
: LGTM! Consider extracting fields as a constant.The addition of the
fields
parameter correctly addresses the oversight by explicitly requesting the required flow fields. This change improves the API request efficiency by only fetching the necessary data.Consider extracting the fields configuration as a constant at the module level for better maintainability:
import Radio from 'backbone.radio'; +const FLOW_FIELDS = { flows: ['name', 'state'] }; // ... rest of the imports beforeStart() { const filter = this.getState().getEntityFilter(); - const fields = { flows: ['name', 'state'] }; - return Radio.request('entities', 'fetch:actions:collection', { data: { filter, fields } }); + return Radio.request('entities', 'fetch:actions:collection', { data: { filter, fields: FLOW_FIELDS } }); },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/js/apps/patients/schedule/reduced-schedule/reduced_schedule_app.js
(1 hunks)test/integration/patients/worklist/reduced-schedule.js
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Analyze (javascript)
- GitHub Check: test-build
🔇 Additional comments (1)
test/integration/patients/worklist/reduced-schedule.js (1)
104-105
: LGTM! Test coverage properly validates the fields parameter.The test has been appropriately updated to verify that the correct fields are being requested for flows. This ensures the API request includes only the necessary data fields.
RoundingWell Care Ops Frontend
|
Project |
RoundingWell Care Ops Frontend
|
Branch Review |
bug/reduced-filter-fields
|
Run status |
|
Run duration | 02m 57s |
Commit |
|
Committer | Paul Falgout |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
0
|
|
1
|
|
0
|
|
0
|
|
313
|
View all changes introduced in this branch ↗︎ |
Pull Request Test Coverage Report for Build 163a685f-a212-4292-9f8b-2aa9a27609b3Details
💛 - Coveralls |
When we added fields to the schedule, it looks like we missed doing it on the reduced schedule.. not the end of the world, but it used to fail silently.. now it doesn’t
Shortcut Story ID: [sc-58838]
Summary by CodeRabbit
New Features
Tests