iachat/spec/services
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
..
agent_bots feat: Add native support for CSML in agent_bot API (#4913) 2022-06-23 19:17:46 +05:30
auto_assignment chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
automation_rules feat: validate query conditions (#10595) 2024-12-17 17:16:37 +05:30
contacts feat: validate query conditions (#10595) 2024-12-17 17:16:37 +05:30
conversations feat: Add support for frontend filtering of conversations (#11111) 2025-03-24 19:39:04 -07:00
facebook feat: handle Channel errors (#11015) 2025-03-06 20:09:47 +05:30
google feat: add Google Email fetch and OAuth token refresh service (#9603) 2024-06-11 14:22:03 +05:30
imap feat: Add configurable interval for IMAP sync (#9302) 2024-04-25 18:58:20 -07:00
instagram feat: handle Channel errors (#11015) 2025-03-06 20:09:47 +05:30
internal fix: RemoveStaleRedisKeys service (#10562) 2024-12-11 03:38:25 +08:00
labels fix: Update associations when a label is updated (#3046) 2021-09-21 10:16:32 +05:30
line fix: Fix line sticker URL to prevent certain images from failing to d… (#10416) 2024-11-15 17:27:58 +04:00
llm_formatter feat(ee): Add copilot integration (v1) to the conversation sidebar (#10566) 2024-12-10 15:36:48 -08:00
macros feat: Add the ability to self-assign conversations in macros (#8048) 2023-10-10 09:38:23 +05:30
message_templates chore: Disable sending outgoing messages if the conversation is active (#11073) 2025-03-12 19:22:44 -07:00
messages fix: Prevent duplicate notifications for mentions (#10675) 2025-01-13 11:20:31 +05:30
microsoft chore: Refactor RefreshOauthTokenService to improve readability (#8820) 2024-01-31 12:24:12 +04:00
notification chore: Disable email notifications for unconfirmed users (#10964) 2025-02-24 12:14:40 -08:00
sms chore: Add cache to improve widget performance (#11163) 2025-03-24 16:04:49 -07:00
telegram feat: Adds support for telegram contact sharing (#10841) 2025-02-06 14:23:08 +05:30
twilio chore: Add cache to improve widget performance (#11163) 2025-03-24 16:04:49 -07:00
twitter chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
whatsapp chore: Add cache to improve widget performance (#11163) 2025-03-24 16:04:49 -07:00
action_service_spec.rb feat: Add the ability to un-assign teams using automation (#9668) 2024-06-26 12:40:36 -07:00
search_service_spec.rb feat: use gin index for message search (#11107) 2025-03-19 12:56:23 +05:30