-
Notifications
You must be signed in to change notification settings - Fork 561
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
Fix : FacilityOrganizationSelector Displays Only First 15 Entries #10801
base: develop
Are you sure you want to change the base?
Fix : FacilityOrganizationSelector Displays Only First 15 Entries #10801
Conversation
WalkthroughThe changes update the facility organization selector to handle dynamic search input. A new state variable Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant A as Autocomplete
participant C as FacilityOrganizationSelector
participant Q as Query Module (debounced)
participant B as Backend
U->>A: Types search input
A->>C: onSearch triggers setFacilityOrgSearch
C->>Q: Updates queryKey with new search term
Q->>B: Sends API request with name & limit=14
B-->>Q: Returns organization data
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (4)
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: 2
🧹 Nitpick comments (1)
src/pages/Facility/settings/organizations/components/FacilityOrganizationSelector.tsx (1)
144-144
: Optimize search performance and UX.While the search functionality is implemented correctly, consider these improvements:
- Configure the debounce delay for optimal performance
- Add loading state handling during search
Example implementation:
const DEBOUNCE_DELAY = 300; // milliseconds // In the Autocomplete component <Autocomplete loading={rootOrganizations.isLoading} // Add loading state onSearch={(value) => setFacilityOrgSearch(value)} /> // In Utils/request/query.ts debounced: (route: string, config: Config) => { return debounce((context: QueryFunctionContext) => { return query(route, config)(context); }, DEBOUNCE_DELAY); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/pages/Facility/settings/organizations/components/FacilityOrganizationSelector.tsx
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (8)
- GitHub Check: Redirect rules - care-ohc
- GitHub Check: Header rules - care-ohc
- GitHub Check: Pages changed - care-ohc
- GitHub Check: cypress-run (1)
- GitHub Check: Test
- GitHub Check: lint
- GitHub Check: CodeQL-Build
- GitHub Check: OSSAR-Scan
🔇 Additional comments (2)
src/pages/Facility/settings/organizations/components/FacilityOrganizationSelector.tsx (2)
41-41
: LGTM! Well-structured state management.The new state variable is properly initialized and follows naming conventions.
31-193
: Verify if changes fully address the original issue.While the implementation adds search functionality, it doesn't completely solve the original issue of displaying only 15 entries. The current changes:
- Add search functionality ✅
- Use debounced queries ✅
- Still limit results (now to 14 entries) ❌
Consider implementing one of these solutions:
- Increase the limit significantly
- Implement pagination
- Add infinite scroll
Please confirm if these changes meet the requirements of issue #10779.
src/pages/Facility/settings/organizations/components/FacilityOrganizationSelector.tsx
Outdated
Show resolved
Hide resolved
src/pages/Facility/settings/organizations/components/FacilityOrganizationSelector.tsx
Outdated
Show resolved
Hide resolved
@Jacobjeevan @rithviknishad This PR is ready for review and testing |
Proposed Changes
@ohcnetwork/care-fe-code-reviewers
Merge Checklist
Summary by CodeRabbit