Commit Graph

3846 Commits

Author SHA1 Message Date
Pablo
de98e434d6 chore: Update year in LICENSE (#8835)
Update year in LICENSE
2024-02-01 15:37:05 +05:30
Sivin Varghese
74e5e2163a feat: Inbox options dropdown menu (#8836) 2024-02-01 15:17:24 +05:30
Sivin Varghese
9464d4d647 feat: Inbox card context menu component (#8815)
* feat: Inbox item context menu component

* chore: Minor fix

* chore: Minor height fix

* fix: Conflict

* minor fix

* chore: Fix conflicts

* chore:  Minor fix

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2024-02-01 14:56:15 +05:30
Muhsin Keloth
b7a7e5a0d3 feat: Inbox list API integration (#8825)
* feat: Inbox view

* feat: Bind real values

* chore: code cleanup

* feat: add observer

* fix: Inbox icon

* chore: more code cleanup

* chore: Replace conversation id

* chore: Minor fix

* chore: Hide from side bar

* chore: Fix eslint

* chore: Minor fix

* fix: dark mode color

* chore: Minor fix

* feat: Add description for each notification types

* chore: remove commented code

* Update InboxList.vue

* Update InboxView.vue

* chore: fix specs

* fix: specs

* Update InboxView.vue

---------

Co-authored-by: iamsivin <iamsivin@gmail.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2024-02-01 12:10:58 +05:30
Sivin Varghese
b9c62b3fed feat: Inbox list header (#8831)
* feat: Inbox list header

* fix: Border
2024-02-01 10:22:09 +05:30
Sojan Jose
d10525a714 fix: Template sync issue for older Whatsapp channels (#8830)
- This PR introduces a modification to the channel fetching logic, ensuring that channels with older message_template_last_updated timestamps are prioritized during synchronization.
2024-01-31 18:38:01 +04:00
Sojan Jose
390cd756e8 chore: Reorganize the installation config settings (#8794)
- Reorganizing installation config settings to move more configurations into UI from environment variables
- Changes to installation config to support premium plans in the enterprise edition
- Fixes the broken premium indicator in account/show and accounts/edit page
2024-01-31 16:48:42 +04:00
Pranav Raj S
ee3f734b7b chore: Refactor RefreshOauthTokenService to improve readability (#8820)
- Added a trait called microsoft_email for the Channel::Email factory.
- Rewrote the logic to make it simple to understand
- Rewrote the specs for readability
2024-01-31 12:24:12 +04:00
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
lkfdjaskl
53d42b15b8 fix: Avoid oneOf usage in Open API 2.0 spec (#8819)
Small fixes to make spec adhere to swagger 2.0
2024-01-30 16:09:18 -08:00
Vishnu Narayanan
17cb788193 fix: Upgrade gmail_xoauth gem to 0.4.3 (#8817) 2024-01-30 11:11:38 -08:00
Muhsin Keloth
f2115b15f7 feat: Add inbox view page (#8814)
* feat: Add inbox view page

* Update accounts.js

* Update index.js
2024-01-30 13:55:20 +05:30
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
Sivin Varghese
eeb0113dc5 feat: Inbox item header component (#8810) 2024-01-30 11:38:33 +05:30
Sojan Jose
648c4caca1 chore: Move EE OpenAI spec to correct folder (#8805)
- We previously had this spec inside the enterprise folder which wouldn't be picked up by our build process, so moving to the correct folder instead.

Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
2024-01-29 20:09:17 +04:00
Shivam Mishra
2eeec22868 fix: Cookies.set does not stringify JSON (#8807)
* fix: cookie setting

* chore: remove debug statement

* chore: add specs to test stringify
2024-01-29 18:14:49 +05:30
Muhsin Keloth
ef50edb9e2 feat: Standardise the external channel user id and user name (#8802)
* feat: Standardize the external channel id and user name

* chore: add specs

* chore: add name space `social`
2024-01-29 16:57:10 +05:30
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
Sivin Varghese
cf664ca2a0 feat: Inbox item card component (#8801) 2024-01-29 14:52:55 +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
Pranav Raj S
766698cb3a chore: Upgrade @june-so/analytics-next, js-cookie to the latest version (#8799)
This is a small change, upgrading 2 packages to the latest version. getJSON is removed from the latest version, I've added a patch for the same across the codebase.

fixes: https://linear.app/chatwoot/issue/CW-3035/upgrade-dependencies
2024-01-29 11:41:42 +04:00
Shivam Mishra
082793290a feat: allow multiple files for FB and Insta [CW-3019] (#8783)
* feat: allow multiple messages

* fix: typo

* feat: send content and attachments both

* refactor: message sequence

* test: multiple attachments for instagram

* test: multiple attachments on facebook
2024-01-28 13:20:54 +05:30
Pranav Raj S
12916ceca6 fix: Capture delivery errors to avoid false positives (#8790)
The system did not detect the delivery errors earlier, resulting in some false positives. The user was not informed when an email failed to be delivered. While we do handle failure status in other channels, we were not able to capture the actual delivery status for the email channel.

This pull request makes the following changes:

- Updated the class EmailReplyWorker to use the deliver_now method instead of deliver_later. This change is made to raise any errors that may occur with the SMTP connection. The errors are then captured and sent to Sentry, and the email is marked as failed. Previously, we did not consider the case of retries in the email channel, so this feature is currently not functioning. So, I have disabled the retry option. We will address this in a follow-up ticket.
- Downgraded the net-smtp gem to version 0.3.4. This change is made to avoid an argument error when using XOAUTH2.

Fixes: https://linear.app/chatwoot/issue/CW-3032/argumenterror-wrong-authentication-type-xoauth2-argumenterror
2024-01-26 14:22:18 +04:00
Vishnu Narayanan
3c952e6a4a fix: change email conversation not found exception to log (#8785)
* fix: change email conversation not found exception to log

* chore: refactor reply_mailbox methods

---------

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2024-01-25 22:36:02 +05:30
Sojan Jose
59184122f7 fix: [Snyk] Security upgrade administrate from 0.19.0 to 0.20.1 (#8741)
-  Upgrade  administrate  gem to latest
- Update the `show` partial with changes from upstream
2024-01-25 17:33:21 +04:00
Sivin Varghese
381423b1ae fix: Removed author section from public help center (#8767)
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2024-01-25 17:17:16 +05:30
Pranav Raj S
b7c9f779ad fix: Avoid processing reactions, ephemeral, request_welcome or unsupported messages (#8780)
Currently, we do not support reactions, ephemeral messages, or the request_welcome event for the WhatsApp channel. However, if this is the first event we receive in Chatwoot (i.e., there is no previous conversation or contact in Chatwoot), it will create a contact and a conversation without any messages. This confuses our customer, as it may appear that Chatwoot has missed some messages. There are multiple cases where this might be the first event we receive in Chatwoot. One quick example is when the user has sent an outbound campaign from another tool and their customers reacted to the message.

Another event like this is request_welcome event. WhatsApp has a concept for welcome messages. You can send an outbound message even though the user has not send a message. You can receive notifications through a webhook whenever a WhatsApp user initiates a chat with you for the first time. (Read the Welcome message section: https://developers.facebook.com/docs/whatsapp/cloud-api/phone-numbers/conversational-components/ ). Although this can help the business send a pro-active message to the user, we don't have it scoped in our feature set. For now, I'm ignoring this event.

Fixes https://linear.app/chatwoot/issue/CW-3018/whatsapp-handle-request-welcome-case-properly
Fixes https://linear.app/chatwoot/issue/CW-3017/whatsapp-handle-reactions-properly
2024-01-25 11:40:18 +04:00
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
Shivam Mishra
3760f206e8 fix: mutex timeout and error handling (#8770)
Fixes the follow cases 
- The ensure block released the lock even on LockAcquisitionError
- Custom timeout was not allowed

This also refactored the with_lock method, now the key has to be constructed in the parent function itself

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2024-01-24 14:18:21 +04:00
Sojan Jose
a861257f73 chore: Fix flaky contacts spec (#8773)
- The ordering was not guaranteed; hence, the specs were failing randomly. Made changes to the expectations accordingly
2024-01-24 13:58:27 +04:00
Muhsin Keloth
143299f138 feat: Add contact_type attribute to contact model (#8768) 2024-01-24 12:26:47 +05:30
Vishnu Narayanan
232369cd5c feat: sla 1 - refactor sla_policies model and add applied_sla model (#8602)
* feat: add models

* chore: refactor sla column names

* chore: remove foreign keys

* chore: fix spec

* chore: refactor models
2024-01-23 23:48:02 +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
Sivin Varghese
d0cd1c8887 fix: Help center articles not accessible after authoring agent is deleted (#8756) 2024-01-23 14:06:51 +05:30
Muhsin Keloth
682a2aea1c chore: Handle twillio Down::ClientError (#8757)
Fixes: https://linear.app/chatwoot/issue/CW-2992/downclienterror-400-bad-request-downclienterror
2024-01-22 15:33:26 +04:00
Shivam Mishra
1dc66db516 fix: SQL error when rules with missing attributes is triggered (#8673) 2024-01-22 16:09:34 +05:30
Sojan Jose
bc04d81a5a fix: Handle Net::IMAP::InvalidResponseError Exception bad response type "ESMTP" (#8755) 2024-01-22 15:32:44 +05:30
Sojan Jose
d2c5c2f9a3 chore: [Snyk] Security upgrade sidekiq from 7.2.0 to 7.2.1 (#8748)
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2024-01-22 13:12:26 +04:00
Sojan Jose
381fda270a chore: Fix typo in Inbox Management copy (#8750)
- Fixes the typo in Inbox Management copy -> vistors to visitors
2024-01-22 13:07:36 +04:00
Arooba Shahoor
b3c9d1f1a5 fix: clear timers and animation frame request before component unmounts (#8700)
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2024-01-22 12:08:33 +05:30
Sivin Varghese
fd4376d062 fix: TypeError: Cannot read properties of undefined (reading 'emoji') (#8753) 2024-01-22 12:06:59 +05:30
Pranav Raj S
a8f053921b fix: Migrate notes when merging the contacts (#8749)
Fixes: https://linear.app/chatwoot/issue/CW-2987/migrate-notes-of-the-secondary-contact-to-primary-contact-when-merging
2024-01-20 10:32:18 +04:00
Sivin Varghese
8e15ada164 fix: TypeError: Cannot read properties of undefined (reading 'emoji') (#8747) 2024-01-19 19:55:51 +05:30
Sojan
51093fd543 Merge branch 'release/3.5.2' into develop 2024-01-19 15:15:33 +04:00
Sojan
48e638cc56 Bump version to 3.5.2 2024-01-19 15:14:49 +04:00
Pavel Kuzmin
e6dfc159ed fix: change teamid (#8613) 2024-01-19 16:15:28 +05:30
Chatwoot Bot
900c2de89a chore: Update translations (#8717) 2024-01-19 14:32:27 +04:00
Pranav Raj S
29106ebc4b fix: raise_lock_acquisition_error if the job cannot set the lock (#8744)
Consider a scenario where two jobs are concurrently accessing a job with a lock mechanism. If the second job accesses lock_manager.locked? before the first job called lock_manager.lock(lock_key), it would return a false positive. At this point, both jobs can be executed freely.

To address this issue, the following change ensures that only the current thread that has set the lock can execute. Otherwise, a LockAcquisitionError will be thrown.

Co-authored-by: Sojan Jose <sojan@pepalo.com>
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
2024-01-19 14:31:41 +04:00