-
Notifications
You must be signed in to change notification settings - Fork 550
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
Questionnaire Response List | Display multi values #10448
Conversation
WalkthroughThe pull request updates the Changes
Sequence Diagram(s)sequenceDiagram
participant Component as QuestionResponseValue
participant Renderer as UI Renderer
participant Values as response.values
Component->>Values: Retrieve all valueObj elements
loop For each valueObj
Values-->>Component: Return value / value_quantity if exists
Component->>Renderer: Render individual value
end
Component->>Renderer: Render response note after last value
Possibly related PRs
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
|
Latest commit: |
9786191
|
Status: | ✅ Deploy successful! |
Preview URL: | https://a669eb8e.care-fe.pages.dev |
Branch Preview URL: | https://questionnaire-response-view.care-fe.pages.dev |
…questionnaire-response-view
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)
75-97
: LGTM! Improved handling of multiple response values.The changes effectively handle multiple response values with proper spacing and conditional rendering of units and notes.
Consider adding error handling and accessibility improvements.
A few suggestions to enhance robustness and accessibility:
- Add error boundary for malformed response data
- Add ARIA labels for screen readers
- Consider adding an empty state message when no valid values exist
Here's how you could implement these improvements:
<div className="space-y-1"> + {response.values.length === 0 && ( + <div className="text-sm text-gray-500">No response values</div> + )} {response.values.map((valueObj, index) => { const value = valueObj.value || valueObj.value_quantity?.value; if (!value) return null; return ( <div key={index} className="text-sm font-medium whitespace-pre-wrap" + role="group" + aria-label={`Response value ${index + 1} of ${response.values.length}`} > {formatValue(value, question.type)} {question.unit?.code && ( - <span className="ml-1 text-xs">{question.unit.code}</span> + <span className="ml-1 text-xs" aria-label="unit">{question.unit.code}</span> )} {index === response.values.length - 1 && response.note && ( - <span className="ml-2 text-xs text-gray-500"> + <span className="ml-2 text-xs text-gray-500" aria-label="note"> ({response.note}) </span> )} </div> ); })} </div>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/components/Facility/ConsultationDetails/QuestionnaireResponsesList.tsx
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: cypress-run (1)
- GitHub Check: OSSAR-Scan
🔇 Additional comments (2)
src/components/Facility/ConsultationDetails/QuestionnaireResponsesList.tsx (2)
158-162
: LGTM! Clean integration with parent components.The changes to handle multiple values integrate seamlessly with both usage locations in the
QuestionGroup
component and the main questionnaire response rendering.Also applies to: 255-259
69-100
: LGTM! Successfully implemented multi-value display.The changes effectively fulfill the PR objective of displaying multiple questionnaire response values while maintaining clean code structure and handling edge cases appropriately.
CARE
|
Project |
CARE
|
Branch Review |
questionnaire-response-view
|
Run status |
|
Run duration | 06m 36s |
Commit |
|
Committer | Amjith Titus |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
0
|
|
0
|
|
0
|
|
0
|
|
11
|
View all changes introduced in this branch ↗︎ |
LGTM |
1 similar comment
LGTM |
src/components/Facility/ConsultationDetails/QuestionnaireResponsesList.tsx
Show resolved
Hide resolved
@amjithtitus09 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! 🙌 |
@ohcnetwork/care-fe-code-reviewers
Merge Checklist
Summary by CodeRabbit