-
Notifications
You must be signed in to change notification settings - Fork 536
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
Fix DateTimeQuestion response update logic from creating duplicates #10369
Fix DateTimeQuestion response update logic from creating duplicates #10369
Conversation
WalkthroughThe changes involve modifications to the Changes
Suggested labels
Suggested reviewers
Poem
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 (
|
✅ Deploy Preview for care-ohc ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Deploying care-fe with Cloudflare Pages
|
CARE Run #4578
Run Properties:
|
Project |
CARE
|
Branch Review |
rithviknishad/fix/datetime-question-causing-duplicates
|
Run status |
Passed #4578
|
Run duration | 06m 04s |
Commit |
3e829268b8: Fix DateTimeQuestion response update logic from creating duplicates
|
Committer | Rithvik Nishad |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
0
|
Pending |
0
|
Skipped |
0
|
Passing |
10
|
View all changes introduced in this branch ↗︎ |
LGTM |
@rithviknishad Your efforts have helped advance digital healthcare and TeleICU systems. 🚀 Thank you for taking the time out to make CARE better. We hope you continue to innovate and contribute; your impact is immense! 🙌 |
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/components/Facility/ConsultationDetails/QuestionnaireResponsesList.tsx (1)
56-84
: LGTM! Good modularization of the formatValue function.Making the formatValue function public promotes code reuse and ensures consistent value formatting across components. The function's logic handles various value types correctly and safely.
However, consider adding JSDoc documentation to help other developers understand the function's purpose and parameters:
+/** + * Formats a value based on its type for display + * @param value - The value to format, which can be of various types + * @param type - The type of the value (e.g., "dateTime", "choice", "decimal", "integer") + * @returns A formatted string representation of the value + */ export function formatValue( value: ResponseValueType["value"], type: string, ): string {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/components/Facility/ConsultationDetails/ObservationsList.tsx
(3 hunks)src/components/Facility/ConsultationDetails/QuestionnaireResponsesList.tsx
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: cypress-run (1)
🔇 Additional comments (3)
src/components/Facility/ConsultationDetails/ObservationsList.tsx (3)
10-10
: LGTM! Good reuse of the formatValue function.Importing and reusing the formatValue function from QuestionnaireResponsesList promotes code reuse and ensures consistent value formatting across components.
101-101
: LGTM! Value formatting is now consistent.The change from directly displaying
item.value.value
to usingformatValue(item.value.value, item.value_type)
ensures consistent value formatting with QuestionnaireResponsesList.
113-113
: Consider using consistent loading text.The loading text has been changed from "loading_more" to "loading", but this might affect the user's understanding of the pagination state.
Run this script to check loading text consistency across the codebase:
Proposed Changes
Issue reported by @nihal467
@ohcnetwork/care-fe-code-reviewers
Merge Checklist
Summary by CodeRabbit
Refactor
New Features
User Interface