Commit Graph

643 Commits

Author SHA1 Message Date
Pranav
3d31d4dd7f feat: Add widget to help center config (#9235) 2024-04-15 16:46:48 -07:00
Sojan Jose
42a457ff5d feat: Use embeddings in help center search (#9227) 2024-04-15 16:35:23 -07:00
Vishnu Narayanan
fa3bc05d3d chore: fix sla email notifications (#9192)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2024-04-04 21:16:49 +05:30
Sivin Varghese
e49ef773d8 feat: UI to show the SLA threshold in chat screen (#9146)
- UI will show the breach in the conversation list.
- UI will show the breach in the conversation header.

Fixes: https://linear.app/chatwoot/issue/CW-3146/update-the-ui-to-show-the-breach-in-the-conversation-list
Fixes: https://linear.app/chatwoot/issue/CW-3144/ui-update-to-show-the-breachgoing-to-breach
2024-04-04 15:46:46 +05:30
Sojan Jose
4e28481f27 feat: Conversation API to return applied_sla and sla_events (#9174)
* chore: Add sla_events to push_event_data

* chore: Return SLA details in the API

* chore: feature lock sla push event data

* Update _conversation.json.jbuilder

* chore: rubocop fixes
2024-04-01 23:30:07 +05:30
Vishnu Narayanan
16282f6a66 feat: Add push/email notification support for SLA (#9140)
* feat: update SLA evaluation logic

* Update enterprise/app/services/sla/evaluate_applied_sla_service.rb

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>

* chore: refactor spec to bring down expecations in a single block

* chore: fix process_account_applied_sla spec

* chore: add spec to test multiple nrt misses

* feat: persist sla notifications

* feat: revert persist sla notifications

* feat: add SLA push/email notification support

* chore: refactor sla_status to include active_with_misses

* chore: add support for sla push/email notifications

* chore: refactor

* chore: add liquid templates

* chore: add spec for liquid templates

* chore: add spec for sla email notifications

* chore: add spec for SlaPolicyDrop

* chore: refactor to ee namespace

* chore: set enterprise test type to mailer

* feat: enable sla notification settings only if SLA enabled

* chore: refactor

* chore: fix spec

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2024-03-29 20:27:21 +11:00
Shivam Mishra
9a1c54a82d feat: disable automation rules if condition fails multiple times (#9017)
* feat: add email for disabling automation rule

* feat: disable automation rules and notify admin

* feat: reset error count after update

* feat: trigger invalid_condition_error if rule is invalid

* feat: setup error trackable concern

* refactor: use ErrorTrackable in Reauthorizable

* fix: optional argument

* feat: separate reauthorization_required_key

* test: update case to use ERROR_TRACKABLE_COUNT

* Revert "test: update case to use ERROR_TRACKABLE_COUNT"

This reverts commit f439847147556a02759a7597a7fcf1d66091cafc.

* Revert "feat: separate reauthorization_required_key"

This reverts commit f4514fce217b0a2f2c2bf701a15de0a8b47acbc4.

* Revert "fix: optional argument"

This reverts commit 93b4194ec3f10f67e2402388c966c071c4d3b4fd.

* Revert "refactor: use ErrorTrackable in Reauthorizable"

This reverts commit 513c2a522bc782e73ea4b0f5ae34ce01e70e042c.

* Revert "feat: setup error trackable concern"

This reverts commit 278683060cf422f60af5d5c77100aa5272141141.

* feat: use reauthorizable for automation rule

* feat: remove redis key

* test: fix method names

* chore: refactor

---------

Co-authored-by: Vishnu Narayanan <iamwishnu@gmail.com>
Co-authored-by: Sojan <sojan@pepalo.com>
2024-03-28 13:14:16 +05:30
Shivam Mishra
9917cb4273 fix: Convert cached_label_list to text (#9143) 2024-03-25 18:47:08 -07:00
Ryan Kon
762a39330a fix: use safe nav when downcasing email in from_email (#9139)
Use safe nav when downcasing email in from_email
2024-03-21 18:44:04 +05:30
Muhsin Keloth
586552013e feat: Update the contact_type when creating or updating the contact (#9107)
* feat: Update location and country code when the contact create/update

* feat: Update the location and country_code when creating or updating the contact.

* chore: improve comments

* feat: Update the contact_type when the contact created/updated

* chore: add more specs

* chore: code cleanups

* chore: code cleanups

* Update contact_spec.rb

* Update inbox.rb

* Update sync_attributes_spec.rb

* chore: build fixes

* chore: check visitor type before update

* chore: review fixes
2024-03-15 10:55:40 +05:30
Vishnu Narayanan
7f4b2d66d4 feat: add activity message for SLA (#9100)
* feat: add activity message for SLA

* chore: refactor to reduce method complexity

* chore: refactor

* feat: add spec for SLAactivity message

* chore: move SLA spec to enterprise folder

* chore: move team activity methods to a separate module

* chore: fix typo

* chore: move sla activity message spec to conversation model
2024-03-13 20:05:34 +05:30
Muhsin Keloth
804a42c271 feat: Update the location and country_code when creating or updating the contact (#9106)
* feat: Update the location and country_code when creating or updating the contact.

* chore: improve comments
2024-03-13 16:40:21 +05:30
Vishnu Narayanan
aaf70cf1cf feat: add push notification when SLA missed (#9078)
* feat: add push notification when SLA missed

* chore: sent notification only for inbox members

* feat: add conv particpants+admins to SLA notification list

* chore: add spec to ensure notification is created

* chore: refactor to multiple alerts for SLA conditions

* chore: add sla_policy as secondary_actor in notification
2024-03-11 21:49:41 +05:30
Pranav
505ede2761 fix: Change the column identifier from string to text to avoid overflow (#9073)
Fixes: https://linear.app/chatwoot/issue/CW-3118/cannot-subscribe-to-notifications-on-microsoft-edge

Fix the issue with notifications in Microsoft Edge. The Edge push notification payload identifier has more than 255 characters. The API calls were failing due to this. This PR would fix the issue.
2024-03-07 11:13:01 +05:30
Muhsin Keloth
216de4d123 fix: Conversation assignment notification title (#9071) 2024-03-06 23:05:13 +05:30
Muhsin Keloth
ef90b7a3d8 feat: Revamp the notification title and content (#8988) 2024-03-06 20:51:56 +05:30
Nithin David Thomas
b7a83dcbcd feat: Add a placeholder for image attachments in conversations view (#8969)
We analyze an image to get it's height and width. On the frontend, we would show a placeholder with the corresponding width and height until the images are loaded properly.

---------

Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
2024-02-27 14:46:16 -08:00
Shivam Mishra
106319406b fix: remove rubocop rule (#8985)
* fix: remove rubocop rule

* chore: remove ignore comment

* chore: remove ignore comment
2024-02-22 13:36:15 +05:30
Sojan Jose
ae4c8d818f feat: Ability to block contacts permanently (#8922)
Co-authored-by: Pranav <pranav@chatwoot.com>
2024-02-21 14:18:42 -08:00
Shivam Mishra
c031cb19d2 fix: downcase email before finding (#8921)
* fix: downcase email when finding

* feat: add `from_email` class

* refactor: use `from_email`

* feat: add rule to disallow find_by email directly

* chore:  remove redundant test

Since the previous imlpmentation didn't do a case-insentive search, a new user would be created, and the error would be raised at the DB layer. With the new changes, this test case is redundant

* refactor: use from_email
2024-02-21 18:51:00 +05:30
Muhsin Keloth
e6cf8c39b7 feat: Update last_snoozed_at after the un-snooze notification (#8943) 2024-02-20 18:55:39 +05:30
Muhsin Keloth
c5c0845151 feat: Add labels, status and priority in notification push_event_data (#8972) 2024-02-20 17:17:25 +05:30
Sojan Jose
978a8a4cb2 fix: support_email and inbound_email_domain returning empty string (#8963)
chore: Fix for inbound email domain being nil
2024-02-19 15:43:35 +05:30
Muhsin Keloth
3b7b06dbec feat: Add meta to notification model (#8941)
* feat: Add meta and description to notification model

* chore: remove description
2024-02-16 14:38:02 +05:30
Muhsin Keloth
1b21e0d429 feat: Add notification.updated event (#8871) 2024-02-07 18:15:51 +05:30
Sojan Jose
7776b74126 chore: Apply fixes for items in rubocop_todo [CW-1806] (#8864)
This PR addresses several items listed in our rubocop_todo by implementing the necessary corrections and enhancements. As a result, we are now able to remove the rubocop_todo file entirely, streamlining our codebase and ensuring adherence to our coding standards.

fixes: https://linear.app/chatwoot/issue/CW-1806/chore-rubocop-audit
2024-02-07 13:36:04 +04:00
Sivin Varghese
9e0468cd73 feat: Inbox header actions (Snooze/Delete) (#8858)
* feat: Inbox header actions (Snooze/Delete)

* chore: Minor fix

* chore: Fix eslint

* Update inboxHotKeys.js

* feat: custom snooze

* Update actions.spec.js

* chore: Clean up

* chore: add snoozed_until to notification end point

* chore: Minor fix

* chore: Minor style fix

* chore:Clean up

* chore: review fixes

* chore: Minor fix

* chore: Adds alert

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2024-02-06 08:54:15 +05:30
Shivam Mishra
07ea9694a3 feat: new accounts controller for signup+onboarding (#8804)
* feat: add v2 accounts controller

* feat: allow empty account and user name

* feat: ensure  and  is present for v1 signup

* test: remove validation checks

* chore: apply suggestions

* chore: revert en.yml formatting

* chore: line at EOF

* fix: routes

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2024-02-02 16:10:45 +05:30
Vishnu Narayanan
b8047f0912 feat: sla-2 add automation backend support for SLA (#8775)
* feat: add automation support for SLA

* feat: add sla action in automtion UI

* chore: revert frontend changes

* chore: refactor to ee namespace

* chore: refactor automation rule to ee namespace

* feat: create applied_sla table entry

* chore: add applied_sla spec

* chore: rubocop fixes

---------

Co-authored-by: Sojan <sojan@pepalo.com>
2024-02-01 15:42:12 +05:30
Pranav Raj S
905ca94f71 chore: Remove unused attribute imap_inbox_synced_at (#8822)
- imap_inbox_synced_at is no longer used; this PR removes all the references to the same.
2024-01-31 11:48:46 +04:00
Sojan Jose
0805f362d3 chore: Validation for purchased pricing_plan_quantity (#8809)
- Add validations based on purchased pricing_plan_quantity
- Modify the Dashboard to support the new error message
2024-01-30 11:26:07 +04:00
Shivam Mishra
3ed80fa867 feat: expiry for cache keys [CW-3038] (#8793)
* feat: set cache keys for 3 days only

* feat: invalidate should set the latest timestamp

* refactor: cache_keys concern

* remove invalidate_cache method
* refactor reset to set to new value instead of delete
* ensure only one event is dispatched

* feat: set expiry to 24 hours

* chore: make expiry 48 hours

* feat: include destroy event

* feat: set expiry to 72 days

* fix: typo

* test: cache update after `touch`

* test: update cache keys

* refactor: remove after_touch, it's already handled in commit
2024-01-29 15:27:26 +05:30
Muhsin Keloth
485c561b18 feat: Add attributes location and country_code to Contact model (#8803)
feat: Add attributes location and country_code to Contact model
2024-01-29 14:10:14 +05:30
Muhsin Keloth
904d76420d fix: Add last_activity_at to notification push event data (#8784)
fix: Add last_activity_at to push event data
2024-01-25 12:05:00 +05:30
Muhsin Keloth
fa907840c7 feat: Add middle_name and last_name to contact model (#8771)
feat: Add `middle_name` and `last_name`
2024-01-24 16:22:04 +05:30
Muhsin Keloth
143299f138 feat: Add contact_type attribute to contact model (#8768) 2024-01-24 12:26:47 +05:30
Surabhi Suman
4b40c61201 feat: Support Regex validation for custom attributes (#7856)
This allows a user to add/update a custom regex and a cue while defining custom attributes(Only applicable for type- text).
While adding/editing custom attributes, the values are validated against the attribute definition regex, and if it is incorrect, a cue message or default error message is shown and restricts invalid values from being saved.

Fixes: #6866
2024-01-23 18:01:57 +04:00
Shivam Mishra
834c219b9b feat(perf): update query to do a simpler search [CW-2997] (#8763)
Message search would frequently timeout. The reason was that the query would join the conversation too, the new query searches the message table directly

Co-authored-by: Sojan <sojan@pepalo.com>
2024-01-23 14:20:00 +04:00
Shivam Mishra
e39c14460b fix: validate url for Dashboard Apps [CW-2979] (#8736) 2024-01-18 17:48:30 +05:30
Sojan Jose
5f6e17f307 feat: Use Telegram HTML Parsemode (#8731)
- this ensures that the markdown formatted messages from the Chatwoot dashboard will render consistently in telegram UI for the supported types like bold, italics, links etc
2024-01-18 15:36:36 +04:00
Sojan Jose
76fe2f9bb8 chore: Switch to Markdown instead of MarkdownV2 for telegram channel (#8720) 2024-01-17 14:28:13 +05:30
Muhsin Keloth
818424259f chore: Get all notification API improvments (#8549)
Co-authored-by: Sojan Jose <sojan@chatwoot.com>
2024-01-17 09:02:18 +05:30
Nithin David Thomas
d1e7e75638 feat: Adds internal support for markdown in Telegram outgoing messages (#8640)
This PR adds support for Markdown in the telegram API for send message. The dashboard uses commonmark syntax for markdown but telegram is using MarkdownV2.
More info - https://core.telegram.org/bots/api#markdownv2-style

Adds support for bold - *bold*, _italic text_, __underline__, ~strikethrough~

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2024-01-16 13:32:59 +04:00
Sojan Jose
dc4e13b300 chore: Fix for empty update case for messages (#8641)
We observed an issue in production where the external webhook for an API inbox was failing. This, in turn, calls message update to update message status to failed. This causes a loop because rails trigger after_update callbacks even for empty commits.

Ref: rails/rails#44500
2024-01-05 13:10:26 -08:00
Shivam Mishra
6e30064421 feat: handle unsupported media on the backend (#8650)
This PR logs additional information in content_attributes of a message in case it is unsupported. This info can be used by the client to render a fresh UI
2024-01-05 13:05:00 -08:00
Muhsin Keloth
b5071e61d7 feat: Add last_activity_at field to Notification model (#8585) 2023-12-20 13:02:37 +05:30
Pranav Raj S
8c9a351c84 feat: Add support for ascending and descending options in sort (#8542) 2023-12-12 17:15:48 -08:00
Pranav Raj S
d28f512de4 fix: Update the label name to use .strip to avoid unnecessary whitespace characters (#8541)
- The cache stores the labels as label1, label2. Without removing the whitespace, the output of cached_label_list_array would be [label1, [whitespace]label2], which doesn't match with the existing labels. This list is returned with proper label names.
2023-12-12 15:04:29 -08:00
Pranav Raj S
890515edfd feat(perf): Cache labels on the conversation model (#8527) 2023-12-11 18:27:55 -08:00
Muhsin Keloth
db9a32a4c0 feat: Add sticker support in Line channel (#8488) 2023-12-10 20:45:44 -08:00