-
Notifications
You must be signed in to change notification settings - Fork 514
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
diet preference value moved to constants as snake_case #9859
base: develop
Are you sure you want to change the base?
Conversation
WalkthroughThe pull request introduces new constants related to encounter management in the application, including dietary preferences, statuses, classes, priorities, admit sources, and discharge dispositions. Additionally, the Changes
Assessment against linked issues
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
⏰ Context from checks skipped due to timeout of 90000ms (2)
🔇 Additional comments (5)
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 (
|
✅ Deploy Preview for care-ohc ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/common/constants.tsx
(1 hunks)src/components/Questionnaire/QuestionTypes/EncounterQuestion.tsx
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: cypress-run (1)
🔇 Additional comments (3)
src/components/Questionnaire/QuestionTypes/EncounterQuestion.tsx (2)
14-14
: LGTM! Clean import of diet preferences constant.The import statement is well-placed with other imports from the common directory.
396-400
: LGTM! Clean implementation of dynamic diet preferences.The dynamic mapping of diet preferences from constants improves maintainability and follows React best practices.
src/common/constants.tsx (1)
1761-1764
: LGTM! Well-documented deprecated constant.The deprecated constant is properly documented with JSDoc comment and points to the new location.
src/common/constants.tsx
Outdated
export const DIET_PREFERENCE_OPTIONS = [ | ||
{ label: "Vegetarian", value: "vegetarian" }, | ||
{ label: "Dairy Free", value: "diary_free" }, | ||
{ label: "Nut Free", value: "nut_free" }, | ||
{ label: "Gluten Free", value: "gluten_free" }, | ||
{ label: "Vegan", value: "vegan" }, | ||
{ label: "Halal", value: "halal" }, | ||
{ label: "Kosher", value: "kosher" }, | ||
{ label: "None", value: "none" }, | ||
] as const; |
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.
Fix typo in diet preference value.
There's a typo in the "dairy_free" value (currently spelled as "diary_free").
Apply this diff to fix the typo:
- { label: "Dairy Free", value: "diary_free" },
+ { label: "Dairy Free", value: "dairy_free" },
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
export const DIET_PREFERENCE_OPTIONS = [ | |
{ label: "Vegetarian", value: "vegetarian" }, | |
{ label: "Dairy Free", value: "diary_free" }, | |
{ label: "Nut Free", value: "nut_free" }, | |
{ label: "Gluten Free", value: "gluten_free" }, | |
{ label: "Vegan", value: "vegan" }, | |
{ label: "Halal", value: "halal" }, | |
{ label: "Kosher", value: "kosher" }, | |
{ label: "None", value: "none" }, | |
] as const; | |
export const DIET_PREFERENCE_OPTIONS = [ | |
{ label: "Vegetarian", value: "vegetarian" }, | |
{ label: "Dairy Free", value: "dairy_free" }, | |
{ label: "Nut Free", value: "nut_free" }, | |
{ label: "Gluten Free", value: "gluten_free" }, | |
{ label: "Vegan", value: "vegan" }, | |
{ label: "Halal", value: "halal" }, | |
{ label: "Kosher", value: "kosher" }, | |
{ label: "None", value: "none" }, | |
] as const; |
src/common/constants.tsx
Outdated
export const DIET_PREFERENCE_OPTIONS = [ | ||
{ label: "Vegetarian", value: "vegetarian" }, | ||
{ label: "Dairy Free", value: "diary_free" }, | ||
{ label: "Nut Free", value: "nut_free" }, | ||
{ label: "Gluten Free", value: "gluten_free" }, | ||
{ label: "Vegan", value: "vegan" }, | ||
{ label: "Halal", value: "halal" }, | ||
{ label: "Kosher", value: "kosher" }, | ||
{ label: "None", value: "none" }, | ||
] as const; |
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.
only the value list is needed, the label can be kept in i18n texts. Refer README for translation guidelines.
src/common/constants.tsx
Outdated
/** | ||
* @deprecated use `LocalStorageKeys.patientTokenKey` instead | ||
*/ | ||
export const CarePatientTokenKey = LocalStorageKeys.patientTokenKey; |
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.
?
Do the same for all things present in EncounterQuestion and not just diet preference. Also add i18n translations for all literal strings in the file |
9c6fbd2
to
e3c3e78
Compare
Proposed Changes
@ohcnetwork/care-fe-code-reviewers
Merge Checklist
Summary by CodeRabbit
New Features
Refactor