-
Notifications
You must be signed in to change notification settings - Fork 515
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 User Status: Online & Last Seen Timestamps #9781
Add User Status: Online & Last Seen Timestamps #9781
Conversation
Warning Rate limit exceeded@rajku-dev has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 25 minutes and 39 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughThe pull request introduces localization updates for user status messages across multiple language JSON files and modifies user interface components to display user status more consistently. The changes focus on adding new localization keys for "never logged in" and "online" statuses in English, Hindi, Kannada, Malayalam, Marathi, and Tamil language files. Additionally, 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 (3)
src/pages/FacilityOrganization/FacilityOrganizationUsers.tsx (1)
120-123
: Consider semantic structuring of username and status.
Wrapping both the username and the status indicator within the same<span>
may cause layout constraints if future styling or modifications are needed. Consider separate containers (e.g., a<div>
or more granular<span>
elements) for improved flexibility.src/pages/FacilityOrganization/components/EditFacilityUserRoleSheet.tsx (1)
165-166
: Ensure consistent labeling for user status.
Displaying "Last Login" separately from theUserStatusIndicator
is clear. However, note that theUserStatusIndicator
already denotes an explicit last-seen time or a "never logged in" state. Consider whether you want an additional label or if the indicator alone suffices.src/components/Users/UserListAndCard.tsx (1)
103-138
: Use a consistent date handling strategy.
Currently,toLocaleString()
is used to generate a tooltip (line 104), butdayjs
is used for calculating durations. To maintain a consistent user experience and localization approach, consider usingdayjs
for tooltip formatting as well. Also, ensureuser.last_login
is defined before calling any date functions.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (11)
public/locale/en.json
(2 hunks)public/locale/hi.json
(1 hunks)public/locale/kn.json
(1 hunks)public/locale/ml.json
(1 hunks)public/locale/mr.json
(1 hunks)public/locale/ta.json
(1 hunks)src/components/Users/UserBanner.tsx
(0 hunks)src/components/Users/UserListAndCard.tsx
(6 hunks)src/pages/FacilityOrganization/FacilityOrganizationUsers.tsx
(2 hunks)src/pages/FacilityOrganization/components/EditFacilityUserRoleSheet.tsx
(2 hunks)src/pages/Organization/OrganizationUsers.tsx
(2 hunks)
💤 Files with no reviewable changes (1)
- src/components/Users/UserBanner.tsx
✅ Files skipped from review due to trivial changes (1)
- public/locale/ta.json
🔇 Additional comments (15)
src/pages/Organization/OrganizationUsers.tsx (2)
10-10
: New import looks good.
No issues with importing and usingUserStatusIndicator
here.
122-122
: Check for null or undefined user.
Although unlikely, ensure thatuserRole.user
is never null or undefined to avoid potential runtime errors when rendering.src/pages/FacilityOrganization/FacilityOrganizationUsers.tsx (1)
10-10
: Import statement is clear and consistent.
TheUserStatusIndicator
import aligns well with the rest of the project structure.src/pages/FacilityOrganization/components/EditFacilityUserRoleSheet.tsx (1)
34-34
: New import is well-integrated.
No concerns with the import usage.src/components/Users/UserListAndCard.tsx (6)
1-1
: Importing dayjs for date operations is appropriate.
This is a good fit for manipulating and formatting time.
8-9
: Using theBadge
component.
This import organizes user status styling in a consistent, reusable manner.
20-20
: Consolidated utility imports.
No issues with importing fromutils
.
66-66
: Function signature simplification.
Removing thecur_online
parameter fromgetNameAndStatusCard
helps reduce complexity, especially as online detection is encapsulated inUserStatusIndicator
.
75-75
: Usage ofUserStatusIndicator
in the name/status card.
Seamless integration of status within the user’s name card.
170-170
: RevisedgetNameAndStatusCard
usage.
CallinggetNameAndStatusCard(user, !isLessThanXLargeScreen)
clarifies which portion of the UI is displayed based on screen size. This dynamic usage is consistent with responsive design.public/locale/mr.json (1)
96-98
: LGTM! Translations are accurate and consistent.The added translations for user status messages in Marathi are accurate and maintain consistency with other language files.
public/locale/hi.json (1)
810-813
: LGTM! Translations are accurate and consistent.The added translations for user status messages in Hindi are accurate and maintain consistency with other language files.
public/locale/kn.json (1)
811-814
: LGTM! Translations are accurate and consistent.The added translations for user status messages in Kannada are accurate and maintain consistency with other language files.
public/locale/ml.json (1)
812-813
: LGTM! Proper localization of user status messages.The Malayalam translations for "never logged in" and "online" status messages are accurate and culturally appropriate.
public/locale/en.json (1)
1202-1202
: LGTM! Clear and consistent status messages.The English translations are simple and follow the existing lowercase style convention for status messages.
Also applies to: 1291-1291
Violates translation guidelines and duplicate issue. |
sorry for that, should have not used i18 ally, will revert the changes if you want me to. |
Proposed Changes
UserStatusIndicator
to include last seen minutes/hour(s)/days functionality and reuse it at other places.BEFORE
AFTER
@ohcnetwork/care-fe-code-reviewers
Merge Checklist
Summary by CodeRabbit
Localization
User Interface
UserStatusIndicator
componentCode Improvements