chatwoot/app/javascript/dashboard/components/widgets
Shivam Mishra 50efd28d16
feat: Add support for frontend filtering of conversations (#11111)
This pull request includes significant changes to the filtering logic
for conversations in the frontend, here's a summary of the changes

This includes adding a `matchesFilters` method that evaluates a
conversation against the applied filters. It does so by first evaluating
all the conditions, and later converting the results into a JSONLogic
object that can be evaluated according to Postgres operator precedence

### Alignment Specs

To ensure the frontend and backend implementations always align, we've
added tests on both sides with same cases, for anyone fixing any
regressions found in the frontend implementation, they need to ensure
the existing tests always pass.

Test Case | JavaScript Spec | Ruby Spec | Match?
-- | -- | -- | --
**A AND B OR C** | Present | Present | Yes
Matches when all conditions are true | Present | Present | Yes
Matches when first condition is false but third is true | Present |
Present | Yes
Matches when first and second conditions are false but third is true |
Present | Present | Yes
Does not match when all conditions are false | Present | Present | Yes
**A OR B AND C** | Present | Present | Yes
Matches when first condition is true | Present | Present | Yes
Matches when second and third conditions are true | Present | Present |
Yes
**A AND B OR C AND D** | Present | Present | Yes
Matches when first two conditions are true | Present | Present | Yes
Matches when last two conditions are true | Present | Present | Yes
**Mixed Operators (A AND (B OR C) AND D)** | Present | Present | Yes
Matches when all conditions in the chain are true | Present | Present |
Yes
Does not match when the last condition is false | Present | Present |
Yes

---------

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Pranav <pranav@chatwoot.com>
2025-03-24 19:39:04 -07:00
..
conversation feat: Add support for frontend filtering of conversations (#11111) 2025-03-24 19:39:04 -07:00
DashboardApp fix: Use addEventListener instead of onmessage to listen to chatwoot-dashboard-app:fetch-info (#10342) 2024-10-28 20:43:47 -07:00
FilterInput chore: Update buttons in conversation screens(#11132) 2025-03-21 14:47:28 +05:30
forms chore: Update styles in settings pages (#11070) 2025-03-18 14:40:02 -07:00
mentions feat: update colors for v4 (#10660) 2025-01-15 17:13:03 +05:30
modal chore: Update buttons in conversation screens - 2 (#11134) 2025-03-21 21:54:54 +05:30
WootWriter chore: Update buttons in conversation screens(#11132) 2025-03-21 14:47:28 +05:30
AIAssistanceButton.vue chore: Update reply editor design (#10575) 2025-01-08 17:49:53 +05:30
AIAssistanceCTAButton.vue chore: Update reply editor design (#10575) 2025-01-08 17:49:53 +05:30
AIAssistanceModal.vue chore: Update buttons in conversation screens(#11132) 2025-03-21 14:47:28 +05:30
AICTAModal.vue chore: Update buttons in conversation screens(#11132) 2025-03-21 14:47:28 +05:30
AILoader.vue feat: Eslint rules (#9839) 2024-08-05 14:02:16 +05:30
AttachmentsPreview.vue chore: Update buttons in conversation screens(#11132) 2025-03-21 14:47:28 +05:30
AutomationActionInput.vue chore: Update buttons in conversation screens(#11132) 2025-03-21 14:47:28 +05:30
AutomationActionTeamMessageInput.vue chore: Update styles in settings pages (#11070) 2025-03-18 14:40:02 -07:00
AutomationFileInput.vue style: apply fixes for eslint issues [cw-3590] (#10210) 2024-10-03 15:02:12 +05:30
Avatar.vue feat: Eslint rules (#9839) 2024-08-05 14:02:16 +05:30
BackButton.vue chore: Update buttons in integrations page (#11120) 2025-03-20 21:15:47 +05:30
ChannelItem.vue style: apply fixes for eslint issues [cw-3590] (#10210) 2024-10-03 15:02:12 +05:30
ChatTypeTabs.vue feat: Vite + vue 3 💚 (#10047) 2024-10-02 00:36:30 -07:00
ColorPicker.vue style: apply fixes for eslint issues [cw-3590] (#10210) 2024-10-03 15:02:12 +05:30
EmptyState.vue chore: Update styles in settings pages (#11070) 2025-03-18 14:40:02 -07:00
FeatureToggle.vue style: apply fixes for eslint issues [cw-3590] (#10210) 2024-10-03 15:02:12 +05:30
InboxName.vue feat: update colors for v4 (#10660) 2025-01-15 17:13:03 +05:30
LoadingState.vue feat: Eslint rules (#9839) 2024-08-05 14:02:16 +05:30
SettingIntroBanner.vue chore: Update styles in settings pages (#11070) 2025-03-18 14:40:02 -07:00
ShowMore.vue feat: Vite + vue 3 💚 (#10047) 2024-10-02 00:36:30 -07:00
TableFooter.vue style: apply fixes for eslint issues [cw-3590] (#10210) 2024-10-03 15:02:12 +05:30
TableFooterPagination.vue feat: Eslint rules (#9839) 2024-08-05 14:02:16 +05:30
TableFooterResults.vue feat: Eslint rules (#9839) 2024-08-05 14:02:16 +05:30
TableHeaderCell.vue feat: Update design for report pages (#10506) 2024-11-27 18:10:15 +08:00
Thumbnail.spec.js feat: Improve image loading for thumbnails (#5823) 2022-11-08 21:05:13 -08:00
Thumbnail.vue feat: Don't hide thumbnail on hover (#10935) 2025-02-21 13:50:30 -08:00
ThumbnailGroup.vue feat: Eslint rules (#9839) 2024-08-05 14:02:16 +05:30
UserAvatarWithName.vue feat: Update design for report pages (#10506) 2024-11-27 18:10:15 +08:00
VideoCallButton.vue chore: Update reply editor design (#10575) 2025-01-08 17:49:53 +05:30