-
Notifications
You must be signed in to change notification settings - Fork 11.7k
refactor: Omnichannel's unit autocompletes to useInfiniteQuery #35875
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
base: develop
Are you sure you want to change the base?
Conversation
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
apps/meteor/client/omnichannel/additionalForms/AutoCompleteUnits.tsx
Outdated
Show resolved
Hide resolved
apps/meteor/client/components/Omnichannel/hooks/useUnitsList.tsx
Outdated
Show resolved
Hide resolved
apps/meteor/client/components/Omnichannel/hooks/useUnitsList.tsx
Outdated
Show resolved
Hide resolved
apps/meteor/client/omnichannel/additionalForms/AutoCompleteUnit.tsx
Outdated
Show resolved
Hide resolved
apps/meteor/client/omnichannel/additionalForms/AutoCompleteUnits.tsx
Outdated
Show resolved
Hide resolved
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #35875 +/- ##
===========================================
+ Coverage 64.58% 64.61% +0.03%
===========================================
Files 3223 3223
Lines 95227 95287 +60
Branches 17841 17848 +7
===========================================
+ Hits 61503 61573 +70
+ Misses 30829 30827 -2
+ Partials 2895 2887 -8
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
29e6950
to
20475c6
Compare
|
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
7b77499
to
81919f2
Compare
81919f2
to
2477a6f
Compare
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
089f024
to
ec1c2a6
Compare
Proposed changes (including videos or screenshots)
This PR refactors the
useUnitsList
hook to take advantage of react query's useInfiniteQuery instead ofRecordList
in combination withuseScrollableRecordList
.Issue(s)
CTZ-105
Steps to test or reproduce
This change can be tested by visiting pages using unit autocompletes and confirming the expected behavior: fetching, filtering and lazy loading.
Further comments
This pull request refactors the Omnichannel unit autocomplete functionality in the Rocket.Chat repository. The changes introduce a new React hook,
useUnitsList
, which leverages@tanstack/react-query
to fetch and manage a paginated list of Omnichannel Business Units. This hook supports text filtering, an optional 'None' item, and custom limits per page.The
AutoCompleteUnit
component has been refactored to simplify its implementation by directly using theuseUnitsList
hook. This change enhances type safety and integration withPaginatedSelectFiltered
by updating the component's props definition withComponentProps
andOmit
. Additionally, the effect for loading items and pagination logic has been streamlined.Similarly, the
AutoCompleteUnits
component has been refactored to simplify its props definition usingOmit
and streamline data fetching by utilizing theuseUnitsList
hook. This refactoring removes previous dependencies and complex state management, improving the component's maintainability.