iachat/app/javascript/dashboard/components/widgets/conversation
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
..
advancedFilterItems feat: Add support for frontend filtering of conversations (#11111) 2025-03-24 19:39:04 -07:00
bubble feat: Update translated content inline (#11074) 2025-03-12 19:31:28 -07:00
components chore: Update buttons in conversation screens - 2 (#11134) 2025-03-21 21:54:54 +05:30
contextMenu fix: Usability issues in conversation card context menu (#10971) 2025-02-25 16:48:04 +05:30
conversation style: apply fixes for eslint issues [cw-3590] (#10210) 2024-10-03 15:02:12 +05:30
conversationBulkActions chore: Update buttons in conversation screens - 2 (#11134) 2025-03-21 21:54:54 +05:30
conversationCardComponents chore(v4): Update colors (#10700) 2025-01-16 15:27:23 +05:30
EmptyState feat: update colors for v4 (#10660) 2025-01-15 17:13:03 +05:30
helpers chore: Migrate all instances of old vuelidate to new v2 syntax [CW-3274] (#9623) 2024-07-30 15:08:22 +05:30
linear chore: Update buttons in conversation screens - 2 (#11134) 2025-03-21 21:54:54 +05:30
specs chore: fix circleci on vite build (#10214) 2024-10-07 15:27:41 +05:30
WhatsappTemplates chore: Update buttons in conversation screens - 2 (#11134) 2025-03-21 21:54:54 +05:30
AvailabilityStatusBadge.vue feat: Eslint rules (#9839) 2024-08-05 14:02:16 +05:30
CannedResponse.vue style: apply fixes for eslint issues [cw-3590] (#10210) 2024-10-03 15:02:12 +05:30
ChatFilter.vue feat: Dark Mode (#7471) 2023-07-21 22:10:25 +05:30
ConversationBasicFilter.vue chore: Update chat list header UI (#10573) 2024-12-12 10:12:07 +05:30
ConversationBox.vue feat: update colors for v4 (#10660) 2025-01-15 17:13:03 +05:30
ConversationCard.vue feat: Support bigger font size in dashboard (#10974) 2025-02-27 12:10:33 +05:30
ConversationHeader.vue chore: Update buttons in conversation screens - 2 (#11134) 2025-03-21 21:54:54 +05:30
ConversationSidebar.vue feat: Support bigger font size in dashboard (#10974) 2025-02-27 12:10:33 +05:30
EmailTranscriptModal.vue fix: vue 3 followup fixes (#10213) 2024-10-03 19:59:07 +05:30
FilterItem.vue chore: Update chat list header UI (#10573) 2024-12-12 10:12:07 +05:30
Message.vue feat: Add RTL Support to Widget (#11022) 2025-03-21 09:39:03 -07:00
MessagePreview.vue chore: Repalce message formatter mixin with useMessageFormatter [CW-3470] (#9986) 2024-08-27 08:06:51 +05:30
MessageSignatureMissingAlert.vue chore: Update buttons in conversation screens - 2 (#11134) 2025-03-21 21:54:54 +05:30
MessagesView.vue chore: Update buttons in conversation screens - 2 (#11134) 2025-03-21 21:54:54 +05:30
MoreActions.vue feat: update colors for v4 (#10660) 2025-01-15 17:13:03 +05:30
OnboardingFeatureCard.vue feat: Vite + vue 3 💚 (#10047) 2024-10-02 00:36:30 -07:00
OnboardingView.vue feat: Vite + vue 3 💚 (#10047) 2024-10-02 00:36:30 -07:00
PriorityMark.vue chore(v4): Update colors (#10700) 2025-01-16 15:27:23 +05:30
ReplyBox.vue chore: Update styles in settings pages (#11070) 2025-03-18 14:40:02 -07:00
ReplyEmailHead.vue chore: Update styles in settings pages (#11070) 2025-03-18 14:40:02 -07:00
ReplyToMessage.vue chore: Update buttons in conversation screens - 2 (#11134) 2025-03-21 21:54:54 +05:30
ShopifyOrderItem.vue feat(apps): Shopify Integration (#11101) 2025-03-19 15:37:55 -07:00
ShopifyOrdersList.vue feat(apps): Shopify Integration (#11101) 2025-03-19 15:37:55 -07:00
TagAgents.vue feat: update colors for v4 (#10660) 2025-01-15 17:13:03 +05:30
VariableList.vue style: apply fixes for eslint issues [cw-3590] (#10210) 2024-10-03 15:02:12 +05:30