-
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
Care Loading icon in organization and facility users #9723
Care Loading icon in organization and facility users #9723
Conversation
Warning Rate limit exceeded@Rishith25 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 7 minutes and 54 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 (2)
WalkthroughThe pull request focuses on enhancing the loading experience across multiple components by replacing simple loading text with more sophisticated loading skeletons. The changes primarily affect three components: 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. |
Use skelton loading for loading instead of using the care logo one; |
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 (2)
src/components/Facility/FacilityUsers.tsx (1)
35-77
: Avoid repeated inline skeleton code across multiple components.
You’ve implemented a robust skeleton UI, but consider extracting this skeleton layout into a shared component to promote reusability and simplify maintenance.src/pages/Organization/components/OrganizationLayout.tsx (1)
80-116
: Leverage a unified skeleton component to reduce duplication.
The inline skeleton code is well-structured but repeated patterns in multiple files can be centralized into a shared skeleton component for better maintainability and consistency.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/components/Facility/FacilityUsers.tsx
(2 hunks)src/pages/FacilityOrganization/FacilityOrganizationIndex.tsx
(1 hunks)src/pages/Organization/components/OrganizationLayout.tsx
(2 hunks)
🔇 Additional comments (3)
src/pages/FacilityOrganization/FacilityOrganizationIndex.tsx (1)
39-60
: Use of skeleton UI is consistent and clear.
The loading skeleton placeholders are well-structured, and the use ofArray.from({ length: 6 })
to render multiple cards seems appropriate for providing a fluid user experience during data fetching.src/components/Facility/FacilityUsers.tsx (1)
15-15
: Check import path consistency.
This new import statement forCard
andCardContent
is correct, but ensure it remains consistent with other UI components across the codebase.src/pages/Organization/components/OrganizationLayout.tsx (1)
13-13
: Correct import usage for new loading skeleton approach.
The import path forCard
andCardContent
aligns with the updated skeleton-based loading pattern introduced in multiple files.
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.
instead of reinventing things, let's use shadcn's skeleton instead
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
🔭 Outside diff range comments (1)
src/pages/Organization/components/OrganizationLayout.tsx (1)
Line range hint
141-150
: Add missing key prop to fragment in map function.The fragment within the map function is missing a key prop, which could cause React warnings about unique keys.
Apply this fix:
- <> + <React.Fragment key={`parent-group-${parent.id}`}> <BreadcrumbItem key={parent.id}> <BreadcrumbLink href={`${baseUrl}/${parent.id}`}> {parent.name} </BreadcrumbLink> </BreadcrumbItem> <BreadcrumbItem key={`ellipsis-${parent.id}`}> <BreadcrumbSeparator /> </BreadcrumbItem> - </> + </React.Fragment>
🧹 Nitpick comments (2)
src/components/Facility/FacilityUsers.tsx (1)
36-78
: Great implementation of skeleton loading state!The skeleton loader implementation is well-structured and provides an excellent visual representation of the loading state. The layout closely mirrors the actual content structure, which will create a smooth transition when data loads.
Positive aspects:
- Responsive grid layout using Tailwind classes
- Proper spacing and hierarchy in the skeleton UI
- Consistent use of skeleton sizes matching content
Consider extracting this skeleton loader into a separate component if it's used across multiple pages, promoting reusability and maintainability.
src/pages/Organization/components/OrganizationLayout.tsx (1)
81-113
: Great implementation of skeleton loading state with minor improvements needed.The skeleton loader implementation effectively represents the loading state with a well-structured layout. However, there are a couple of improvements needed:
- The fragment within the map function in the breadcrumb section (line 141-150) is missing a key prop, which could cause React warnings.
- Consider extracting the skeleton card structure into a shared component since it's similar to the one in FacilityUsers.tsx.
Extract the repeated skeleton card structure into a shared component:
// src/components/Common/SkeletonCard.tsx export const SkeletonCard = () => ( <Card> <CardContent className="p-6"> <div className="flex space-x-4"> <div className="flex-1 space-y-4"> <Skeleton className="h-6 w-1/2" /> <div className="flex space-x-4"> <Skeleton className="h-4 w-1/3" /> <Skeleton className="h-4 w-1/3" /> </div> </div> <div className="flex-1 flex items-center justify-center"> <Skeleton className="h-6 w-1/2" /> </div> </div> </CardContent> </Card> );Then use it in both components:
- <Card key={i}> - <CardContent className="p-6"> - {/* ... skeleton structure ... */} - </CardContent> - </Card> + <SkeletonCard key={i} />
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/components/Facility/FacilityUsers.tsx
(2 hunks)src/pages/FacilityOrganization/FacilityOrganizationIndex.tsx
(1 hunks)src/pages/Organization/components/OrganizationLayout.tsx
(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- src/pages/FacilityOrganization/FacilityOrganizationIndex.tsx
🔇 Additional comments (2)
src/components/Facility/FacilityUsers.tsx (1)
15-16
: LGTM! Clean imports added for new UI components.The new imports are properly organized and use relative paths correctly.
src/pages/Organization/components/OrganizationLayout.tsx (1)
13-13
: LGTM! Clean imports added for UI components.The new imports are properly organized using absolute paths, consistent with the project structure.
Also applies to: 15-15
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 (2)
src/components/Facility/FacilityUsers.tsx (2)
53-76
: Consider adding aria attributes for accessibilityWhile the skeleton UI looks great, it's important to ensure it's accessible to screen readers.
Add appropriate ARIA attributes to improve accessibility:
- <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-2 gap-4"> + <div + className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-2 gap-4" + role="status" + aria-label={t("loading_users")} + > {Array.from({ length: 6 }).map((_, i) => ( - <Card key={i}> + <Card key={i} aria-hidden="true">
54-54
: Consider memoizing the skeleton arrayThe array creation in the map function could be moved outside the component to avoid unnecessary recreations during renders.
+const SKELETON_ARRAY = Array.from({ length: 6 }); + export default function FacilityUsers(props: { facilityId: number }) { // ... - {Array.from({ length: 6 }).map((_, i) => ( + {SKELETON_ARRAY.map((_, i) => (
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/components/Facility/FacilityUsers.tsx
(2 hunks)
🔇 Additional comments (2)
src/components/Facility/FacilityUsers.tsx (2)
7-8
: LGTM! Proper use of absolute importsThe new imports follow the recommended pattern of using absolute imports and are organized logically.
36-78
: Great implementation of skeleton loading!The skeleton loading implementation provides an excellent visual representation of the content structure, which is a significant improvement over a simple loading icon. This aligns well with the suggestion from the PR comments and follows modern UX patterns.
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.
changes for the issue lgtm, but merge checklist not followed.
add i18n for all texts in the files that were changed
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/pages/Organization/components/OrganizationLayout.tsx (1)
83-115
: Consider using constants for skeleton counts.The skeleton loading UI is well-implemented, but the magic numbers (6 cards, 4 navigation items) should be extracted into named constants for better maintainability.
+const SKELETON_NAVIGATION_ITEMS = 4; +const SKELETON_CARDS = 6; if (isLoading) { return ( <div className="p-4"> <Skeleton className="h-8 w-48 mb-4" /> <Skeleton className="h-4 w-24 mb-4" /> <div className="flex space-x-4 mb-4"> - {[...Array(4)].map((_, index) => ( + {[...Array(SKELETON_NAVIGATION_ITEMS)].map((_, index) => ( <Skeleton key={index} className="h-8 w-24" /> ))} </div> <Skeleton className="h-6 w-40 mb-4" /> <Skeleton className="h-8 w-1/4 mb-4" /> <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"> - {Array.from({ length: 6 }).map((_, i) => ( + {Array.from({ length: SKELETON_CARDS }).map((_, i) => ( <Card key={i}>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
public/locale/en.json
(1 hunks)src/pages/FacilityOrganization/FacilityOrganizationIndex.tsx
(5 hunks)src/pages/Organization/components/OrganizationLayout.tsx
(4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- src/pages/FacilityOrganization/FacilityOrganizationIndex.tsx
🔇 Additional comments (4)
src/pages/Organization/components/OrganizationLayout.tsx (3)
3-3
: LGTM! Clean import organization.The new imports are well-organized and properly grouped with related components.
Also applies to: 14-14, 16-16
46-46
: LGTM! Proper i18n hook usage.The translation hook is correctly initialized at the component level.
119-119
: LGTM! Proper i18n implementation for error message.The error message is correctly internationalized using the translation function.
public/locale/en.json (1)
1298-1303
: LGTM! Well-structured translation keys.The new organization-related translation keys are:
- Consistently named following the established pattern
- Provide clear and meaningful messages
- Cover all necessary UI text from the component changes
@rithviknishad Can you assign story points for this |
resolve conflicts btw |
@rithviknishad Resolved the merge conflicts |
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)
public/locale/en.json (1)
1299-1304
: LGTM with minor suggestions for consistency!The new organization-related translations are well-written and informative. Consider these minor improvements for consistency:
- Make
organization_facility
more descriptive, e.g., "Facility Organization Management" instead of "Facility Organizations"- Add a period to
organization_not_found
to match other similar messages, i.e., "No Organizations Found."- "organization_facility": "Facility Organizations", + "organization_facility": "Facility Organization Management", - "organization_not_found": "No Organizations Found", + "organization_not_found": "No Organizations Found.",
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
public/locale/en.json
(1 hunks)src/pages/FacilityOrganization/FacilityOrganizationIndex.tsx
(5 hunks)src/pages/Organization/components/OrganizationLayout.tsx
(4 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- src/pages/FacilityOrganization/FacilityOrganizationIndex.tsx
- src/pages/Organization/components/OrganizationLayout.tsx
@Rishith25 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
Loading...
text with Care Loading icon@ohcnetwork/care-fe-code-reviewers
Merge Checklist
Summary by CodeRabbit
New Features
UI Improvements