-
Notifications
You must be signed in to change notification settings - Fork 558
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! 🙌 |
* added patient home actions plugin hook * expose core app env in global scope * enable heatmap and fix appointments column size (#9713) * Fix: Forgot password error should be handled properly (#9707) * forgot password mutation * updated * Added no user assingned message (#9666) Co-authored-by: Rithvik Nishad <rithvikn2001@gmail.com> * Remove facility name from facility users page (#9746) * Enhance organization management by adding new organization types and updating related components. Refactor organization level retrieval to use metadata for improved localization. Remove deprecated organization levels constant and clean up unused code in various components. * Cancel button fix in Book Appointment screen (#9757) * Add public flag to facility (#9759) * Auto-Hide Sidebar on mobile (#9758) * Implement Permission Context and Update User Permissions Handling - Introduced a new PermissionContext to manage user permissions and super admin status across the application. - Updated AppRouter to utilize PermissionProvider for managing permissions. - Changed UserModel to store permissions as strings instead of objects. - Refactored OrganizationFacilities and OrganizationPatients components to use updated permission checks and organization identifiers. - Enhanced OrganizationLayout to conditionally render navigation items based on user permissions. This commit improves the permission management system and ensures consistent handling of user permissions throughout the application. * Replaced ButtonV2's with Button in entire codebase (#9736) * fixes overlapping text (#9767) * Care Loading icon in organization and facility users (#9723) * Clean up facility search in index * Add searchPostFix prop to ValueSetSelect and related components - Introduced a new `searchPostFix` prop in `ValueSetSelect` to allow appending a suffix to the search query. - Updated `MedicationRequestQuestion` and `MedicationStatementQuestion` components to utilize the `searchPostFix` prop with a default value of " clinical drug". - This change enhances search functionality by providing more context in search queries. * Clean up patient login * Fix cancel button in update encounter form (#9772) * disabled image build and deploy for care stagin (#9779) * Bump @tanstack/react-query-devtools from 5.62.11 to 5.62.15 (#9785) Bumps [@tanstack/react-query-devtools](https://github.com/TanStack/query/tree/HEAD/packages/react-query-devtools) from 5.62.11 to 5.62.15. - [Release notes](https://github.com/TanStack/query/releases) - [Commits](https://github.com/TanStack/query/commits/HEAD/packages/react-query-devtools) --- updated-dependencies: - dependency-name: "@tanstack/react-query-devtools" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Patient encounter notes (#9617) Co-authored-by: Bodhisha Thomas <bodhi@Bodhishas-MacBook-Air.local> Co-authored-by: Bodhish Thomas <bodhish@gmail.com> * Fix Auto hide without hook (#9780) * Enhance encounter data handling by adding encounterId prop across multiple components (#9793) * Disable encounter create during save (#9795) * Enhance encounter data handling by adding encounterId prop across multiple components - Added `encounterId` prop to `ObservationChart`, `ObservationHistoryTable`, `ObservationsList`, `QuestionnaireResponsesList`, and `StructuredResponseView` components to improve data fetching and display related to specific encounters. - Updated query parameters in API calls to include `encounterId` for better data context. - Refactored `EncounterPlotsTab` and `EncounterUpdatesTab` to pass the new `encounterId` prop, ensuring consistent data handling across the application. This change improves the overall functionality and user experience by ensuring that encounter-specific data is accurately retrieved and displayed. * fix: disable encounter create button during save to prevent multiple submissions #9794 * Refactor PatientHome and EncounterShow components; update FacilityOrganizationSelector labels - Removed unused state and commented-out code in PatientHome for improved readability. - Enhanced patient data display by updating the last updated and created by fields to use `updated_by` instead of `modified_by`. - Updated date formatting functions to ensure consistent display of patient and encounter dates. - Changed labels in FacilityOrganizationSelector from "Organization" to "Select Department" and adjusted related text for clarity. These changes streamline the codebase and improve user interface clarity. * Partial Cleanup Public Router | Public Pages Header * Rewire enableWhen * Remove localStorage watch from AuthUserProvider * Implement immediate redirection after successful login * Fix: Update the value to Home Health in Create Encounter Form (#9806) * Update Questionnaire Styling * Update Questionnaire Styling * Update Auth Handling * Cleanup Patient Auth State * Handle Null created_by * Types for null patient.created_by * Bump i18next from 24.2.0 to 24.2.1 (#9818) Bumps [i18next](https://github.com/i18next/i18next) from 24.2.0 to 24.2.1. - [Release notes](https://github.com/i18next/i18next/releases) - [Changelog](https://github.com/i18next/i18next/blob/master/CHANGELOG.md) - [Commits](i18next/i18next@v24.2.0...v24.2.1) --- updated-dependencies: - dependency-name: i18next dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump input-otp from 1.4.1 to 1.4.2 (#9819) Bumps [input-otp](https://github.com/guilhermerodz/input-otp/tree/HEAD/packages/input-otp) from 1.4.1 to 1.4.2. - [Changelog](https://github.com/guilhermerodz/input-otp/blob/master/CHANGELOG.md) - [Commits](https://github.com/guilhermerodz/input-otp/commits/HEAD/packages/input-otp) --- updated-dependencies: - dependency-name: input-otp dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Rename dosage field to frequency in ongoing medication form (#9811) * feat: Add new fields to Question interface (#9824) * Cleanup Labels in Questionnaire * Allergy intolerance Cleanup (#9812) * cleanup CarePatientTokenKey (#9827) * changed the facility name (#9829) * Cleanup localStorage Management in Patient Login; Fix Time in Confirmation * Use PatientContext from Router when required * Cleanup Navbars * AllergyList: Add i18n; map key * Add Actions in Encounter * Remove Shortcut for Nursing Care * Update Crowdin configuration file * Update Crowdin configuration file * Fix: Replace InputWithError and InputErrors components with ShadCN’s components directly. (#9847) * fixed eslint errors caused while creating plugin map * refactored the patient registration form using react hook form * added patient registration form plugin hook * updated validations * added patient info card actions plugin hook * set same_phone_number to true by default in patient registration * set same_address to true and same_phone_number to false by default in patient registration --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Mohammed Nihal <57055998+nihal467@users.noreply.github.com>
Proposed Changes
Loading...
text with Care Loading icon@ohcnetwork/care-fe-code-reviewers
Merge Checklist
Summary by CodeRabbit
New Features
UI Improvements