-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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: Blank selected department when selecting out of range #33386
Conversation
The the Oc current chats departments filter uses "on scroll" pagination. If a user selects a department that isn’t within the first 25 departments listed, the selection will appear blank after refreshing the page. This happens because the `PaginatedSelectFiltered` component cannot find the selected department in the paginated options list due to it not being part of the initially fetched list of departments.
Looks like this PR is ready to merge! 🎉 |
🦋 Changeset detectedLatest commit: e5d5157 The changes in this PR will be included in the next version bump. This PR includes changesets to release 33 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #33386 +/- ##
========================================
Coverage 58.58% 58.59%
========================================
Files 2737 2737
Lines 65677 65714 +37
Branches 14824 14826 +2
========================================
+ Hits 38478 38505 +27
- Misses 24420 24430 +10
Partials 2779 2779
Flags with carried forward coverage won't be shown. Click here to find out more. |
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.
Can we add a couple of e2e tests?
…2e tests Added tests to verify when the useDepartmentsList function should normalize the departments list for the current chats department filter. Also added an end-to-end test to validate the use of localStorage in the department filter.
Hey @KevLehman, talking to the frontend folks we concluded that it would be better to test this specific behavior through unit tests of the |
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.
I'll remove the omni review 🤗
Proposed changes (including videos or screenshots)
The Omnichannel current chats departments filter uses "on scroll" pagination (it fetches a list of the 25 first departments and loads more items every 25 items that the user scrolls down). If a user selects a department that isn’t within the first 25 departments listed, the selection will appear blank after refreshing the page. This happens because the
PaginatedSelectFiltered
component cannot find the selected department in the paginated options list due to it not being part of the initially fetched list of departments. This PR adds a "normalization" function to the listing of departments that will add the missing department to the initial list so the component can correctly show the previously selected department.Before:
After:
Issue(s)
Steps to test or reproduce
Further comments
Jira task: SUP-675