-
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
Rm whatsapp phone number, hide email for updates #10334
Rm whatsapp phone number, hide email for updates #10334
Conversation
WalkthroughThe pull request introduces significant changes to the user form and user model types. The modifications primarily focus on simplifying the user information capture process by removing auxiliary fields like the alternative phone number and WhatsApp phone number checkbox. The Changes
Assessment against linked issues
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. |
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/Users/UserForm.tsx (1)
165-165
: Remove unused dependency from useEffect.The
phoneNumber
variable is included in the dependency array but is not used within the effect. This could lead to unnecessary re-renders.- }, [phoneNumber, form, usernameInput, isEditMode]); + }, [form, usernameInput, isEditMode]);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/components/Users/UserForm.tsx
(2 hunks)src/types/user/user.ts
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: cypress-run (1)
- GitHub Check: OSSAR-Scan
🔇 Additional comments (3)
src/types/user/user.ts (1)
33-36
: LGTM! The type definition change aligns with the PR objectives.The update to exclude the
UpdateUserModel
is consistent with the requirement to hide email for updates.src/components/Users/UserForm.tsx (2)
489-508
: LGTM! Email field implementation is correct.The email field is properly implemented with:
- Visibility control for non-edit mode
- Required validation
- Proper type and data-cy attributes
510-524
: LGTM! Phone number field changes align with PR objectives.The changes correctly:
- Remove WhatsApp-related functionality
- Make phone number a required field
- Maintain proper validation
@Jacobjeevan the cards is showing updated data only after manual refresh of the page, can you fix it |
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/Users/UserHome.tsx (1)
56-58
: Consider enhancing error handling with user feedback.While navigating back on error is good, consider showing an error message to inform users why they're being redirected.
if (isError) { + toast.error(t("error_loading_user_details")); goBack("/"); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
src/components/Common/UserColumns.tsx
(0 hunks)src/components/Users/UserAvatar.tsx
(3 hunks)src/components/Users/UserHome.tsx
(5 hunks)src/components/Users/UserSummary.tsx
(2 hunks)
💤 Files with no reviewable changes (1)
- src/components/Common/UserColumns.tsx
🧰 Additional context used
📓 Learnings (1)
src/components/Users/UserSummary.tsx (1)
Learnt from: Jacobjeevan
PR: ohcnetwork/care_fe#9080
File: src/components/Users/UserSummary.tsx:53-71
Timestamp: 2024-11-22T12:04:39.044Z
Learning: In the `UserSummaryTab` component (`src/components/Users/UserSummary.tsx`), when there is an error during user deletion, the delete dialog is intentionally closed to prevent the user from immediately trying to delete the user again.
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: cypress-run (1)
🔇 Additional comments (5)
src/components/Users/UserAvatar.tsx (1)
30-37
: LGTM! Clean migration to useQuery.The implementation correctly uses the useQuery hook with proper query key structure and error handling.
src/components/Users/UserHome.tsx (1)
60-62
: LGTM! Clean loading state handling.The loading state check is properly implemented with a null check for userData.
src/components/Users/UserSummary.tsx (3)
41-56
: LGTM! Well-structured mutation with proper error handling.The mutation implementation correctly follows the established pattern of closing the dialog on both success and error, as per the retrieved learning.
61-63
: LGTM! Clean handleSubmit implementation.The handleSubmit function is properly simplified to use the mutation.
1-1
: Verify alignment with PR objectives.The reviewed changes focus on technical improvements (query hook migrations) but don't directly address the PR objectives of removing WhatsApp phone number and hiding email for updates. Please ensure these changes are included in other files or in a separate PR.
LGTM |
@Jacobjeevan 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! 🙌 |
Proposed Changes
@ohcnetwork/care-fe-code-reviewers
Merge Checklist
Summary by CodeRabbit
User Form Changes
Type Model Updates
phone_number_is_whatsapp
propertyalt_phone_number
propertyValidation Logic Updates
Data Fetching Improvements
useQuery
hookUser Deletion Process
useMutation
hook