Compare commits

...
Author SHA1 Message Date
Shivam Mishra 89e007c4c3 feat: disable upload after one message 2024-01-25 11:00:03 +05:30
Muhsin KelothandGitHub 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
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 JoseandGitHub 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 KelothandGitHub 143299f138 feat: Add contact_type attribute to contact model (#8768) 2024-01-24 12:26:47 +05:30
Vishnu NarayananandGitHub 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 SumanandGitHub 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
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 VargheseandGitHub d0cd1c8887 fix: Help center articles not accessible after authoring agent is deleted (#8756) 2024-01-23 14:06:51 +05:30
Muhsin KelothandGitHub 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 MishraandGitHub 1dc66db516 fix: SQL error when rules with missing attributes is triggered (#8673) 2024-01-22 16:09:34 +05:30
Sojan JoseandGitHub bc04d81a5a fix: Handle Net::IMAP::InvalidResponseError Exception bad response type "ESMTP" (#8755) 2024-01-22 15:32:44 +05:30
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 JoseandGitHub 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
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 VargheseandGitHub fd4376d062 fix: TypeError: Cannot read properties of undefined (reading 'emoji') (#8753) 2024-01-22 12:06:59 +05:30
Pranav Raj SandGitHub 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 VargheseandGitHub 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 KuzminandGitHub e6dfc159ed fix: change teamid (#8613) 2024-01-19 16:15:28 +05:30
Chatwoot BotandGitHub 900c2de89a chore: Update translations (#8717) 2024-01-19 14:32:27 +04:00
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
Pranav Raj SandGitHub a579684b34 fix: Update the message-id check to use messageId parsing from mail gem (#8743)
- Update the message ID parsing logic to use the mail gem
- Update the code to improve readability
2024-01-19 14:29:04 +04:00
c29a9ad062 feat: Updates branding logo and name in public portal footer (#8745)
- Use white-label settings for Chatwoot Help Center

Co-authored-by: Sojan <sojan@pepalo.com>
2024-01-19 13:37:24 +04:00
Muhsin KelothandGitHub 0ac015ce7a feat: Add a job to clear notifications that were created before 1 month (#8732) 2024-01-19 13:03:23 +05:30
19474e0074 chore: Improve active job error logs for deserialization error (#8742)
- Improve active job error logs for deserialization error 

Co-authored-by: Sojan <sojan@pepalo.com>
2024-01-18 19:27:18 +04:00
Sojan JoseandGitHub ce8190dacf fix: API error when using SuperAdmin token (#8739)
- Fixes the issue in release 3.5.0, which causes SuperAdmin tokens to throw error during API calls

Fixes: #8719
2024-01-18 18:49:32 +04:00
Shivam MishraandGitHub aacf326ca1 refactor: remove exception tracker (#8737) 2024-01-18 17:49:27 +05:30
Shivam MishraandGitHub e39c14460b fix: validate url for Dashboard Apps [CW-2979] (#8736) 2024-01-18 17:48:30 +05:30
Sojan JoseandGitHub 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
Shivam MishraandGitHub 4bf23adcf5 feat: use short_summary for downloading reports [CW-2962] (#8733) 2024-01-18 16:06:13 +05:30
Pranav Raj SandGitHub 1f4d860d9d fix: Use channel.inbox instead of inbox (#8734) 2024-01-18 00:46:25 -08:00
fdbb3bf4b1 fix: Optimize email fetching logic to fix bandwidth exceeded issues (#8730)
The Inboxes::FetchImapEmailsJob is designed to fetch the entire email object and check if its message id is already in the database. However, this process is resource-intensive and time-consuming, as fetching the full email object takes a significant amount of time.

On average, fetching 100 emails can take approximately 3-4 minutes to complete depending on the IMAP server. Since we are not using server flags to identify which emails have already been fetched (to avoid compatibility issues with flags in different email services), we have to fetch all previously available emails. Currently we fetch all the messages that were created from yesterday. This becomes problematic with services like Gmail, which throttle requests based on bandwidth usage.

To address this issue, I have updated the logic as follows:

Fetch the sequence IDs of all the mails in the "Inbox" that were created from yesterday.
Use the FETCH command to fetch only the message-ids using BODY.PEEK[HEADER.FIELDS (MESSAGE-ID)] with the sequence IDs we got in the previous step. This is a faster operation with lower bandwidth usage, as it only returns the sequence ID and message ID.
Check if the message IDs are already present in the database for the selected inbox.
If not present, fetch the entire email object using the FETCH command and create the message.
If the message ID is already present, ignore it and move on to the next message-id.
I have also addressed the issue of duplicate emails appearing in conversations when two fetch email jobs occur simultaneously. I have added a lock for the channel to ensure that the job gracefully exits without waiting for the current job to complete.

Fixes #7247
Fixes #6082
Fixes #8314

Co-authored-by: Sojan <sojan@pepalo.com>
2024-01-18 11:45:16 +04:00
Muhsin KelothandGitHub c899cc825d fix: Handle Contact import MalformedCSVError (#8706) 2024-01-18 13:05:58 +05:30
Muhsin KelothandGitHub eb972684b3 feat: Show notification last active time instead of created time (#8724) 2024-01-18 09:41:53 +05:30
Muhsin KelothandGitHub 896473f03e fix: Notification count is incorrect when the number of notifications exceeds the page size. (#8723)
- The notification count is incorrect when the number of notifications exceeds the page size.
2024-01-17 15:14:37 +04:00
Sojan 8c43edbd50 Merge branch 'release/3.5.1' into develop 2024-01-17 13:48:28 +04:00
Sojan 4c4eb4bd90 Bump version to 3.5.1 2024-01-17 13:47:57 +04:00
Vishnu NarayananandGitHub 88b8597e4d chore: log emails sent from chatwoot (#8721)
- Log details related to emails sent from Chatwoot to assist in debugging email delivery/bounces/complaints
2024-01-17 13:19:14 +04:00
Sojan JoseandGitHub 76fe2f9bb8 chore: Switch to Markdown instead of MarkdownV2 for telegram channel (#8720) 2024-01-17 14:28:13 +05:30
818424259f chore: Get all notification API improvments (#8549)
Co-authored-by: Sojan Jose <sojan@chatwoot.com>
2024-01-17 09:02:18 +05:30
Sivin VargheseandGitHub e67f8824d9 fix: Backdrop color for insert article modal in dark mode (#8711) 2024-01-16 18:36:43 +05:30
Sojan JoseandGitHub 8f1a1e0905 fix: Stop overwritting contact avatars unneccesarily (#8710)
While debugging a sentry error for "ActiveRecord::InvalidForeignKey ActiveStorage::Representations::RedirectController", it was noticed that we enqueue a Avatar::AvatarFromUrlJob for each setUser call, which is unnecessary. Hence making this call only if the contact doesn't have an existing avatar.

If one needs to have this avatar updated, they can go to the contacts tab and delete the current avatar, Chatwoot will pick up the new avatar in subsequent API call.
2024-01-16 16:38:46 +04:00
Mongkon KaenjanandGitHub 1b6360d9d3 chore: change OFFLINE text in th translations (#8642)
change OFFLINE text from เราไม่อยู่ to ออฟไลน์
2024-01-16 15:18:59 +04:00
8b7f10fe61 feat: log errors on automation filter (#8702)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2024-01-16 16:13:57 +05:30
4958b3e7b6 chore: Fix codespaces not booting up (#8264)
Fixed an issue where the codespace was not correctly booting up.
Fixes #7609

Co-authored-by: Liam Ashdown <liam.ashdown@debbiesvillas.co.uk>
Co-authored-by: Sojan <sojan@pepalo.com>
2024-01-16 14:34:23 +04:00
e467d15f2c chore: Update translations (#8544)
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2024-01-16 13:49:38 +04:00
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 4aab63b7df Merge branch 'release/3.5.0' into develop 2024-01-16 11:15:29 +04:00
Sojan acf24649b0 Bump version to 3.5.0 2024-01-16 11:14:38 +04:00
Sojan JoseandGitHub 316cf35795 chore: Add display manifest to whitelabel settings (#8708)
- Adds display manifest to white label settings
- Improve the app config rendering with options for display name and description
2024-01-16 09:50:23 +04:00
Muhsin KelothandGitHub 52a5a59ddb fix: Handle error if the Twillio attachment download fails to download (#8705) 2024-01-15 19:13:44 +05:30
Sivin VargheseandGitHub 22db201a08 chore: Hide the variable list if its empty. (#8704) 2024-01-15 15:45:36 +05:30
ea7898d113 feat: fallback to DB localStorage for idb names (#8682)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2024-01-15 15:08:15 +05:30
Vishnu NarayananandGitHub e7e14f01e4 fix: undefined method 'zero?' for nil:NilClass (#8689) 2024-01-15 15:07:36 +05:30
Muhsin KelothandGitHub 7d6085cefd fix: Log twillio attachment error (#8703) 2024-01-15 12:46:58 +05:30
Shivam MishraandGitHub 10076c6a3e feat: set lock timeout to 1 second (#8661) 2024-01-12 08:28:07 +05:30
Vishnu NarayananandGitHub 1c44445088 chore: Update the error message to the correct one (#8646)
-  Update the error message in reply_mailbox to more appropriate one.
2024-01-11 17:38:38 -08:00
d305c5fd0f fix: Check the file attachment URL exists before downloading attachments in Telegram. (#8679)
In rare cases, the API call to Telegram for the file path fails. We were logging the error in sentry, switching to logs instead.

Co-authored-by: Sojan <sojan@pepalo.com>
2024-01-11 17:25:46 -08:00
Muhsin KelothandGitHub 1577288843 fix: Twilo attachment download fallback to the step where authorization headers are not passed. (#8681)
In the previous release, we enabled "HTTP Basic Authentication" to secure all attachments requiring HTTP authentication. This is particularly important for media files that may contain sensitive data, as recommended by Twilio. However, some users experienced issues because they did not enable this option despite our alerts prompting them to do so.  If the authenticated attachment download call fails, add another call to download the attachment without authentication.
2024-01-11 17:23:31 -08:00
Muhsin KelothandGitHub 63b3686746 chore: Add a check to verify if the user exists before broadcasting the notification_deleted event. (#8678)
When a user is deleted, all associated notifications are also deleted from the database. As a result, the user record becomes empty. handling this case in code to prevent sentry errors.
2024-01-11 16:54:03 -08:00
810f950e16 fix: Fixes error with editor when --- is inserted (#8669)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2024-01-11 07:56:18 -08:00
dd09d560d5 fix: logic error when setting new relic logging forwarding (#8687)
Co-authored-by: Vishnu Narayanan <vishnu@chatwoot.com>
2024-01-11 21:05:04 +05:30
Sivin VargheseandGitHub c60c523851 fix: TypeError cannot read properties of undefined (reading 'queryselector') (#8671) 2024-01-11 20:42:24 +05:30
22c2235d90 fix: TypeError: Cannot read properties of null (reading 'assignee') (#8647)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2024-01-11 11:31:02 +05:30
Sojan JoseandGitHub 35c26367da chore: Unset Redis config after spec (#8685)
The sentinel configuration set in this specification seems to be affecting other specifications. So, let's ensure that the memoised config variable gets unset after execution of the spec.
2024-01-10 15:32:48 -08:00
Sojan JoseandGitHub aaf4fee9a6 chore: Fix sentry errors in email processing for bounce notifications (#8677)
This case occurs for bounce notification emails where the from address is From: "" (Mail Delivery System) . We will be discarding these emails for now.

Fixes: https://linear.app/chatwoot/issue/CW-2793/activerecordrecordinvalid-validation-failed-email-invalid-email
2024-01-10 14:30:23 -08:00
Sivin VargheseandGitHub 3c21f62485 fix: Error ResizeObserver loop completed with undelivered notifications. (#8680) 2024-01-10 11:44:13 -08:00
50b2ca014e feat: UI for unsupported message (#8660)
Display an unsupported message in UI when handling unsupported messages from channels like facebook, Instagram etc.

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2024-01-09 21:53:58 -08:00
Vishnu NarayananandGitHub d731c972ad fix: skip auditlogs for whatsapp template sync (#8579)
Skips audit logs for whatsapp_template sync
Fixes: https://linear.app/chatwoot/issue/CW-2641/skip-whatsapp-template-updates-from-audit-logs
2024-01-09 21:51:48 -08:00
Sojan JoseandGitHub 5845881b08 chore: Handle stripe events without plan data (#8668)
`plan` isn't a guaranteed object in stripe `customer.subscription.updated` events.  It can be null for cases like `send_invoice` for `past_due` event as seen in the payload shown in sentry error.

fixes: https://linear.app/chatwoot/issue/CW-2925/nomethoderror-undefined-method-[]-for-nilnilclass-nomethoderror
2024-01-09 14:48:07 -08:00
Muhsin KelothandGitHub 64138ef220 chore: Rescue Slack::Web::Api::Errors::NotInChannel error (#8670)
The primary cause of this issue is when Chatwoot sends a message to a channel that has either been deleted or is unauthorized. So, we will prompt reauthorization when this error occurs.

Fixes https://linear.app/chatwoot/issue/CW-2930/slackwebapierrorsnotinchannel-not-in-channel
2024-01-09 14:30:17 -08:00
Sojan JoseandGitHub 046ce68a45 chore: Improve Openai json rendering (#8666)
We have been observing JSON parsing errors for responses from GPT. Switching to the gpt-4-1106-preview model along with using response_format has significantly improved the responses from OpenAI, hence making the switch in code.

ref: https://openai.com/blog/new-models-and-developer-products-announced-at-devday
fixes: #CW-2931
2024-01-08 17:02:25 -08:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
e34ab5957f chore(deps): bump puma from 6.3.1 to 6.4.2 (#8663)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-08 16:51:30 -08:00
Pranav Raj SandGitHub 75a5492840 fix: Remove the usage of DragWrapper to fix the Dyte integration (#8655) 2024-01-05 15:28:20 -08:00
56fbbe92b4 feat: trigger handoff when agent bot is the actor (#8639)
- This PR adds a feature to auto-trigger handoff events when an Agent bot toggles a conversation status from Pending to Open

Co-authored-by: Sojan <sojan@pepalo.com>
2024-01-05 15:26:52 -08:00
Sojan JoseandGitHub 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
Pranav Raj SandGitHub 2c7f93978e fix: Update broken specs (#8651)
- Use fakeTimer for time.spec.js
- Use default sort as last_activity_at_desc
- Update specs for getAllConversations getter
2024-01-05 13:09:09 -08:00
Shivam MishraandGitHub 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 KelothandGitHub 68062216e4 feat: Add a job to reopen snoozed notifications (#8545) 2024-01-05 15:13:22 +05:30
Vishnu NarayananandGitHub 8a8f325f64 fix: messageTimestamp test (#8644) 2024-01-05 12:36:26 +05:30
Kevin LinandGitHub cf90b898f4 feat: enable new relic log decorations (#8616)
This enables local decorating of logs when using a new relic. It can be used when you use a log forwarding agent to do additional enrichment on APM logs before forwarding to the new relic.
2024-01-04 15:34:55 -08:00
Sojan JoseandGitHub 1f4cb0e1ca chore: add config for Darkmode logo for whitelabeling (#8597)
-  Add config for dark mode logo
2024-01-04 15:30:55 -08:00
c6ecf80dff chore(synk): Upgrade administrate to fix 2 vulnerabilities (#8625)
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2024-01-04 13:38:03 -08:00
c29b77c214 chore(snyk): Security upgrade factory_bot_rails from 6.4.2 to 6.4.3 (#8628)
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2024-01-04 10:47:48 -08:00
Pranav Raj SandGitHub c301845ade chore: 2023 -> 2024 (#8635) 2024-01-03 12:49:36 -08:00
Sivin VargheseandGitHub 78fab7897d feat: Use typing status from utils (#8589) 2023-12-22 13:47:41 +05:30
f48e014694 feat: Updates the design of the network connection warning snack bar (#8509)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-12-21 14:16:21 -08:00
Nithin David ThomasandGitHub 206433db32 feat: Adds dropdown to switch locales from articles list page (#8402) 2023-12-21 13:16:59 -08:00
1ddb73ea97 chore(security): Security upgrade omniauth from 2.1.1 to 2.1.2 (#8591)
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2023-12-20 13:38:34 -08:00
Muhsin KelothandGitHub b5071e61d7 feat: Add last_activity_at field to Notification model (#8585) 2023-12-20 13:02:37 +05:30
Muhsin KelothandGitHub a80eff9aa3 feat: Enable custom attributes in the suggestion for variables. (#8520) 2023-12-20 12:20:09 +05:30
Sojan a59fb90785 Merge branch 'release/3.4.0' into develop 2023-12-18 21:23:02 -08:00
Sojan 29478880ff Bump version to 3.4.0 2023-12-18 21:22:06 -08:00
Vishnu NarayananandGitHub c9f8cdb51b fix: switch to nodejs ppa for linux installations (#8337)
Nodesource script-based installation is deprecated. Switch to a different ppa for nodejs.

Fixes: https://linear.app/chatwoot/issue/CW-2686/upgrade-warning
Fixes: #8151
2023-12-18 21:18:42 -08:00
Pranav Raj SandGitHub a2ebf92932 fix: Fix the issue "Undefined method `inbox' for Instagram::MessageText" (#8582) 2023-12-19 08:43:43 +05:30
Pranav Raj SandGitHub 00eb5b152a chore(migration): Re-run database migration job for caching. (#8581)
A support request that came to Chatwoot Cloud revealed that the job was timed prematurely. The default timeout for Sidekiq queues was set as 25 minutes in sidekiq.yml file. The cache was not created properly for the accounts with more than 100k conversations.

This change removes the cache logic in the previous migration and creates a new migration with a new job which processes conversations in batch.
2023-12-18 17:29:02 -08:00
Sojan JoseandGitHub 0b2f539ad0 chore: Update self-hosted billing redirect (#8580) 2023-12-18 16:34:47 -08:00
Shivam MishraandGitHub 1ab3966b75 fix: @inbox usage in logs (#8578) 2023-12-18 19:30:41 +05:30
552d967c81 fix: Use ogg format for Telegram audio messages (#8505)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-12-16 11:55:47 -08:00
Sivin VargheseandGitHub e5c8a68a76 fix: Typing indicator to support dark mode (#8564) 2023-12-15 09:57:13 +05:30
Sivin VargheseandGitHub 15f50635e7 fix: undefined method `available_name' for nil:NilClass (#8563) 2023-12-15 09:41:35 +05:30
LiamandGitHub cf0d6dd7c6 feat: Implement the ability to be able to rotate an image on agent conversation. (#8559) 2023-12-15 09:20:24 +05:30
Sivin VargheseandGitHub fd1813949a fix: Undefined method `name' for nil:NilClass (#8562) 2023-12-15 09:03:16 +05:30
Shivam MishraandGitHub 6c480098f7 chore: log authentication error for FB and Instagram (#8551) 2023-12-14 16:18:23 +05:30
Shivam MishraandGitHub ae649a5b3f refactor: add better logs to Instagram::MessageText (#8538) 2023-12-14 14:03:40 +05:30
34675da6fa feat: Settings screen for custom branding (#8543)
- Ability to configure Chatwoot custom branding from UI when using paid plans

Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
2023-12-13 13:16:24 -08:00
075b0292b5 feat: Conversation list virtualization (#8540)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-12-13 17:28:30 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Sivin VargheseShivam Mishra
0e9825f298 chore(deps): bump axios from 0.21.2 to 1.6.0 (#8339)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
2023-12-13 16:24:10 +05:30
bf883794a4 fix: accepting external source_id (#8359)
Co-authored-by: Sojan <sojan@pepalo.com>
2023-12-13 16:21:55 +05:30
Sivin VargheseandGitHub 3adaa2d602 fix: Retry message not working if the conversation has an external issue (#8529) 2023-12-13 15:46:10 +05:30
60a312ace5 feat: Advanced conversation sort options (#8532)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-12-12 19:59:31 -08:00
Pranav Raj SandGitHub 8c9a351c84 feat: Add support for ascending and descending options in sort (#8542) 2023-12-12 17:15:48 -08:00
Pranav Raj SandGitHub 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
Sojan JoseandGitHub 376de685fb chore: Adds API for agent bot avatar upload (#8533)
Adds API for agent bot avatar upload
- accounts/agent_bot
- platform/agent_bot
2023-12-11 19:02:11 -08:00
Pranav Raj SandGitHub 890515edfd feat(perf): Cache labels on the conversation model (#8527) 2023-12-11 18:27:55 -08:00
Shivam MishraandGitHub 79412ba2c6 feat: disable reply to message in WhatsApp via 360 dialog (#8500) 2023-12-11 16:54:47 +05:30
03ebb6947b chore(synk): Upgrade sentry-rails from 5.13.0 to 5.14.0 (#8420)
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-12-10 22:00:17 -08:00
c53591f049 chore(snyk): Security upgrade sidekiq-cron from 1.11.0 to 1.12.0 (#8523)
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-12-10 21:59:12 -08:00
Muhsin KelothandGitHub db9a32a4c0 feat: Add sticker support in Line channel (#8488) 2023-12-10 20:45:44 -08:00
2ae9bbb24e chore(snyk): Security upgrade factory_bot_rails from 6.2.0 to 6.4.2 (#8371)
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-12-10 20:43:58 -08:00
8dfe193461 feat: Add infinite loader, option for increasing page size (#8525)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-12-10 20:09:17 -08:00
Sivin VargheseandGitHub 27239ae14a feat: Adds API for retry messages in conversation (#8518) 2023-12-11 09:33:39 +05:30
Muhsin KelothandGitHub 80ff5e2d0a chore: Change the RemoveMessageNotifications job implementation. (#8521) 2023-12-11 08:27:30 +05:30
38240a68aa [Snyk] Security upgrade rack-mini-profiler from 3.1.1 to 3.2.0 (#8508)
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2023-12-10 15:02:59 -08:00
Sojan JoseandGitHub 89710b406e chore: Remove missing styles for super admin (#8519)
- Remove missing stylesheet references for super admin
2023-12-08 20:47:57 -08:00
f002870c6a feat: Super admin design improvements (#8517)
- Revamp the super admin design
- Introduce a new settings page for support and billing settings
- Move the access tokens into users, agent bots and platform app show pages


Co-authored-by: Sojan <sojan@pepalo.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-12-08 19:40:35 -08:00
Muhsin KelothandGitHub b1a68759cf feat: Add the support for custom attributes in message variables (#8511) 2023-12-08 14:13:35 -08:00
Muhsin KelothandGitHub bf49a17efa feat: Handle notification.deleted action cable event (#8501) 2023-12-06 16:49:00 +05:30
Muhsin KelothandGitHub 6b0d1d77d3 fix: Email notifications (#8502) 2023-12-06 15:50:23 +05:30
Muhsin KelothandGitHub db33b7d1dc feat: Clear all previous notifications if a new notification is added to a conversation (#8490) 2023-12-06 14:03:43 +05:30
Muhsin KelothandGitHub 76711d95ff chore: Change primary actor to Conversation for all the notification types. (#8435) 2023-12-06 10:43:09 +05:30
Sivin VargheseandGitHub 17faa6c3b2 fix: Undefined method `length' for nil:NilClass (#8491) 2023-12-05 16:34:29 +05:30
Sivin VargheseandGitHub c1ac354c9b fix: Remove article meta tag is not working (#8489) 2023-12-05 16:17:41 +05:30
Muhsin KelothandGitHub 449503bb94 feat: Snooze notification API (#8439) 2023-12-04 12:32:35 +05:30
Muhsin KelothandGitHub aad18e1ca4 feat: Add notification_deleted action cable event (#8431) 2023-12-01 23:06:22 +05:30
Muhsin KelothandGitHub fdc1123b18 feat: Add support for attachments(image and video) in LINE channel (#8425) 2023-12-01 07:23:35 +05:30
Anthony MeirlaenandGitHub 0974b1e705 fix: Install node 20.x in non-production docker (#8441) (#8442) 2023-11-30 16:22:34 -08:00
Muhsin KelothandGitHub bc6e3e598f feat: Delete notification by id API (#8430) 2023-11-29 22:45:11 +05:30
683f9d9a28 fix: article meta does not show up on reload (#8415)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-11-29 16:15:31 +05:30
Martín GómezandGitHub f9bf0883c6 feat: Allow more image formats in avatar uploads form (#8419) 2023-11-28 11:18:16 +05:30
ad8ba299c9 feat: Author sections in category block and category list (#8414)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-11-27 15:13:38 +05:30
Muhsin KelothandGitHub 3ae64822e1 chore: Enforce HTTP Basic Authentication for Twilio medias. (#8396) 2023-11-27 13:24:53 +05:30
Sivin VargheseandGitHub a49aaee9cf fix: Email messages in dark mode (#8300) 2023-11-24 12:14:02 +05:30
Sivin VargheseandGitHub 2d1f70eb79 feat: Update public portal colors with new design (#8230) 2023-11-23 08:16:52 +05:30
Sojan JoseandGitHub 4fc5f765de chore: Make super admin auth error readable (#8406)
- Remove the cryptic error for super admin auth and make it more readable
2023-11-22 17:26:08 -08:00
Nithin David ThomasandGitHub 7efc2726d9 fix: Updates the text alignment on articles table (#8405) 2023-11-23 02:58:00 +05:30
Pranav Raj SandGitHub 29a778697c fix: Remove validation for message signature (#8404) 2023-11-22 13:09:17 -08:00
Pranav Raj SandGitHub 90649e72bb fix: Add a .present? check for sentiment file path to avoid false positives (#8401) 2023-11-22 10:35:51 -08:00
Pranav Raj SandGitHub 1904ec7df4 fix: Update campaign routes to fix the rendering issue (#8400) 2023-11-22 09:39:41 -08:00
Nithin David ThomasandGitHub 96add30331 chore: Add analytics event for insert article feature (#8393) 2023-11-22 08:18:58 -08:00
9c7148e2ad feat: Split dashboard to chunks for build performance (#8394)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-11-21 14:51:05 -08:00
31c709be5c fix: Opens foreign links from article page in new tab [cw-2725] (#8304)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-11-22 01:57:58 +05:30
e750ee6d28 chore: [Snyk] Security upgrade administrate-field-active_storage from 0.4.2 to 1.0.0 (#8382)
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2023-11-20 19:42:54 -08:00
Vishnu NarayananandGitHub 5b3f9ac1cd chore: skip node upgrade if latest on cwctl upgrade (#8336) 2023-11-20 12:48:39 +05:30
Muhsin KelothandGitHub 6c8dacfa0d feat: Facebook delivery reports (#8136) 2023-11-20 12:22:45 +05:30
Sojan feead30b0b Merge branch 'release/3.3.1' into develop 2023-11-18 10:24:35 -08:00
Sojan 4244945e7b Bump version to 3.3.1 2023-11-18 10:23:18 -08:00
Clairton Rodrigo HeinzenandGitHub 17725e4dd0 fix: Breakage of message pane when Openai integration isn't enabled (#8381)
Error when the Openai integration isn't enabled

fixes: https://github.com/chatwoot/chatwoot/issues/8379
2023-11-18 10:18:55 -08:00
Sojan d55bb63aa0 Merge branch 'release/3.3.0' into develop 2023-11-17 20:37:44 -08:00
Sojan 6e22695b85 Bump version to 3.3.0 2023-11-17 20:34:39 -08:00
Pranav Raj SandGitHub 146e46d79f fix: Disable AI Assist CTA if not required (#8375)
- Show CTAs only on production
2023-11-17 20:10:46 -08:00
Nithin David ThomasandGitHub 0af27a2387 feat: Adds support for logo in portal settings page [CW-2585] (#8354) 2023-11-17 19:58:27 -08:00
7380f0e7ce chore: Making OpenAI label suggestions optional (#8374)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-11-17 19:54:15 -08:00
Pranav Raj SandGitHub 2c5a0abcce fix: Update the height of the input based on the rows (#8373) 2023-11-17 17:29:44 -08:00
Sojan JoseandGitHub f23e33c1a9 perf: Remove unwanted conversation count query (#8372) 2023-11-17 16:40:40 -08:00
5588d6e344 feat: convert feature_flag to bigint [CW-2767] (#8350)
Co-authored-by: Sojan <sojan@pepalo.com>
2023-11-17 15:50:24 -08:00
59ace66c6f chore: [Snyk] Fix for vulnerabilities (#8340)
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2023-11-17 15:24:00 -08:00
Sojan JoseandGitHub decef1ad52 chore: Add rails_panel gem for query debugging (#8370) 2023-11-18 02:30:35 +05:30
Sojan JoseandGitHub 0e19a4196b chore: Endpoint to purge portal logo (#8365) 2023-11-18 01:13:22 +05:30
Muhsin KelothandGitHub 04dd65687b feat: Changes to include delivery reports for all channels (#8329) 2023-11-16 19:43:35 +05:30
Muhsin KelothandGitHub 5f503b1a57 feat: Change slack bot and activity message appearance (#8349) 2023-11-16 12:59:52 +05:30
Sojan JoseandGitHub 5f6e974531 chore: Add website_token into request logs (#8362)
- Log website_token into request logs to identify specific widgets
2023-11-15 20:32:21 -08:00
Sojan JoseandGitHub a023eabf59 chore: Add logging for facebook errors (#8360)
- Add logging for Facebook errors
2023-11-15 14:56:21 -08:00
Sivin VargheseandGitHub cb1e25a487 feat: Change the highlight in article page on scrolling (#8330) 2023-11-15 13:51:46 +05:30
Sojan JoseandGitHub bcf7c6c45a chore: Improve account seeding (#8357) 2023-11-15 13:29:00 +05:30
Shivam MishraandGitHub b411b6ca21 feat: remove feature flag checks for message reply to (#8352) 2023-11-15 13:05:58 +05:30
Shivam MishraandGitHub cd217a3f86 feat: allow automation rules to remove labels (#8346) 2023-11-13 13:10:55 +05:30
Pranav Raj SandGitHub 6c79642450 chore: Update dashboard screenshots and the logo (#8342) 2023-11-11 23:08:05 +05:30
Nithin David ThomasandGitHub 201d476720 chore: Add meta viewport tag to public portal (#8335) 2023-11-09 20:30:58 -08:00
Muhsin KelothandGitHub c1a2e67c9e fix: Change the route change logic based on bus events, after creating a new conversation in the widget. (#8328) 2023-11-10 09:44:59 +05:30
1948bef9ac fix: Fix line break issue with link in portal header (#8323)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-11-08 20:38:38 -08:00
Sivin VargheseandGitHub 5486f39f7e feat: Update uncategorized block design (#8324) 2023-11-09 08:47:38 +05:30
f018b0013c feat: Updated the design of the article page (#8166)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-11-08 18:05:13 -08:00
950f085e80 feat: Updated the design of the category page (#8165)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-11-08 18:03:16 -08:00
268e26625b feat: Adds the ability to see the popular articles (#8152)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-11-08 18:01:07 -08:00
7041d86e4d feat: Updated home page design (#8106)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-11-08 17:59:03 -08:00
78398ee800 feat: Updated public portal header design (#8089)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-11-08 17:56:59 -08:00
Sojan JoseandGitHub 7b09b02737 chore: Fix trigger message for response Bot (#8322)
- Fix the bug where wrong messages was used to search response sources
2023-11-08 17:02:48 -08:00
Muhsin KelothandGitHub af7631d9f1 chore: Update MarkMessagesAsReadJob to accept delivered status (#8319) 2023-11-08 13:44:57 -08:00
Sivin VargheseandGitHub e0f33e62af feat: Adds support for image resize in the message bubble (#8182) 2023-11-08 14:11:47 +05:30
5d224f2e04 feat: allow inbox specific flags for signature toggle (#8280)
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
2023-11-08 10:47:22 +05:30
Gabriel QuinaandGitHub 4cb981d81b fix: Semantics across portuguese translations (#8291) 2023-11-08 10:42:57 +05:30
f891cfbf47 chore: [Snyk] Security upgrade sidekiq-cron from 1.10.1 to 1.11.0 (#8294)
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2023-11-08 10:32:04 +05:30
Sojan JoseandGitHub e54c8a857d chore: Debug ChatGpt response (#8316)
- Add loggers to debug ChatGPT requests and responses
2023-11-07 20:07:29 -08:00
66229b0d6b chore: [Snyk] Security upgrade audited from 5.4.0 to 5.4.1 (#8305)
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2023-11-07 17:45:32 -08:00
Muhsin KelothandGitHub 3eb1d49577 fix: Handle all types of errors in API channel webhooks (#8307) 2023-11-07 12:54:49 +05:30
Vishnu NarayananandGitHub 677888bcde feat: Add job to remove stale contact inboxes (#8096) 2023-11-06 20:24:30 -08:00
abbb4180ea chore: Add facebook business_management scope (#8004)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-11-06 18:37:41 -08:00
Pranav Raj SandGitHub d1cbc56d67 chore: Update widget config API to migrate the widget (#8303)
- Update the keys in the widget config API to support loading the widget separately from the Rails App.
2023-11-06 15:27:29 -08:00
EmanuelandGitHub b579ff832e chore: Update the case in the translation files (#8298) 2023-11-06 08:01:54 -08:00
Nithin David ThomasandGitHub 39d0748a5b feat: Lets users insert connected portal article into replies [CW-2282] (#8117)
- Lets users insert connected portal articles into replies

https://linear.app/chatwoot/issue/CW-2282/list-all-the-top-articles-from-the-connected-help-center
https://linear.app/chatwoot/issue/CW-1453/container-view-for-showing-search-input-and-result-items
2023-11-04 02:57:25 -07:00
Muhsin KelothandGitHub b4d20689b7 feat: Mark the messages as failed if the API channel webhooks fail for any reason. (#8277) 2023-11-04 12:26:28 +05:30
3b84b0fc47 feat: Creates 404 page for public portal [CW-2727] (#8293)
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-11-04 04:59:44 +05:30
Nithin David ThomasandGitHub 23ea829510 chore: Refactors help center article url helper (#8269) 2023-11-04 04:18:34 +05:30
ebe9daea00 chore: Swagger documentation for contact labels APIs (#8279)
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-11-03 15:09:12 +05:30
Shivam MishraandGitHub 36b6c0cb9c feat: support image height in markdown rendering of messages (#8177)
- This PR adds BaseMarkdownRenderer, it takes all the required attributes from the image node, parses the cw_image_height query and renders it.
2023-11-02 13:51:54 -07:00
Muhsin KelothandGitHub 16c36a78f0 chore: Remove sentry exceptions for the message status failed errors (#8285)
- Remove sending exceptions to Sentry after capturing the message failed errors.
2023-11-02 12:00:22 -07:00
Nithin David ThomasandGitHub 4999f7ed23 fix: Fixes wrong page size in category filter in articles page (#8270) 2023-11-02 15:19:19 +05:30
Chatwoot BotandGitHub e8f4ac632f chore: Update translations (#8255) 2023-11-01 15:13:32 -07:00
3c7854ccdf fix: Fixes error in ChatList component (#8266)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-11-02 03:23:29 +05:30
Pranav Raj SandGitHub 1e70223ed7 chore: Upgrade Cypress to 13.4.0 (#8271) 2023-10-31 19:39:34 -07:00
f34cd3ea61 chore: [Snyk] Security upgrade newrelic-sidekiq-metrics from 1.6.1 to 1.6.2 (#8254)
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2023-10-31 18:24:18 -07:00
Muhsin KelothandGitHub 68b8d721a7 fix: Update the message status to failed if the outgoing Facebook message fails. (#8258) 2023-10-31 17:40:17 -07:00
Nithin David ThomasandGitHub d876419b27 fix: Update text area height while typing [CW-2438] (#8268) 2023-10-31 17:39:25 -07:00
8455186e9f feat: allow instagram reply_to [CW-2609] (#8248)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-10-31 17:31:12 -07:00
b6584ec68b feat: toggle reply to on widget based on feature flag (#8261)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-10-31 21:33:14 +05:30
Muhsin KelothandGitHub 29f18c7f18 fix: Handle Twilio::REST::RestError (#8257) 2023-10-31 16:23:34 +05:30
Muhsin KelothandGitHub 11b27f9805 feat: Handle Line send message/attachments errors (#8200) 2023-10-31 07:42:30 +05:30
Pranav Raj SandGitHub 653e0335c0 fix: Handle PermissionDeniedError for Dialogflow processor (#8252) 2023-10-30 13:24:03 -07:00
013dab7da6 fix: Add support for dark mode for the calendars (date and time picker). (#8250)
Co-authored-by: Liam Ashdown <liam.ashdown@debbiesvillas.co.uk>
2023-10-30 11:48:16 -07:00
Pranav Raj SandGitHub 2ba81830f3 fix: Update Instagram story rendering (#8240) 2023-10-30 11:16:14 -07:00
Sivin VargheseandGitHub dfba4770bd feat: Save sort Conversations filter (#8237) 2023-10-30 15:25:21 +05:30
LiamandGitHub 63e702ca12 fix: Fix an issue where Chat Widget Unread Message is not correctly d… (#8245) 2023-10-30 12:52:26 +05:30
Will KramerandGitHub 394fece846 docs: Update .env.example for clearer inbound Postmark instructions (#8235)
Updated the .env.example file to provide clearer instructions for setting up the Postmark inbound webhook. Many users, including myself, found the initial instructions ambiguous, leading to difficulties during setup. This change aims to simplify the process for future users by providing clearer instructions and examples.

Fixes: #8234
2023-10-27 16:06:27 -07:00
Muhsin KelothandGitHub 24fbab94c3 chore: Refactor MarkMessagesAsReadJob based on conversation id and time stamp (#8217)
- Mark all messages as read by providing the conversation ID and timestamp.
- For Instagram, ensure all previous messages that weren't marked as failed are now marked as read. This is because the read events are only triggered for the most recent message and not for any previous ones.
2023-10-27 15:21:39 -07:00
Muhsin KelothandGitHub 61e03fa33a feat: Bandwidth sms channel delivery reports (#8198)
Fixes: https://linear.app/chatwoot/issue/CW-2566/delivery-report-for-bandwidth-sms
2023-10-27 14:07:15 -07:00
Pranav Raj SandGitHub 6c4b92f7f6 fix: Revert the changes for SyncCustomFilterCountJob (#8238) 2023-10-27 10:45:48 -07:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
f023325b0e chore(deps): bump browserify-sign from 4.2.1 to 4.2.2 (#8233)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-27 07:39:48 -07:00
dd05482cb0 chore: update UI copy (#8229)
Co-authored-by: Hricha Shandily <hrichashandily@gmail.com>
2023-10-27 16:05:42 +05:30
d94108bf3f feat: show ReplyTo in widget UI (#8094)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-10-27 13:35:02 +05:30
ab872beb1d feat: Helper to support dynamic system theme in public portal (#8206)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-10-26 12:59:51 +05:30
d02cfff4cc fix: canned responses not working when signature is present (#8176)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-10-26 11:35:46 +05:30
Robert CokerandGitHub 736f269c49 fix: Always reset CC/BCC emails when switching conversations (#8157) 2023-10-25 21:42:36 -07:00
Pranav Raj SandGitHub b067acfd4a fix: Update the alignment of the info icon on contact info panel (#8216) 2023-10-25 21:30:14 -07:00
Sivin VargheseandGitHub 232fa6fd18 fix: Revert missing files for search (#8215) 2023-10-26 09:08:28 +05:30
Chatwoot BotandGitHub 483d55df91 chore: Update translations (#8161) 2023-10-25 19:20:30 -07:00
3e54d3654b feat: Updated the search result fly-out menu design (#8203)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-10-25 19:16:49 -07:00
Sojan JoseandGitHub b6831d464e chore: Update API documentation for whatsapp templates (#8211)
- Update API documentation for whatsapp templates
2023-10-25 17:06:58 -07:00
Sojan JoseandGitHub 8c67ea56e7 chore: Campaign conversations should be created in open state (#8209)
- Ensure that conversations originating from campaigns are created in the open state.
2023-10-25 13:03:08 -07:00
Muhsin KelothandGitHub 54bc4c23df fix: Telegram model specs (#8207) 2023-10-26 00:14:09 +05:30
Muhsin KelothandGitHub 58f47eb02c feat: Handle Facebook send message/attachments errors (#8197) 2023-10-25 08:59:25 -07:00
4fc62ed9ae feat: Handle Instagram send message/attachments errors (#8174)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-10-25 08:56:09 -07:00
4a89bab23a feat: Handle Telegram send message/attachments errors (#8173)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-10-25 08:36:31 -07:00
Muhsin KelothandGitHub 7438f3b157 fix: Rescue slack ChannelNotFound error (#8196) 2023-10-25 13:53:30 +05:30
Shivam MishraandGitHub 9551dbc25f feat: add gtm to vueapp (#8154) 2023-10-24 15:51:21 +05:30
Sivin VargheseandGitHub 2e54f4a67c feat: Adds an event for the Google Translate usage (#8175) 2023-10-24 15:34:51 +05:30
Shivam MishraandGitHub 6d9b2a6b33 refactor: UI flags for Reply To (#8147) 2023-10-20 14:19:19 +05:30
Sivin VargheseandGitHub 35a9acf099 feat: Adds the ability to set an emoji for help center category (#8111) 2023-10-20 13:52:30 +05:30
b9694a0818 feat: support reply to for Telegram (#8105)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-10-20 13:14:20 +05:30
Shivam MishraandGitHub 7416bbb25e feat: support reply to for outgoing message in WhatsApp (#8107)
- This PR enables replies to WhatsApp.
2023-10-19 13:24:46 -07:00
Muhsin KelothandGitHub b94c89ebf1 fix: Show sent status for messenger channel (#8145) 2023-10-19 13:22:19 +05:30
Muhsin KelothandGitHub 78ce8a4652 feat: Add support for Instagram delivery reports (#8125) 2023-10-18 23:42:34 -07:00
Muhsin KelothandGitHub 04c874fe35 feat: Add delivery reports for API channel (#8116) 2023-10-18 10:11:13 +05:30
Sojan eabe548520 Merge branch 'release/3.2.0' into develop 2023-10-17 17:55:42 -07:00
Sojan f96b54e57f Bump version to 3.2.0 2023-10-17 17:54:38 -07:00
Pranav Raj SandGitHub d3bf828524 chore: Adds hasConversation flag in chatwoot:on-start-conversation event (#8132) 2023-10-17 16:24:00 -07:00
c20415f3ba test: reset Current.user before each example (#8126)
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-10-17 15:42:45 -07:00
Pranav Raj SandGitHub 6b2ed4fe79 fix: Add reset password for edit agent screen (#8130) 2023-10-17 12:54:05 -07:00
Shivam MishraandGitHub eca9ca90f1 feat: Add June event for reply to (#8118) 2023-10-17 09:51:28 -07:00
Shivam MishraandGitHub 9018ec9678 test: reset Current.user after spec (#8123) 2023-10-17 18:06:54 +05:30
Shivam MishraandGitHub e55fe33f1b test: fix flaky test by adding margin for time diff (#8121) 2023-10-17 14:20:40 +05:30
3b0788c3be chore: Update translations (#8024)
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-10-16 19:55:25 -07:00
Vishnu NarayananandGitHub 626e67b859 feat: add autoupdate for cwctl (#8108)
- During cwctl --upgrade, check for the latest version of cwctl from master branch
- Upgrade cwctl if a newer version is found
2023-10-16 19:43:44 -07:00
Nithin David ThomasandGitHub 28db18ebbd chore: Shows articles in dark mode for widget (#8115) 2023-10-16 16:59:15 +05:30
b28721e10b feat: Creates components for Article Search in Reply [CW-2285] (#7957)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-10-16 15:02:02 +05:30
Shivam MishraandGitHub f77db4d814 refactor: disable bubble by flag (#8109) 2023-10-13 21:34:22 +05:30
62d8ec7edb feat: support reply to for incoming messages on facebook (#8076)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-10-13 16:33:50 +05:30
7b09fa4a03 chore(snyk): Upgrade gems to fix SNYK-RUBY-RACK-1061917 (#8104)
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2023-10-13 09:24:50 +05:30
Muhsin KelothandGitHub 980013abae feat: Add delivery reports for live chat (#8092) 2023-10-12 20:48:20 +05:30
Shivam MishraandGitHub 5c729ccea5 chore: Add null checks (#8100) 2023-10-12 19:39:19 +05:30
Vishnu NarayananandGitHub ae52ca87aa fix: Handle empty status in conversation controller (#8091)
Fixes CW-2644
2023-10-12 17:11:04 +05:30
Vishnu NarayananandGitHub 415bb23c37 fix: Handle invalid metric in ReportsController (#8086)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>

Fixes CW-2643
2023-10-12 17:01:23 +05:30
Pranav Raj SandGitHub 9e173fca3c fix: Return 404 if conversation is nil (#8098) 2023-10-12 17:00:51 +05:30
Muhsin KelothandGitHub bd918ee506 fix: Change the message status to failed if the Twilio message delivery status is undelivered (#8097) 2023-10-12 15:27:38 +05:30
Shivam MishraandGitHub 7c9884b853 feat: Remove unused prop (#8093) 2023-10-12 12:14:39 +05:30
7ffa669c5c feat: Implement message bubble reply to (#8068)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-10-11 22:04:12 +05:30
0bc20873f6 feat: Add delivery status for Twilio Channel (#8082)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-10-11 21:17:46 +05:30
88de3359a5 fix: Long names hide the resolve button (#8083)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-10-11 13:25:20 +05:30
Sojan JoseandGitHub a3d008da06 chore: Ensure null validation for private attribute in messages (#8085) 2023-10-11 13:16:59 +05:30
cbae95422d feat: Implement reply to for reply editor (#8063)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-10-10 19:13:12 +05:30
Shivam MishraandGitHub 081c845c56 chore: Remove twitter actions (#8079) 2023-10-10 16:48:58 +05:30
Pranav Raj SandGitHub 1e54d6deb3 fix: Update duplicate ids for dashboard app frame (#8077) 2023-10-10 16:46:32 +05:30
Shivam MishraandGitHub bb5c6a416a fix: insert position for canned responses (#8069) 2023-10-10 10:36:10 +05:30
6a07251007 feat: Add the ability to self-assign conversations in macros (#8048)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-10-10 09:38:23 +05:30
Sivin VargheseandGitHub 759a66dd21 feat: Add the ability to send attachment in new conversation (#7913) 2023-10-10 09:34:36 +05:30
Vishnu NarayananandGitHub 8189dd932c feat: Report cwctl events to hub (#8009) 2023-10-10 09:16:03 +05:30
b6ba0f343e feat: Reverse the contact merge (#8057)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-10-10 08:20:48 +05:30
Sivin VargheseandGitHub 86ca90aa15 feat: Support image resize in message signature (#8042) 2023-10-09 13:20:12 +05:30
Muhsin KelothandGitHub 26e8877cd9 feat: Support link unfurling for all the channels within the same connected channel account. (#8033) 2023-10-08 17:55:03 +05:30
1b63adfb2e feat: add option for reply to in context menu (#8043)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-10-05 20:01:20 +05:30
e27274a5a8 chore: Adds a bus event to insert text at cursor in editor (#7968)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-10-05 14:37:01 +05:30
e5c198f839 refactor: Remove redundant accounts/get (#8056)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-10-05 13:54:04 +05:30
Sojan JoseandGitHub 72ba429159 fix: Show sources in bot response only if documents are present (#8055)
- show sources section in bot only based on appropriate conditions
2023-10-05 00:11:01 -07:00
Pranav Raj SandGitHub 3227cf7ff3 fix: Update query to support multiple tag conditions (#8054) 2023-10-05 10:47:42 +05:30
f0740120a8 chore: Add a fix for mouse up event in modal (#7950)
Co-authored-by: BikashSah999 <51731962+BikashSah999@users.noreply.github.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-10-05 10:44:31 +05:30
3ea54065b1 feat: Upgrade prompt for help center (#8010)
Co-authored-by: Sojan Jose <sojan@pepalo.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-10-05 08:34:21 +05:30
Sojan JoseandGitHub 6f19546c3c feat: Add article messages along with bot responses (#7993)
ref: https://linear.app/chatwoot/issue/CW-2464/bot-should-also-return-links-to-the-information
2023-10-04 15:40:59 -07:00
Mazen KhalilandGitHub 5c9ab21617 fix: Application not loading after setting RACK_ATTACK_LIMIT ENV variable [CW-2587] (#8044) 2023-10-04 15:56:20 +05:30
b71a580573 feat: Adds dark theme support for public portal [CW-2525] (#7979)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-10-04 11:56:00 +05:30
Sojan JoseandGitHub 6a73953003 chore: Add delay before running dataimport job (#8039)
- We have observed some failures for data import jobs in the cloud due to race conditions with job executions and active storage file uploading. This PR adds delays and retries to accommodate that.
2023-10-03 22:18:57 -07:00
Sojan JoseandGitHub 336af1ac9a chore: Create client API conversations with custom attributes (#8040)
- Update client API create conversations endpoint to accept custom attributes as well.
2023-10-03 22:18:35 -07:00
e4de366b8d feat: Add an option to listen to the start conversation click events (#8038)
This PR will add a new event chatwoot:on-start-conversation to the chat widget, which you can listen to and trigger custom interactions on your end.

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-10-03 18:01:40 -07:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
373c3dcd6c chore(deps): bump postcss from 8.4.30 to 8.4.31 (#8034)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-03 10:08:18 -07:00
Shivam MishraandGitHub 4b12dd89b0 fix: videojs-record version (#8029) 2023-10-03 20:57:23 +05:30
c19cfeaa81 feat: Adds message signature for new email conversations (#7946)
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
2023-10-03 13:45:28 +05:30
fa118ad18c fix: Issue on the status filter field (#7949)
Co-authored-by: AqidaHaidari <42426077+AqidaHaidari@users.noreply.github.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-10-03 09:20:46 +05:30
249bfe44bb fix: issue of translation for TimeAgo.vue (#7951)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: iamsivin <iamsivin@gmail.com>
2023-10-03 08:41:30 +05:30
Sojan JoseandGitHub 826d9ec5a7 chore: Refactor Response Bot Data Schema (#8011)
This PR refactors the schema we introduced in #7518 based on the feedback from production tests. Here is the change log

- Decouple Inbox association to a new table inbox_response_sources -> this lets us share the same response source between multiple inboxes
- Add a status field to responses. This ensures that, by default, responses are created in pending status. You can do quality assurance before making them active. In future, this status can be leveraged by the bot to auto-generate response questions from conversations which require a handoff
- Add response_source association to responses and remove hard dependency from response_documents. This lets users write free-form question answers based on conversations, which doesn't necessarily need a response source.
2023-10-01 19:31:38 -07:00
d8b53f5d2f chore: [Snyk] Security upgrade audited from 5.3.3 to 5.4.0 (#8023)
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2023-09-30 19:49:03 -07:00
Jordan BroughandGitHub 08ced452e1 chore: Log errors handled by RequestExceptionHandler (#8013)
- Logging this info is invaluable when using logs to track down the reason why a particular request failed.
2023-09-30 19:46:58 -07:00
24fe3805d8 feat: Slack link unfurling (#7940)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-09-29 19:35:56 +05:30
Sivin VargheseandGitHub 845b0c0a68 fix: Editor file upload browser showing bug (#8019) 2023-09-29 17:53:54 +05:30
Chatwoot BotandGitHub 8ce7539c5e chore: Update translations (#8016) 2023-09-29 15:46:29 +05:30
Shivam MishraandGitHub 5ee980465f fix: Token type hr not supported by Markdown parser (#8003) 2023-09-29 12:05:32 +05:30
Pranav Raj SandGitHub fd633e1613 feat: Add inbox webhook events (#8006)
- Add webhook events for inbox creation/updation.
- Right now, the feature is added under a feature_flag. It is not available by default on all installations.
2023-09-28 15:28:10 -07:00
Pranav Raj SandGitHub 12a64f1b10 chore: Add an API to find the contacts using contact inbox sourceId (#8012)
Fixes: https://linear.app/chatwoot/issue/CW-2578/search-by-facebook-id
2023-09-28 15:26:28 -07:00
Pranav Raj SandGitHub ffc2d98fb8 fix: Use installation locale if configured (#8002) 2023-09-27 19:06:36 +05:30
f7f04f788e feat: Add an option to view the generated articles by Robin AI (#7995)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-09-27 18:16:36 +05:30
a88d155dd7 feat: update tool-chain to latest (#7975)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-09-27 14:02:34 +05:30
Chatwoot BotandGitHub e8b7e791a5 chore: Update translations (#7969) 2023-09-27 12:47:03 +05:30
b18cac77fb chore: Moved file upload methods to mixin (#7987)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-09-27 11:05:19 +05:30
Sojan JoseandGitHub 647161121e chore: pass to agent if there is error parsing json (#7990)
- GPT bot should pass the conversation to the agent if AI returns invalid json or any other error
2023-09-26 21:05:21 -07:00
Muhsin KelothandGitHub cbbe939662 fix: Set avatar for users(agent/contact) in slack channels (#7960) 2023-09-26 09:38:14 +05:30
Sojan 30cb141e5e Merge branch 'master' into develop 2023-09-22 19:55:11 -07:00
Sojan b0d5c438ac Merge branch 'release/3.1.1' into develop 2023-09-22 19:54:48 -07:00
Sojan 3eefa4daee Merge branch 'release/3.1.1'
Publish Chatwoot CE docker images / build (push) Waiting to run
2023-09-22 19:54:43 -07:00
Sojan ddce999385 Bump version to 3.1.1 2023-09-22 19:54:20 -07:00
ff915dd2ea fix: Avoid joining tables to fix the distinct value query (#7965)
DISTINCT query with custom attributes return an error. To avoid the error, this PR refactors the query to include tags only when it is required.

Fixes #7931
Fixes #7836

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-09-22 19:48:56 -07:00
dd0930d75e chore: Improve search in super admin panel (#7952)
Co-authored-by: Vishnu Narayanan <vishnu@chatwoot.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-09-22 19:41:13 +05:30
Shivam MishraandGitHub 3f0d96c24d chore: Add better error messages for Facebook unauthorized (#7936) 2023-09-22 16:41:04 +05:30
Pranav Raj SandGitHub c16b801562 chore: Update the filter for articles in the widget (#7961) 2023-09-21 19:40:46 +05:30
018c468303 chore: Refactors widget to use i18n locale for articles (#7958)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-09-21 18:24:03 +05:30
48bf8d08e5 feat: Update dependencies and fix import syntax for Vite migration (#7959)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-09-21 17:55:54 +05:30
Nithin David ThomasandGitHub fabb3c8da4 fix: Help Center articles are not available on the widget [CW-2534] (#7954) 2023-09-21 17:06:15 +05:30
bdeb2f9812 feat: Searching contacts by company name (#7867)
Implement the functionality of being able to search the contacts page by company name.
Fixes: #7818

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-09-21 00:53:12 -07:00
53dc38e650 fix: Renders youtube and vimeo links within blank lines as embeds (#7422)
Within the article we are now rendering every link for youtube and vimeo as embeds. This isn't a good solution, as users might need to have plain links as well. This fix will render only links within two blank lines as embeds.

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-09-21 00:16:03 -07:00
27fc24375d fix: Handling markdown before replacing or appending signature [CW-2532] (#7944)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-09-21 11:28:29 +05:30
f999777a2d chore: Update message signature description (#7943)
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-09-20 21:09:25 -07:00
Pranav Raj SandGitHub 71d1e98765 chore: Remove spinkit from dependencies (#7948) 2023-09-20 18:18:55 +05:30
Sivin VargheseandGitHub 2c93d563c1 fix: Update colors to fix dark mode in the editor add-link modal header (#7947) 2023-09-20 17:29:27 +05:30
Pranav Raj SandGitHub f1b556d4a3 fix: Downcase content filter values to fix the query (#7942) 2023-09-20 13:14:00 +05:30
Chatwoot BotandGitHub 73c119cd3d chore: Update translations (#7937) 2023-09-19 21:19:46 -07:00
Smit BosamiyaandGitHub 0ad2f94151 fix: Error when attempting to Delete User-Associated Accounts via Super Admin Console (#7810)
This pull request addresses the issue where an error is encountered while attempting to delete user-associated accounts through the Super Admin Console. The problem arises from an error that occurs when the "destroy" action is triggered on an associated account.

Fixes: #7809
2023-09-19 21:16:11 -07:00
f8cb806548 fix: remove trailing spaces before pushing signature (#7935)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-09-19 13:29:44 +05:30
9ba5adfd60 chore: Support multiple values for automation message content (#7871)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-09-19 13:04:58 +05:30
Muhsin KelothandGitHub 0dd5104acb chore: Move slack message concern to the helper (#7912) 2023-09-19 11:09:23 +05:30
Sojan JoseandGitHub 0968aead6c chore: Migration status in super admin (#7938) 2023-09-19 10:31:41 +05:30
Shivam MishraandGitHub 53d530b815 feat: Add upload under account scope (#7914) 2023-09-19 09:51:54 +05:30
2429daa45c feat: cwctl upgrade node for existing installations (#7772)
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-09-18 23:49:29 +05:30
Sojan 86894b27b5 Merge branch 'release/3.1.0' into develop 2023-09-15 16:46:47 -07:00
Sojan 05df4d4212 Merge branch 'release/3.1.0'
Publish Chatwoot CE docker images / build (push) Waiting to run
2023-09-15 16:46:37 -07:00
Sojan 47fd0ea2b2 Bump version to 3.1.0 2023-09-15 16:45:59 -07:00
Sojan JoseandGitHub 30b8a365dc chore: Improve the feature management styles in super admin (#7920) 2023-09-15 15:55:15 -07:00
29110ffd6b feat: Allow signature in the editor directly (#7881)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-09-15 18:46:40 +05:30
Sojan JoseandGitHub e9950afb1a refactor: Optimise article query in chat widget (#7919)
- optimise article query in chatwidget
2023-09-14 17:19:42 -07:00
Pranav Raj SandGitHub f21298aeb9 chore: Increase the click area for the article list item (#7918) 2023-09-14 20:44:08 +05:30
Vishnu NarayananandGitHub 7b6a56714f fix: double rendor error on message create api for suspended accounts (#7917) 2023-09-14 20:06:48 +05:30
94a20af9db fix: Render articles in widget if it is available (#7654)
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: iamsivin <iamsivin@gmail.com>
Co-authored-by: Sojan <sojan@pepalo.com>
2023-09-14 19:56:17 +05:30
Sojan JoseandGitHub 616371adbb chore: Improve the behavior of lock to single conversation (#7899) 2023-09-14 12:32:57 +05:30
Muhsin KelothandGitHub 2d4ef0c328 feat: Add None option in automation assign agent actions (#7900) 2023-09-14 09:01:58 +05:30
5e6e234afe feat (perf): Remove conversation count in contacts list view (#7915)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-09-14 08:49:37 +05:30
Muhsin KelothandGitHub 18e9e771b5 fix: Check body exists before deleting null bytes in Twilio (#7910) 2023-09-13 13:40:26 +05:30
0245e01763 fix: Enable serbian translation (#7905)
Enable language: Serbian.

Co-authored-by: BikashSah999 <51731962+BikashSah999@users.noreply.github.com>
2023-09-13 00:36:34 -07:00
fcd40e9636 chore: Update translations (#7887)
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-09-12 18:09:47 -07:00
Jordan BroughandGitHub 4f5c5e9f85 fix: Erase null bytes from incoming Twilio messages (#7901)
We've had some messages come in from a few different phone numbers that had null bytes in them. I don't know how this happens. They don't seem to be malicious.

They currently cause the Postgres gem to raise an error when Chatwoot attempts to save the message body to the database:

ArgumentError (string contains null byte)

Related Rails GitHub issue: rails/rails#26891
2023-09-12 18:07:18 -07:00
cb07ac16d1 chore: [Snyk] Fix for 1 vulnerabilities (#7906)
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2023-09-12 18:03:58 -07:00
Muhsin KelothandGitHub 4fa299ff15 chore: Disable archived channels from the slack integration (#7904) 2023-09-12 22:21:50 +05:30
Pranav Raj SandGitHub 71e9566854 Revert "feat: Ability to send attachment in new conversation (#7698)" (#7903) 2023-09-12 20:57:49 +05:30
272f920811 chore: [Snyk] Security upgrade rails from 7.0.7.2 to 7.0.8 (#7888)
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2023-09-11 19:12:38 -07:00
e39d19b1e8 feat: Adds image support for message signature (#7827)
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
2023-09-11 10:23:45 +05:30
Nithin David ThomasandGitHub 6c39aed882 fix: Refactor components in widget to show articles (#7874) 2023-09-11 09:31:50 +05:30
Nithin David ThomasandGitHub 8d43101892 chore: Improvements to dark mode usage in widget (#7873) 2023-09-11 09:31:11 +05:30
Pranav Raj SandGitHub f05535c5ad Revert "chore: Improve the behaviour of lock to single conversation (… (#7886) 2023-09-09 09:59:21 +05:30
Pranav Raj SandGitHub 4503ba018d chore: Increase the limit of greeting message (#7883) 2023-09-08 15:33:09 +05:30
8bc2bc6d40 feat: Ability to send attachment in new conversation (#7698)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-09-08 12:12:24 +05:30
Sojan JoseandGitHub bfd192ebb2 chore: Improve the behaviour of lock to single conversation (#7863) 2023-09-08 11:16:24 +05:30
Sojan JoseandGitHub 6e13d22ff7 chore: Updated prompt for Article Bot (#7872) 2023-09-08 11:11:07 +05:30
Muhsin KelothandGitHub 3e8b6e1aee fix: Disable AI assist if the AI integration not enabled (#7876) 2023-09-07 19:17:10 +05:30
Sivin VargheseandGitHub 3038aaef67 fix: Editor menu option is not showing (#7879) 2023-09-07 17:15:19 +05:30
Muhsin KelothandGitHub 57a68666cb fix: Integration page responsiveness issues (#7875) 2023-09-07 14:16:44 +05:30
4acb824857 chore: [Snyk] Fix for 1 vulnerabilities (#7870)
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2023-09-06 18:36:32 -07:00
5c74674c2b feat: Update rack attack IP limit (#7866)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-09-06 18:56:42 +05:30
Nithin David ThomasandGitHub 52e49d5f9d feat: Creates component to show article in an iFrame (#7857) 2023-09-06 18:55:39 +05:30
Shivam MishraandGitHub e529e1206e fix: Update inline image processing logic to fix missing images when multiple inline images present (#7861) 2023-09-06 14:35:19 +05:30
Nithin David ThomasandGitHub a8009c7b39 fix: Allow Iframes requests on portal controller (#7858) 2023-09-06 14:25:03 +05:30
99bb074656 chore: Security upgrade web-console from 4.2.0 to 4.2.1 (#7864)
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2023-09-06 11:31:05 +05:30
Nithin David ThomasandGitHub 9322112481 chore: Improvements to utils to load article in widget (#7859) 2023-09-05 21:37:51 +05:30
Muhsin KelothandGitHub ce4cfee8bd fix: Attachment sent from slack doesn't reach to chatwoot (#7852) 2023-09-05 17:23:58 +05:30
Sivin VargheseandGitHub f31fc2b375 fix: Avoid XSS in custom attributes (#7800) 2023-09-05 09:49:54 +05:30
e5f7807833 fix: Redirect after contact delete [CW-2397] (#7740)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-09-04 18:48:30 +05:30
Onur YAŞARandGitHub 2483d99d3c fix: Update Portal Turkish Translations (#7833) 2023-09-04 18:37:34 +05:30
Shivam MishraandGitHub 336584c95a feat: mutex for InstagramEventsJob [CW-2447] (#7828) 2023-09-04 15:02:13 +05:30
Shivam MishraandGitHub 9ebabb9832 feat: common attachment endpoint follow-up changes (#7826) 2023-09-01 15:18:48 +07:00
Shivam MishraandGitHub 2acf09b3eb refactor: use conversation_id instead of sender_id (#7831) 2023-08-31 16:10:37 +07:00
Pranav Raj SandGitHub d18d3e9e2e fix: Re-arrange plugins to fix canned-responses/mentions not working (#7830) 2023-08-31 15:42:40 +07:00
deec1d213b feat: add a common upload endpoint (#7806)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-08-31 10:36:02 +07:00
Shivam MishraandGitHub 25c3fb3c36 feat: Track the usage of query operator (#7821) 2023-08-30 08:28:05 +05:30
e2a6dc3e04 chore: Upgrade Node.js to v20 (#7759)
Co-authored-by: Vishnu Narayanan <vishnu@chatwoot.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-08-28 19:20:35 +05:30
57feedbf25 fix: Fixes extra backslash while breaking paragraphs [CW-1505] (#7457)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-08-28 15:46:10 +05:30
Pranav Raj SandGitHub 71310c21ad chore: Update translations (#7807) 2023-08-28 09:02:22 +05:30
623cd72897 fix: Update the order of display of the CSAT ratings (#7805)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-08-27 07:39:06 +05:30
04aa13e8aa feat: Disable options from the message signature editor (#7777)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-08-26 08:51:39 +05:30
Sojan JoseandGitHub 6ab964b161 chore: fix flaky spec (#7686)
- fix flaky reporting specs
- fix flaky export spec
2023-08-25 00:11:41 -07:00
Shivam MishraandGitHub 5598b4b27e feat: implement mutex for SlackSendJob (#7783) 2023-08-25 11:58:29 +07:00
Sojan JoseandGitHub 64ae9f625a chore: Persist emojis in Contact Import (#7803)
The previous fix would remove emojis in contact data. This change ensures they are persisited

ref: #7787
2023-08-24 14:04:52 -07:00
Pranav Raj SandGitHub 3dd3b7b3aa fix: Rescue InvalidAuth and mark integration as inactive (#7797) 2023-08-24 17:02:24 +05:30
Pranav Raj SandGitHub f451e59aec chore: Update translations (#7796) 2023-08-24 17:02:11 +05:30
paulocrandGitHub c04f67e8a5 fix: Update translation in Spanish (#7770) 2023-08-24 16:24:48 +05:30
Pranav Raj SandGitHub 6ddc99d066 fix: Update the in_reply_to to logic to use processed_mail (#7793) 2023-08-24 16:19:17 +05:30
Sojan JoseandGitHub 4cbb3208e8 chore: Revert gem update (#7792)
- updating redis client caused deployment issues in Heroku, hence reverting to prev version until its resolved
2023-08-24 01:08:34 -07:00
Pranav Raj SandGitHub 5f2a720920 chore: Update translations (#7766) 2023-08-24 13:26:39 +05:30
Sojan JoseandGitHub acb7debd3f chore: Contact import improvements (#7787)
- Ensure existing contact information is updated on data import
- Refactor the existing job to make it more readable
- Fixes issues with import files in the wrong encoding
fixes: #7307
2023-08-23 23:24:47 -07:00
Shivam MishraandGitHub 44f6a9ec3c feat: update lock timeout and retry configuration (#7785) 2023-08-24 12:59:47 +07:00
Shivam MishraandGitHub 24468d71fb feat: update rails (#7786)
Bump up rails
2023-08-23 13:45:55 -07:00
Shivam MishraandGitHub 26ef21a243 feat: locking and retry in FB message parsing (#7701) 2023-08-23 09:48:17 +07:00
Sivin VargheseandGitHub 18235d3fb5 fix: Draft, Articles, Archived are counted wrong in help-center (#7761) 2023-08-21 12:42:10 +05:30
Sivin VargheseandGitHub 55972cc17a fix: Dashboard overflow issue if there is banner (#7748) 2023-08-21 12:22:50 +05:30
2daf1ae827 feat: Event to capture the message signature feature (#7760)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-08-21 13:30:21 +07:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Shivam Mishra
22421b5ac8 chore(deps): bump puma from 6.2.2 to 6.3.1 (#7765)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
2023-08-21 13:09:20 +07:00
Muhsin KelothandGitHub 0d41853b0b fix: OpenAI CE specs (#7710) 2023-08-21 12:54:35 +07:00
LiamandGitHub 355926897a fix: Fixes error while updating widget builder title (#7756) 2023-08-19 10:57:44 +05:30
Pranav Raj SandGitHub 4101a7b566 chore: Update translations from Crowdin (#7750) 2023-08-18 12:48:50 -07:00
2d31535620 fix: Improve the contrast for the code snippet on the Widget Builder page. (#7758)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-08-18 12:44:30 -07:00
LiamandGitHub c54b469dcb fix: Update the style of the 'Go To' input in the conversations table (#7753) 2023-08-17 13:50:11 -07:00
Pranav Raj SandGitHub 29e8e41443 fix: Delete agent bots without deleting the messages (#7754) 2023-08-17 13:48:49 -07:00
178bc80b25 fix: Update email alerts for Slack integration (#7739)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-08-17 11:46:37 -07:00
Sivin VargheseandGitHub ab039e14fd chore: Improve article list pagination logic (#7737) 2023-08-17 09:32:29 -07:00
LiamandGitHub 961c911c26 fix: Fix the issue where tag agent option is appearing above the profile menu (#7743) 2023-08-17 09:23:26 -07:00
Muhsin KelothandGitHub 12ae49089b feat: Add analytics events for notification feature (#7749) 2023-08-17 09:18:31 -07:00
Jordan BroughandGitHub 996f842882 feat: Allow Twilio::REST::TwilioError errors to raise and prevent Inbox creation (#7379)
This update will mean that errors will roll back the current transaction and the error will be sent back to the frontend and the user will know that the Inbox did not finish setting up successfully.
2023-08-16 15:00:02 -07:00
Sivin VargheseandGitHub 616f702871 fix: Agent name not visible in team page in Dark mode (#7730)
Fixes: https://linear.app/chatwoot/issue/CW-2399/agent-name-not-visible-in-team-page
2023-08-16 14:39:14 -07:00
Pranav Raj SandGitHub 8015490aba chore: Update translations (#7731) 2023-08-16 11:18:14 -07:00
Sojan fe8a67b76a Merge branch 'release/3.0.0'
Publish Chatwoot CE docker images / build (push) Waiting to run
2023-08-15 22:41:04 -07:00
Muhsin KelothandGitHub b89c917198 feat: Add CTAs for AI features (#7538) 2023-08-16 08:39:41 +05:30
7b8a3fcae0 feat: auditlog for team and inbox member updates (#7516)
- adds an audit log when an agent is added or removed from a team
- adds an audit log when an agent is added or removed from an inbox

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-08-15 19:55:19 -07:00
Sojan JoseandGitHub 2df83276e0 chore: Ability to disable rack attack on widget endpoints (#7729) 2023-08-15 17:44:25 -07:00
7b68a7639f fix: Set the default value to false for the checkbox custom attribute (#7561)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-08-15 16:32:06 -07:00
e3b8c1fbb5 fix: Include waiting on agent conversations to unattended view (#7667)
Updating the `unattended` tab to include conversations where the customer responded and is awaiting an agent's response.

Previously it showed only the conversations where the first response was pending.

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-08-15 15:09:10 -07:00
Pranav Raj SandGitHub 310c127693 chore: Update translations (#7728) 2023-08-15 13:47:38 -07:00
Pranav Raj SandGitHub 37c0f1306c fix: Fix breaking storybook build (#7723) 2023-08-14 20:19:02 -07:00
396ef02b0c feat: Improve the initial screen placeholder (#7708)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-08-14 17:50:34 -07:00
Pranav Raj SandGitHub ebefb2e201 fix: Consider the emails where in-reply-to header has multiple values (#7715)
- Return the first message id for now to avoid the errors and subsequently missing the message.
- Use .last instead of .first to avoid expensive query.
- Fix array response in response bot.

Fixes:  https://linear.app/chatwoot/issue/CW-2358/activerecordstatementinvalid-pgdatatypemismatch-error-argument-of-and
2023-08-11 17:53:57 -07:00
Pranav Raj SandGitHub 6f09f20991 feat: Update bot typing indicator based on the conversation status (#7714)
- Show the indicator if the last message is incoming and the conversation is in pending status.
- Remove list of articles displayed in the bot response.
2023-08-11 16:41:01 -07:00
cfe86d9c06 fix: Create new slack thread if the thread identifier changes (#7702)
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
2023-08-11 14:19:49 +05:30
Shivam MishraandGitHub 84240e197a fix: Summary prompt test (#7709) 2023-08-11 13:42:27 +05:30
Pranav Raj SandGitHub bafff90f18 chore: Add account_id scope for conversation.messages (#7707) 2023-08-10 23:02:53 -07:00
Pranav Raj SandGitHub 961d810645 Revert "feat: Show popular articles on widget home" (#7706) 2023-08-10 22:27:51 -07:00
Pranav Raj SandGitHub 1a06bfd69c fix: Force account_id in message filters (#7705) 2023-08-10 21:58:25 -07:00
Pranav Raj SandGitHub 1cac2e86c3 fix: Limit count query to return only 10 values (#7704) 2023-08-10 19:30:02 -07:00
Pranav Raj SandGitHub 04287a0924 fix: Rename channel_list to channels to avoid "no implicit conversion of nil" exception (#7700) 2023-08-09 16:11:51 -07:00
c1c3a62412 fix: Improve reply prompt (#7588)
Co-authored-by: Sojan Jose <sojan@chatwoot.com>
2023-08-09 10:25:37 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
b5dec067a1 chore(deps): bump commonmarker from 0.23.9 to 0.23.10 (#7695)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-08 14:25:42 -07:00
Sivin VargheseandGitHub f96f166196 fix: Default timezone is not working (#7692) 2023-08-08 21:30:29 +05:30
Sivin VargheseandGitHub 9ed701065e fix: Dark mode color fixes (#7693) 2023-08-08 21:07:15 +05:30
Vishnu NarayananandGitHub 180befbd42 feat: add gh action to check logging percentage (#7688) 2023-08-08 15:51:46 +05:30
Pranav Raj SandGitHub 4baa4363f4 fix: Update unread_count being 0 if agent has not seen the conversation (#7690) 2023-08-07 18:50:31 -07:00
Pranav Raj SandGitHub 1c8f41f387 fix: Rename logo-dark -> logo_dark to match the installation config (#7689)
Fix: #7676
2023-08-07 14:30:16 -07:00
7f0ca8b15d fix: Security upgrade rack-mini-profiler from 3.1.0 to 3.1.1 [Snyk] (#7657)
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2023-08-07 14:09:28 -07:00
Sojan JoseandGitHub 4c75bb68f4 chore: Fix OpenAI sentry errors (#7687)
- add check for nil condition
- add logs for openAI
2023-08-07 14:08:26 -07:00
Vishnu NarayananandGitHub ed82eb2932 refactor: remove beta label from automation, bots and macros (#7683)
Fixes: https://linear.app/chatwoot/issue/CW-2334/remove-beta-label-from-everything
2023-08-07 11:15:24 -07:00
Sivin VargheseandGitHub b62166a18a fix: Cannot read properties of undefined (#7682) 2023-08-07 20:49:13 +05:30
bf2b75b281 feat: Add message timestamp to the conversation transcript emails (#7648)
Co-authored-by: Cristian Duta <Cristian.Duta@ti8m.ch>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-08-04 17:21:14 -07:00
c084ad5a68 [Snyk] Security upgrade lograge from 0.12.0 to 0.13.0 (#7635)
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2023-08-04 16:56:11 -07:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Sojan Jose
dd3e658f19 chore(deps): bump semver from 7.3.5 to 7.5.2 (#7383)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-08-04 16:53:30 -07:00
453d7ad9fc fix: Update options interactive messages formatting in web widget (#7437)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-08-04 16:52:32 -07:00
Pranav Raj SandGitHub 47b6967dad fix: Update account data seeder to avoid invalid information (#7673)
- The message sender was incorrect. Incoming messages were created under the contact's name, and outgoing messages were created under the user's name instead of the reverse.
- The seed user's email address was incorrect in the message data.
- The Sendmail configuration overrode the Letter Opener config which made it difficult to test the email.
- This PR also fixes an ESLint lint issue on develop.
2023-08-04 16:32:54 -07:00
Sojan JoseandGitHub d06cf27800 chore: Specs for pageCrawler Service (#7632) 2023-08-04 15:44:51 -07:00
Sivin VargheseandGitHub 7f6a3b781f fix: Links are not readable in private notes dark mode (#7671) 2023-08-05 00:10:10 +05:30
fde2b180fe feat: Update design for campaign (#7668)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-08-04 11:39:59 -07:00
Sivin VargheseandGitHub 2a1662c781 fix: Edit custom views folder (#7670) 2023-08-04 13:54:21 +05:30
10d6e9551d feat: Add the option to toggle the dark/light color-scheme (#7662)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-08-03 12:21:45 -07:00
Sivin VargheseandGitHub 69d46f278a feat: Dark mode improvements (#7658) 2023-08-03 12:05:22 -07:00
Muhsin KelothandGitHub 0921a7c817 fix: Enable cmd bar actions for all conversation routes (#7664) 2023-08-03 11:40:03 -07:00
Muhsin KelothandGitHub 2a73f124ca feat: Add analytics event for command bar usage (#7659) 2023-08-02 13:45:26 +05:30
Sojan JoseandGitHub ef33c60652 chore: Bump up node version (#7653)
Bump node version to 16.20.1.
 
ref: #6629
2023-08-01 12:48:02 -07:00
Pranav Raj SandGitHub 3a547de909 fix: Update the default status of the hooks to enabled (#7652)
In the recent Slack integration update, we made changes to how hooks are handled. Now, hooks require an additional check to be enabled. By default, new hooks are created in a disabled state, which might lead to issues with the hooks not being executed as expected.

This migration updates the status attribute of hooks to have 'enabled' as the default value, ensuring that new hooks are enabled by default and can function properly.
2023-08-01 12:14:47 -07:00
Shivam MishraandGitHub 62e9fc1bc5 feat: update color palette [CW-2293] (#7617) 2023-08-01 21:34:10 +05:30
Nithin David ThomasandGitHub e052a061f4 feat: Show popular articles on widget home (#7604) 2023-08-01 21:32:44 +05:30
LiamandGitHub 9efadf8804 fix: Update permitted_attributes to support the latest version of administrate (#7644)
This fixes an issue where permitted_attributes throws an error of ArgumentError (wrong number of arguments (given 1, expected 0)):

This is because we now bring in the latest version of administrate and administrate changes the way permitted_attributes works; it now passes an action parameter to permitted_attributes. This means we need to update permitted_attributes to accept that new parameter.

Fixes: #7592
2023-07-31 11:53:44 -07:00
Muhsin KelothandGitHub c8a40932cc chore: Add June event for AI reply suggest dismissal (#7601) 2023-07-31 13:20:47 +05:30
Pranav Raj SandGitHub 9ddd428935 feat: Update the slack integration-flow to allow users to select the channel (#7637) 2023-07-28 14:50:30 -07:00
Sojan JoseandGitHub 4d8ba0148c fix: Use Display name for campaigns (#7631)
fixes: #4299
2023-07-27 17:58:19 +03:00
65c4ad70e1 refactor: improve logging for channel callback controllers (#7555)
Co-authored-by: Tejaswini Chile <tejaswini@chatwoot.com>
2023-07-27 17:10:39 +05:30
9636478c2a chore: Improve logging for ip look up and audit logs [CW-2145] (#7512)
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-07-27 16:48:30 +05:30
Nic HippenmeyerandGitHub 65190422c4 fix: Rename unread_since scope (#7267)
- This renames the unread_since scope to created_since, which more accurately describes what the scope returns.
- The EXTRACT(EPOCH FROM created_at) > (?) clause was also simplified and rewritten as created_at > ?, which is equivalent:
2023-07-27 12:29:21 +03:00
Jordan BroughandGitHub a7bc855486 refactor: Remove deprecated "belongs_to" relationships in Message (#7434)
- Remove the deprecated columns in message model
2023-07-27 11:41:34 +03:00
Shivam MishraandGitHub ff97536095 feat(perf): contact page loading speed (#7629) 2023-07-27 13:32:22 +05:30
Sivin VargheseandGitHub fcf0ba12d0 feat: Dark Mode (PR -12) (#7590) 2023-07-27 12:28:06 +05:30
Shivam MishraandGitHub 2cc82af344 fix: apply event name (#7628) 2023-07-27 12:11:57 +05:30
c00855fce4 fix: Skip sentiment analysis for blank text (#7580)
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-07-27 12:11:48 +05:30
2d07577731 fix: [Snyk] Security upgrade rack-attack from 6.6.1 to 6.7.0 (#7625)
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2023-07-27 09:06:56 +03:00
BernieandGitHub 4c98006837 fix: Fix spelling mistakes in the copy (#7627) 2023-07-26 21:48:28 -07:00
Nithin David ThomasandGitHub 89e09857af feat: Add store and API to support articles in widget (#7616) 2023-07-26 14:08:27 -07:00
Shivam MishraandGitHub 12c338364e fix: sentry issues [CW-2222][CW-2232] (#7591) 2023-07-26 23:37:37 +05:30
Sojan JoseandGitHub 846f520ad2 feat: toggle typing and update last seen endpoints for client apis (#7621)
- Add toggle_typing endpoint for client APIs
- Adds update last seen endpoint for client APIs 

Fixes: #7581
2023-07-26 20:40:48 +03:00
Sojan JoseandGitHub 6cbe1ed911 chore: Disable message hooks for conversations without incoming message (#7620)
When using client APIs to create conversations and auto-assignment is turned on, welcome messages were getting triggered. This PR disable the behaviour and ensure template hooks are triggered only if there are incoming messages present. 

Fixes: https://linear.app/chatwoot/issue/CW-2187
2023-07-26 20:38:49 +03:00
LiamandGitHub 6c1ee4d965 fix: Contacts page sort by created_at [CW-2262] (#7584)
Fixes the contacts page sort by created_at.
fixes: #7577
2023-07-26 18:37:30 +03:00
OMAR.AandGitHub 1d8341504a fix: contacts count on filter (#7446)
- Fixes the wrong count shown during the contact filter when contact has multiple labels associated.
2023-07-26 17:31:04 +03:00
Shivam MishraandGitHub f8ae6cd95c fix: no method error when conversation is nil (#7566) 2023-07-26 17:40:41 +05:30
LiamandGitHub 63dd2c5a93 fix: Avoid profile options menu overlapping with message tabs (#7615) 2023-07-25 21:55:57 -07:00
Shivam MishraandSojan 1c47478104 fix: undefined method update_cache_key for nil:NilClass (#7568) 2023-07-25 13:00:34 +03:00
Shivam MishraandSojan 39f14bebbd fix: undefined method first for nil:NilClass (#7567)
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-07-25 13:00:21 +03:00
LiamandGitHub 4b27fdf4db fix: Increase the out of office message length to 10_000 (#7583) 2023-07-24 20:29:04 -07:00
Pranav Raj SandGitHub a6a0e78bbe feat: Sort articles based on views (#7599) 2023-07-24 20:27:43 -07:00
703e19304d feat: Components to render articles in widget home (#7596)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-07-24 16:45:55 -07:00
Pranav Raj SandGitHub fa7bbdb0b3 feat: Add support for plain design help center layout (#7598) 2023-07-25 05:13:52 +05:30
Nithin David ThomasandGitHub d837065545 chore: Update storybook settings to widget stories (#7595) 2023-07-24 16:28:20 -07:00
2a6f3356c9 chore: Show error message if the AI process APIs fails (#7560)
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
2023-07-24 19:15:34 +05:30
c83105ce4f feat: dismiss label suggestions only for 24 hours (#7579)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-07-24 17:51:09 +05:30
Sojan JoseandGitHub 56d0b220f4 chore: Fix response associations for inbox (#7582)
Publish Chatwoot CE docker images / build (push) Waiting to run
- Fix the bug in inbox associations that crept up in previous PR
2023-07-21 20:47:41 +03:00
Sivin VargheseandGitHub 40ec0d109a feat: Dark Mode (#7471) 2023-07-21 22:10:25 +05:30
Sojan JoseandGitHub 480f34803b feat: Response Bot using GPT and Webpage Sources (#7518)
This commit introduces the ability to associate response sources to an inbox, allowing external webpages to be parsed by Chatwoot. The parsed data is converted into embeddings for use with GPT models when managing customer queries.

The implementation relies on the `pgvector` extension for PostgreSQL. Database migrations related to this feature are handled separately by `Features::ResponseBotService`. A future update will integrate these migrations into the default rails migrations, once compatibility with Postgres extensions across all self-hosted installation options is confirmed.

Additionally, a new GitHub action has been added to the CI pipeline to ensure the execution of specs related to this feature.
2023-07-21 18:11:51 +03:00
Sojan JoseandGitHub 30f3928904 chore: bump up version to 3.0.0 (#7574)
Bump the Chatwoot version to 3.0.0
ref: https://github.com/orgs/chatwoot/discussions/7570
2023-07-21 15:02:05 +03:00
Vishnu NarayananandGitHub d188600559 fix: modify exception tracker to log even if sentry configured (#7563)
Right now, if sentry is configured exception won't be logged. This results in the log management tool missing every error captured with ChatwootExceptionTracker. This change logs the exception, even if Sentry is configured or not.

Fixes https://linear.app/chatwoot/issue/CW-2145/improve-logging-info-debug-trace
2023-07-21 11:58:49 +03:00
Vishnu NarayananandGitHub 4828071fc3 feat: add audit trail for channel updates (#7396) 2023-07-21 12:08:19 +05:30
Shivam MishraandGitHub a3d21024a6 feat: add message condition (#7495) 2023-07-21 10:20:53 +05:30
2b4f4f0b5c [Snyk] Security upgrade administrate from 0.18.0 to 0.19.0 (#7547)
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2023-07-20 12:47:54 -07:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
d66eb8b21f chore(deps): bump word-wrap from 1.2.3 to 1.2.4 (#7543)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-20 12:25:00 -07:00
Pranav Raj SandGitHub 27419eef66 feat: Add report on customer waiting time (#7545) 2023-07-20 12:01:22 -07:00
Pranav Raj SandGitHub d7566c453d chore: Take the count directly rather than grouping the conversations (#7535) 2023-07-19 12:12:30 -07:00
Pranav Raj SandGitHub 25ed66edf5 feat: Update reports UI to make it better (#7544) 2023-07-19 12:12:15 -07:00
f72be94323 chore: [Snyk] Fix for 1 vulnerabilities (#7466)
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2023-07-19 21:41:55 +03:00
Vishnu NarayananandGitHub ea825d49da feat: add auditlogs for account model (#7511) 2023-07-19 23:52:34 +05:30
Sojan JoseandGitHub 1d718b92b7 chore: Fix schema disparities (#7554)
- Fixing the schema disparities that crept up during merges
- Also, fix the issue with migrate command regenerating the schema for contacts.rb model
2023-07-19 19:15:43 +03:00
Tejaswini ChileandGitHub f3f665cabb fix: Sentiment analysis queue update (#7552) 2023-07-19 20:27:20 +05:30
Vishnu NarayananandGitHub 8babf7dec3 feat: add debug gem and more make commands (#7509) 2023-07-18 13:22:02 +05:30
Tejaswini ChileandGitHub 5b480f563d feat: Sentiment model download and upload to vendor (#7526) 2023-07-18 12:17:50 +05:30
Pranav Raj SandGitHub 3a77e672f8 feat: Compute average response time of replies (#7530) 2023-07-17 11:21:31 -07:00
Shivam MishraandGitHub 3e75ac2de5 feat: update the UX around label suggestions (#7532) 2023-07-17 15:10:56 +05:30
91c1061214 feat: Add more AI options (#7502)
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-07-16 12:25:16 -07:00
ec65b43993 feat: Add support for API key authentication in Twilio (#7523)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-07-14 19:20:54 -07:00
Shivam MishraandGitHub 1a81245987 feat: Update label suggestion visibility (#7525) 2023-07-14 19:20:03 -07:00
Pranav Raj SandGitHub 2c3ad73542 fix: Update the case for validation where SSO link is used (#7527) 2023-07-14 08:30:08 -07:00
Shivam MishraandGitHub 59b1d59574 fix: idb is not available in firefox private mode [CW-2217] (#7524) 2023-07-14 13:35:30 +05:30
Pranav Raj SandGitHub 9de2edd300 fix: Cannot read properties of undefined (reading 'filter') (#7522) 2023-07-13 15:56:28 -07:00
Pranav Raj SandGitHub 66751b71dd fix: Fix issue null is not iterable (#7521) 2023-07-13 15:47:33 -07:00
Pranav Raj SandGitHub 7e415fbee3 fix: Disable predictions if model is absent (#7520) 2023-07-13 14:40:16 -07:00
Muhsin KelothandGitHub 50a927bac2 feat: Add reply editor mode to the store (#7515) 2023-07-13 14:56:53 +05:30
Muhsin KelothandGitHub 19ff738211 feat: Add more options for AI reply suggestions (#7493) 2023-07-13 10:26:25 +05:30
Shivam MishraandGitHub 7c080fa9fa feat: label suggestion UI (#7480) 2023-07-13 09:16:09 +05:30
91e2da5e74 fix: Uncategorized article display error - HelpCenter-> Portal -> Uncategorised Article (#7504)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-07-12 16:34:16 -07:00
Pranav Raj SandGitHub 21691f2407 fix: Update breaking specs on sentiment and open AI integration (#7513) 2023-07-12 14:43:11 -07:00
d495411ef5 feat: Minor improvements to login UI (#7494)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-07-12 13:35:02 -07:00
918e1f25c2 feat: Improve summary prompt (#7510)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-07-12 13:09:19 -07:00
Tejaswini ChileandGitHub 10dd0ba647 feat: Sentiment Analysis (#7475) 2023-07-12 15:03:31 +05:30
Pranav Raj SandGitHub 550bea099c fix: Add appearance-none to input field for ring to work (#7507) 2023-07-11 19:07:02 -07:00
Nithin David ThomasandGitHub c7bf93ef8a fix: Adds a space after mention to improve UX (#7506) 2023-07-11 17:37:37 -07:00
Shivam MishraandGitHub ec7434d000 feat: Remove twitter (#7505) 2023-07-11 14:00:11 -07:00
Muhsin KelothandGitHub 941e7e06cf feat: Add draft messages store (#7476) 2023-07-11 18:29:42 +05:30
Pranav Raj SandGitHub 09f46aa912 chore: Update onMessage event to include conversation id (#7497) 2023-07-10 15:04:31 -07:00
Vishnu NarayananandGitHub 332ab5888c feat: Disable fb/instagram if env variables are not configured (#7498) 2023-07-10 12:28:55 -07:00
Shivam MishraandGitHub a940f4c1d2 feat: Allow label suggestions with OpenAI APIs (#7428) 2023-07-10 14:40:54 +05:30
Muhsin KelothandGitHub 5b4f92ccd2 fix: Add the option to revert the AI generated content (#7458) 2023-07-10 11:30:22 +05:30
Pranav Raj SandGitHub ad03be4529 fix: Update the index files to fix missing translations (#7484) 2023-07-07 20:11:34 -07:00
Sivin VargheseandGitHub 571e6bd0ec fix: Update broken design elements in dashboard (#7468) 2023-07-06 11:58:54 -07:00
528da1d2cf feat: Add support for dark mode in more pages
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-07-05 19:26:24 -07:00
Pranav Raj SandGitHub 4e8d17f017 chore: Update specs and warnings in console (#7467) 2023-07-05 18:32:55 -07:00
3054a4cb59 feat: Add support for dark mode in dashboard (#7460)
- Add config for TailwindCSS
- Enable HMR
- Add a config in LocalStorage for Dark Mode

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-07-05 12:13:32 -07:00
Tejaswini ChileandGitHub 71837bedf9 feat: Ability to customise the email sender name [CW-1629] (#7345) 2023-07-04 20:46:01 +05:30
3c4514c9f7 chore: Update translations (#7415)
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-07-04 14:23:56 +05:30
Nithin David ThomasandGitHub 4c7c1cd78a chore: Change order of resolve action dropdown buttons (#7456) 2023-07-03 19:39:32 -07:00
985b3f3bfc chore: Reset the base font-size to 16px instead of 10px (#7455)
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
2023-07-04 03:23:00 +05:30
Clairton Rodrigo HeinzenandGitHub 986abde531 fix: Cannot use 'in' operator to search for 'last_activity_at' (#7447) 2023-07-03 14:12:47 -07:00
b57063a8b8 feat: Support dark mode in login pages (#7420)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-07-01 07:49:52 +05:30
Pranav Raj SandGitHub 022f4f899f Revert "feat: Support Azure single-tenant application using the Graph… (#7436) 2023-06-29 16:50:18 -07:00
Sivin VargheseandGitHub 191b8a64fe chore: Remove URLs from translations (#7414) 2023-06-29 15:09:02 +05:30
ea78020f2f fix: Translation issues (#7416)
Co-authored-by: Hricha Shandily <103104754+Hricha-Shandily@users.noreply.github.com>
2023-06-29 14:41:23 +05:30
Muhsin KelothandGitHub dc1a41b136 fix: Set date hours to 9 in snooze time (#7426) 2023-06-29 14:38:03 +05:30
Shivam MishraandGitHub 28e7a5d228 fix: CC conditions when the last email is from someone else (#7010) 2023-06-28 20:28:44 -07:00
40830046e8 feat: Audit Logs for Account User Changes (#7405)
- Audit log for user invitations: https://linear.app/chatwoot/issue/CW-1768/invited-a-user-to-the-account
- Audit log for change role: https://linear.app/chatwoot/issue/CW-1767/name-or-email-changed-the-role-of-the-user-email-to-agent-or-admin
- Audit log for status change: https://linear.app/chatwoot/issue/CW-1766/availability-status-as-events-for-audit-logs


Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
2023-06-28 22:42:06 +05:30
Tejaswini ChileandGitHub d05c953eef feat: Support Azure single-tenant application using the Graph API (#6728) (#6878) 2023-06-28 08:13:08 +05:30
4a770fdea7 feat: Add Plus Jakarta Font to dashboard (#7421)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-06-27 17:39:37 -07:00
Tejaswini ChileandGitHub 239b1e2bf1 feat: Include email in the searched result (#7397) 2023-06-27 21:05:36 +05:30
f963e00731 fix: capture user and ip details on Inbox delete (#7395)
Fixes: https://linear.app/chatwoot/issue/CW-1772/ip-address-and-user-details-are-missing-in-some-of-the-logs

Co-authored-by: Sojan <sojan@pepalo.com>
2023-06-27 19:49:24 +05:30
TOMMYandGitHub 155a5b9947 fix: Remove free space (#7411) 2023-06-27 19:28:38 +05:30
TOMMYandGitHub 26a75b250d Merge pull request from GHSA-2472-ggjh-43h2 2023-06-27 17:22:54 +05:30
Pranav Raj SandGitHub 20b84ee6a1 chore: Fix darkMode styles in widget (#7408) 2023-06-26 14:43:22 -07:00
Pranav Raj SandGitHub f1f14312fe chore: Upgrade Tailwind CSS to 3.3.2 (#7380) 2023-06-26 11:27:16 -07:00
Tejaswini ChileandGitHub 212d7caab1 fix: log User is authenticated but not connected (#7394) 2023-06-26 16:07:40 +05:30
9cda16d0e8 fix: Remove overflow string in label delete confirm button (#7386)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-06-26 13:26:47 +05:30
Sivin VargheseandGitHub a8acbb7427 fix: Issue with i18n in update banner (#7392) 2023-06-26 11:32:40 +05:30
1176e5eb8a feat: Custom phone input in pre-chat form (#7275)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-06-26 10:26:06 +05:30
996325f35b feat: multiple UX improvements to labels (#7358)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
2023-06-25 18:49:49 +05:30
Pranav Raj SandGitHub 4f8ce7b597 chore: Add support for dark mode logo (#7378) 2023-06-23 12:06:01 -07:00
Sojan JoseandGitHub f8e631a00c chore: Update Crowdin Config (#7375)
- add pull request titles
- skip ci for crowdin commits
2023-06-23 23:02:55 +05:30
54bf33083e chore: Update translations (#7372)
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-06-23 16:01:14 +05:30
533f9f7fe4 fix: Email collect overriding existing contact name (#7355)
Currently, if Enable email collect box is enabled, and the user starting the chat already has an account with the same email, it will override the current account with {name} from the email name@email.com , this fixes it.

Co-authored-by: Sojan <sojan@pepalo.com>
2023-06-22 19:09:12 +05:30
82e5fc413e fix: Label Duplication in Bulk Actions (#7341)
When looping the conversations in bulk action to assign them to new labels, the existing labels in other conversations were also getting duplicated across all conversations. This PR fixes the issue. 

> In the previous implementation, new_labels is appended to the existing labels using the << operator. This operator modifies the original array instead of creating a new one, causing unwanted side effects. More specifically, new_labels is a reference to the original argument array of the method.

Co-authored-by: Sojan <sojan@pepalo.com>
Co-authored-by: Peter Salib <74493166+Peteraymansalib@users.noreply.github.com>
2023-06-22 18:36:58 +05:30
Pranav Raj SandGitHub 93daaea19b feat: Add a sort option for conversations waiting for a reply from an agent (#7364) 2023-06-21 13:20:39 -07:00
e6a49b5800 feat: Shows Youtube and Vimeo links as embeds [cw-1393] (#7330)
This change will render the youbtube, vimeo and .mp4 urls as embedded in the article page in the help centre.

Fixes: https://linear.app/chatwoot/issue/CW-1393/help-center-support-video-upload-in-articles

Co-authored-by: Sojan <sojan@pepalo.com>
2023-06-21 20:28:28 +05:30
Sojan JoseandGitHub 595e6e79f0 chore: Add sla policy association to conversation (#7360)
Adds the sla policy association to the conversation

Fixes: https://linear.app/chatwoot/issue/CW-1615/applying-an-sla-to-the-conversation
2023-06-21 14:48:50 +05:30
Sivin VargheseandGitHub 93d8157a55 feat: Adds Lithuanian language selectable as site language (#7354) 2023-06-20 17:29:05 +05:30
Vishnu NarayananandGitHub 6bea2cbc4a feat: add audit trail for macros (#7352) 2023-06-20 13:04:59 +05:30
Tejaswini ChileandGitHub afb7e67795 fix: empty account variable for custom_attrbute_definition running in background job (#7351) 2023-06-20 12:15:36 +05:30
bc813b71dd feat: refresh the audit page on navigation without manual reload (#7292)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
2023-06-20 09:36:16 +05:30
9ac4a1eb30 refactor: multiple fixes to contact header [CW-2081] (#7331)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-06-19 21:58:33 +05:30
Muhsin KelothandGitHub 9bb455ec2d feat: Ability to choose the custom time for snooze conversation (#7257) 2023-06-19 18:23:35 +05:30
c410fe333a chore: Update translations (#7347)
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-06-19 17:27:43 +05:30
Jordan BroughandGitHub 5e807c5875 chore: Remove unneeded include EnsureCurrentAccountHelper (#7339)
This class inherits from Api::V1::Accounts::BaseController, which already includes EnsureCurrentAccountHelper and also sets up before_action :current_account.
2023-06-19 17:18:07 +05:30
Muhsin KelothandGitHub 9bed57c7d1 feat: Add more snooze options (#7344) 2023-06-19 17:05:16 +05:30
Sojan JoseandGitHub 5c5381c0a9 chore(ci): Ensure PR titles are in semantic format (#7346) 2023-06-19 16:48:45 +05:30
Jordan BroughandGitHub 138630b4ae chore: Update method to access "secret_key_base" (#7337)
This will look at environment variables and Rails Credentials, and Rails Secrets.
See documentation here: https://api.rubyonrails.org/v7.0.5/classes/Rails/Application.html#method-i-secret_key_base
2023-06-19 16:11:19 +05:30
Tejaswini ChileandGitHub 9d0de04f7c fix: set custom filter count in redis (#7164) 2023-06-19 16:10:03 +05:30
Muhsin KelothandGitHub 2c3337b117 feat: Move snooze actions to command bar (#7343) 2023-06-19 13:57:59 +05:30
Shivam MishraandGitHub 237358af24 refactor: use as_json for formatting the string (#7332) 2023-06-19 13:33:48 +05:30
Sivin VargheseandGitHub 35dfff0a5b feat: Attachment view improvements (#7314) 2023-06-19 11:16:28 +05:30
86b2896333 feat: Show alerts when the limit is reached in accounts (#7323)
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
2023-06-15 20:47:11 -07:00
Shivam MishraandGitHub e8a27bea4b feat: Add APIs for limit check in accounts (#7242) 2023-06-15 20:11:40 -07:00
Sojan 0d465362ac Merge branch 'release/2.18.0' into develop 2023-06-15 18:45:01 +05:30
Sojan e204fe1c1f Merge branch 'release/2.18.0'
Publish Chatwoot CE docker images / build (push) Waiting to run
2023-06-15 18:44:51 +05:30
Sojan e383e9259b Bump version to 2.18.0 2023-06-15 18:44:13 +05:30
Muhsin KelothandGitHub 2c34dca347 fix: NS_ERROR_STORAGE_BUSY warnings in firefox (#7319)
Fixes: https://linear.app/chatwoot/issue/CW-2075/ns-error-storage-busy-no-error-message
2023-06-15 17:53:26 +05:30
Pranav Raj SandGitHub 69b9123963 fix: Use available_name only (#7312)
We have display_name and the actual name for an agent. display_name is used in all public facing parts. The https://github.com/chatwoot/chatwoot/pull/7232/files PR missed this and used actual name instead.

This PR fixes it.
2023-06-15 17:52:53 +05:30
Shivam MishraandGitHub cac9fe1880 Revert "feat(perf): update query to reduce N+1 impact [CW-1926] (#7228)" (#7271)
This reverts commit f28533bc47.
2023-06-15 16:23:56 +05:30
Nithin David ThomasandGitHub 06ac7c829b fix: Fixes wrong variable usage in transcript file (#7316) 2023-06-15 16:00:21 +05:30
Shivam MishraandGitHub 9985f1c143 refactor: remove redundant taggable declaration (#7310) 2023-06-15 12:57:56 +05:30
Tejaswini ChileandGitHub 1ee6a8fe90 chore: Add validation for processed content field (#7306)
* logging the messages id for message validation exception

* Update the processed_message_content validation over length

* codeclimate

* specs failing for contacts
2023-06-14 18:28:42 +05:30
Muhsin KelothandGitHub 6eb4fa41ff feat: Add sender details and message create date in the attachment API (#7308) 2023-06-14 17:29:13 +05:30
8b91f0ffac fix: Gemfile.lock to reduce vulnerabilities (#7280)
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-RUBY-RACK-1061917

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-06-14 15:40:24 +05:30
d2aa19579e feat: Adds support for superscript in help center articles (#7279)
- Adds support for superscript when rendering article markdown
- Chatwoot Markdown Render to render markdown everywhere

Co-authored-by: Sojan <sojan@pepalo.com>
2023-06-14 15:39:00 +05:30
Shivam MishraandGitHub 2e79a32db7 fix: calculation for resolution count (#7293)
* fix: calculation for resolution count

* test: resolution count bug fix

- ensure enqueued jobs are run
- fix the dates check, conversations resolved today should show up in today

* feat: ensure conversations are resolved

* test: do not count extra events if the conversation is not resolved currently

* fix: typo
2023-06-14 13:50:10 +05:30
Shivam MishraandGitHub a86e236d19 feat: update cache headers for cache_keys (#7283)
Update the cache headers for cache_keys to max-age=10, private, stale-while-revalidate=300

1. The cache will be fresh for 10 seconds (max-age=10). During this time, the browser will use the cached version without checking with the server.
2. After the initial 10 seconds, the browser can continue to serve the stale cache for up to 5 minutes (stale-while-revalidate=300). During this period, it will also try to revalidate and update the cache in the background.
3. After 310 seconds in total (10 seconds fresh, 300 seconds stale), if the browser has not been able to revalidate the cache, it will attempt to fetch the fresh resource directly from the server for subsequent requests, causing potential latency equivalent to a network request.

This means that the data will be directly revalidated only every 5 mins. Other times, it will stay fresh for 10 seconds and revalidate in the background. In most cases, we won't have to rely on a cache validation check because there is a WebSocket event for revalidation, so we know if something changes.

Right now the stale-while-revalidate is 5 minutes, we can then move it to 15 minutes.

> The stale-while-revalidate header is not supported in Safari, for Safari the cache keys will only stay in memory for 10 seconds before being marked stale
2023-06-14 13:21:51 +05:30
c755978352 feat: update banner design [CW-1491] (#7296)
* refactor: banner styling

* refactor: update button style for reply assign banner

* feat: remove update-banner classes

---------

Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
2023-06-14 12:56:42 +05:30
Tejaswini ChileandGitHub 23ca6d56f9 feat: Contact Exports (#7258) 2023-06-13 09:18:43 +05:30
Shivam MishraandGitHub 429ec7194f feat: add index to reporting events [CW-1960] (#7294)
* fix: annotation

* feat: add better index for reporting_events
2023-06-12 18:23:42 +05:30
Tejaswini ChileandGitHub c99d9f9557 fix: search for nil in-reply-to messages (#7286) 2023-06-12 16:01:56 +05:30
Vishnu NarayananandGitHub 9ff5978d6e feat: Add audit trail events for team (#7285) 2023-06-09 17:30:36 -07:00
Muhsin KelothandGitHub cd28f401ba fix: Custom attribute date is not working in some time zone (#7224) 2023-06-09 16:55:03 -07:00
Tejaswini ChileandGitHub 879a244f93 fix: Automations condition based quoted text (#7272) 2023-06-09 17:00:05 +05:30
Tejaswini ChileandGitHub f64f2138db fix: Update mail check for html_part (#7273) 2023-06-09 16:08:40 +05:30
Sojan JoseandGitHub 48f2e58e59 feat: Ability to update avatars from super admin (#7264)
- Ability to update user avatars from super admin
- Ability to update bot avatars from super admin

fixes: #7060
2023-06-09 15:32:24 +05:30
c715e396f0 feat: added input_select type message support for whatsapp (#6886)
- Added input_select message type support for Whatsapp Cloud API and Whatsapp 360dialog.

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-06-09 15:20:45 +05:30
Pranav Raj SandGitHub c8fac08e0b fix: Cannot read properties of undefined (reading 'some') (#7278)
Fixes https://linear.app/chatwoot/issue/CW-2041/typeerror-cannot-read-properties-of-undefined-reading-some
Fixes https://linear.app/chatwoot/issue/CW-2042/typeerror-cannot-read-properties-of-undefined-reading-filter
2023-06-08 20:12:14 -07:00
7fd220c177 feat: Adds the ability to edit saved segments (#7254)
* feat: Ability to edit saved filters

* chore: Adds edit contact segment

* chore: Minor fixes

* fix: code climate

* chore: Minor fixes

* chore: Adds ability to custom view name

* chore: Minor fixes

* chore: Adds spec for helper

* chore: Revert contact filter to split to new PR

* Delete editSegmentMixin.js

* chore: Revert fixes

* Update app/javascript/dashboard/i18n/locale/en/advancedFilters.json

Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>

* Update app/javascript/dashboard/i18n/locale/en/advancedFilters.json

Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>

* chore: Moved from mixin to helper for reusing in segments

* Delete editFolderMixin.js

* chore: Fix specs and added new specs

* chore: review comment fixes

* chore: Minor fixes

* fix: Not resetting applied filter

* feat: Adds the ability to edit saved segments

* feat: Adds specs for API part

---------

Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
2023-06-08 21:25:51 +05:30
Pranav Raj SandGitHub b3b76d00ff fix: Do not use the default value if the out of office message is empty (#7268) 2023-06-08 08:22:10 -07:00
Shivam MishraandGitHub 2f2ae88cba fix: unattended count mismatch in report and list (#7263) 2023-06-08 17:58:13 +05:30
Tejaswini ChileandGitHub 2b7989f52b fix: reply mailer with sender name (#7232) 2023-06-08 17:07:08 +05:30
d7314079c9 feat: Ability to edit saved folders (#7236)
* feat: Ability to edit saved filters

Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
2023-06-08 14:58:57 +05:30
1017903ee1 fix: Adds domain option to user cookies set by SDK [CW-352] (#7070)
* fix: Adds domain option to user cookies set by SDK

* Adds domain to init event from chatwootSettings variable

* Testing multiple domains on heroku

* Updates with sdk from staging

* Removes sdk init code

* Testing why cookie is not getting set

* Cleans up testing code

* Refactors code to fix codeclimate issues

* Update app/javascript/sdk/cookieHelpers.js

Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>

* Adds test cases for setCookieWithDomain

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
2023-06-08 14:27:49 +05:30
Tejaswini ChileandGitHub d25e7fd54e fix: add email logging for source-id email-id and message-id (#7262)
* fix: mail logger for source-id email-id and message-id

* added mail provided to the tracking

* change the logger verb from info to error

* app/jobs/inboxes/fetch_imap_emails_job.rb

* codeclimate fix

* remove extra filter

* fixes: specs
2023-06-07 18:24:37 +05:30
Sojan JoseandGitHub 7e89e3a34a chore: Ensure template_sync timestamp is updated (#7265)
Fix for the cases where there are multiple channels with invalid provider config, which results in the templates sync scheduler failing to schedule jobs for valid channels.

fixes: https://linear.app/chatwoot/issue/CW-2032/bug-whatsapp-template-sync-failing-in-cloud
2023-06-07 17:18:24 +05:30
Pranav Raj SandGitHub 39eaed7766 fix: Cannot read properties of undefined (reading 'always_play_audio_alert') (#7260) 2023-06-06 15:16:25 -07:00
Pranav Raj SandGitHub b1a4907ede fix: around_action not yielding is params are present (#7259) 2023-06-06 14:55:08 -07:00
a01d81a7e1 feat: Update display text for auditlog entries (#7226)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-06-05 12:51:45 -07:00
Sojan JoseandGitHub 117d5301b4 chore: API documentation updates for CSAT surveys (#7255)
- Expose conversation uuid in APIs
- swagger documentation for cast survey update via public/message/update endpoints
- swagger documentation for survey/responses/conversation_uuid endpoint

Fixes: #6328
2023-06-05 21:14:01 +05:30
Tejaswini ChileandGitHub aae6081d73 fix: check content disposition, for inline messages in mail (#7231) 2023-06-05 20:28:32 +05:30
Sojan JoseandGitHub d03924b846 feat: Enable sending template messages in webhooks (#7252)
fixes: https://github.com/chatwoot/chatwoot/issues/5291
2023-06-05 20:27:28 +05:30
b333d0c986 feat: Attachments view (#7156)
* feat: Attachments view with key shortcuts and dynamically updates when user delete or sent new attachments

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-06-05 19:21:47 +05:30
Shivam MishraandGitHub 9f3d155822 feat: Add size limit action (#7253)
* chore: update browserlist

* feat: add size limit action

* feat: set limits

* feat: add size limit in CI

* chore: remove railsenv

* chore: update limits
2023-06-05 18:56:15 +05:30
TOMMYandGitHub 9203b097d2 chore: Show chatwoot_edition in Instance details (#7200)
- Displays the chatwoot edition in the instance details
2023-06-05 17:32:21 +05:30
Marcel StörandGitHub 12cb97db5f fix: Quote database env variables (#7216)
Database credentials, and passwords, in particular, can easily contain characters that are reserved in YAML and must be quoted. 
Example: a case with a password starting with ']'.
2023-06-05 14:19:35 +05:30
Tejaswini ChileandGitHub 09971fd613 fix: Wrap references string into array (#7243) 2023-06-03 07:33:36 +05:30
Pranav Raj SandGitHub ca9d108741 fix: Update documentation of filter APIs (#7245) 2023-06-02 15:36:41 -07:00
Shivam MishraandGitHub f28533bc47 feat(perf): update query to reduce N+1 impact [CW-1926] (#7228)
* feat: update query to reduce N+1 impact

* feat: remove channel eager loading

fixes the error: ActiveRecord::EagerLoadPolymorphicError Exception: Cannot eagerly load the polymorphic association :channel

* test: fix search test

* chore: revert change
2023-06-02 11:11:55 +05:30
Pranav Raj SandGitHub 68f82c11a5 Revert "fix: Updates editor to fix the extra slash issue [cw-1505][cw-1526] (#7091)" (#7238)
This reverts commit 1d0930ef63.
2023-06-01 13:26:02 -07:00
Tejaswini ChileandGitHub abc27fa791 fix: find mail message by references (#7220) 2023-05-31 19:23:29 +05:30
Sojan JoseandGitHub d93a8d05bc chore: Increase character limit for external url fields (#7230)
- Increase the external url field validation to 2048 characters

fixes: https://github.com/chatwoot/chatwoot/issues/7098
2023-05-31 19:17:24 +05:30
Sojan JoseandGitHub 373f5f5b64 chore: Disable coverage reports for .vue files (#7214)
- Disable coverage reporting for .vue files 

fixes: https://linear.app/chatwoot/issue/CW-1331
2023-05-30 19:18:19 +05:30
Sivin VargheseandGitHub ae7df60a75 fix: Special characters not being decoded (#7218) 2023-05-30 18:54:51 +05:30
412d750b6a feat: auditlogs design refactor cw1764 (#7181)
* chore: refactor auditlogs design

* chore: refactor aduit log text

* chore: fix 60% width for activity column

* chore: improve log text formatting

* Apply suggestions from code review

Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>

* feat: show agent names if available in auditlogs

* chore: add sign_out

* Apply suggestions from code review

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>

* chore: handle custom user actions

---------

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
2023-05-30 14:41:29 +05:30
f1a77ba934 feat: allow superadmins to reset cache keys for IndexedDB (#7180)
Allows super admins to reset the cache for an account. This will force the front end to fetch the data again on the next load.

fixes: https://linear.app/chatwoot/issue/CW-1817

Co-authored-by: Sojan <sojan@pepalo.com>
2023-05-29 23:05:17 +05:30
Sojan JoseandGitHub ffc6364690 chore: Improve Whatsapp Templates Sync (#7210)
- update the templates updated at, even if the API request fails ( to prevent jobs from stacking up in case of API failures upstream )
- sequence the job in batches of 25 requests per minutes schedule ( in case API response time is high, also not to send too many requests in a single batch )
- move the sync job re-rerun to 3 hours ( since we are updating the updated at even in case of failures )(prev 15 minutes )

Fixes: https://linear.app/chatwoot/issue/CW-1590
2023-05-29 22:23:22 +05:30
Sojan JoseandGitHub 3a7633b564 feat: API to create HMAC verified conversations (#7209)
Fixes: #6744
2023-05-29 21:57:24 +05:30
amplitudesandGitHub 91d1d44aa9 fix: profile picture distortion (#7203)
By applying pr-1 on a container div instead of directly on the image (which distorts it), it creates the intended padding effect without any image distortion.
2023-05-29 15:00:14 +05:30
Sojan JoseandGitHub afc97faa8b chore: Rotate pubsub token on password change (#7194)
Fixes: https://linear.app/chatwoot/issue/CW-1350/
2023-05-27 13:24:31 +05:30
1d0930ef63 fix: Updates editor to fix the extra slash issue [cw-1505][cw-1526] (#7091)
* fix: Updates editor to fix the extra slash issue

* Updates yarn package

* Updates yarn package for editor schema

---------

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-05-26 00:54:37 +05:30
Tejaswini ChileandGitHub 776ea6d39a fix: Help center api doc (#7189) 2023-05-25 18:50:00 +05:30
Muhsin KelothandGitHub 2c85098698 fix: Mentions in assigned/participation notification(#7185) 2023-05-25 18:18:56 +05:30
Sivin VargheseandGitHub 6bd0e074dc feat: Sort agents on availability status (#7174) 2023-05-25 14:49:56 +05:30
Vishnu NarayananandGitHub 123fc73394 feat: add audit trail for sign_in and sign_out (#7158)
* feat: add audit_trail for sign_in event

* chore: ignore unrelated User model columns for auditing

* chore: fix prepend call for webhook/automation rule

* chore: add spec for sign_in event

* chore: refactor sign_in auditlog method to enterprise namespace

* feat: add sign_out audit trail

* feat: review comments
2023-05-25 14:27:30 +05:30
88cef88d80 fix: Instagram story with video not rendering (#7184)
* fix: instagram story with video not rendering

* chore: Minor fixes

---------

Co-authored-by: Tejaswini Chile <tejaswini@chatwoot.com>
2023-05-25 12:20:42 +05:30
Tejaswini ChileandGitHub 8e79cf72e1 fix: issue with slack job (#7179) 2023-05-24 20:22:34 +05:30
Sojan JoseandGitHub bfaca851f1 chore: Throttle conversation transcript endpoints (#7155)
- Throttle conversation transcripts to 20 per hour via rack attack

Fixes: https://linear.app/chatwoot/issue/CW-1630/throttle-transcript-endpoint
2023-05-24 19:56:23 +05:30
Muhsin KelothandGitHub 5618b5ebd3 fix: Enable ogg format for audio recording in API channel (#7178) 2023-05-24 15:05:31 +05:30
Muhsin KelothandGitHub 4807052c37 doc: Swagger for conversation priority API (#7172) 2023-05-23 20:39:15 +05:30
Shivam MishraandGitHub 44b1047b90 feat(perf): contacts query performance (#7175)
* feat: use more indexable where condition

* feat: add index concurrently

* chore: update schema

* refactor: update index name
2023-05-23 17:22:47 +05:30
Shivam MishraandGitHub 9c6c19c3e5 fix: CSAT filter metrics rendering & conversation reports not working [CW-1840, CW-1818] (#7170)
* fix: emoji rendering for CSAT

* feat: add tests for CSAT Metrics

* fix: allow rating in metrics

* refactor: hide satisfaction score & total response chart if rating filter is enabled

* refactor: optional chaining in group by

* fix: spacing using autofill

* test: update csat metrics tests

* test: CSAT metric card
2023-05-23 16:47:04 +05:30
Nithin David ThomasandGitHub 2764338453 fix: Fixes wrong copy being sent to users via email invite [cw-1290] (#7159)
* fix: Fixes invite email copy

* fix: Fixes wrong copy being sent to users via email invite
2023-05-23 09:37:40 +05:30
Shivam MishraandGitHub 4f0fcfcbcd feat: allow Microsoft Clarity from CDN (#7163)
* feat: add microsoft clarity to main app

* feat: mask messages

* fix: spacing
2023-05-23 08:00:01 +05:30
Pranav Raj SandGitHub fdbaf98c3b fix: Update breaking specs (#7169) 2023-05-22 17:01:27 -07:00
03bbd048a7 chore: Add action to set dark mode from the react-native-widget (#7167)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-05-22 15:34:09 -07:00
Tejaswini ChileandGitHub d481b9fbcf feat: Limit the number of custom filters per user (#7101) 2023-05-22 18:03:15 +05:30
Vishnu NarayananandGitHub 68dedc37ba chore: update auditlog timestamp format (#7128) 2023-05-22 17:08:50 +05:30
Shivam MishraandGitHub 958c0d7946 feat(perf): improve performance of conversation filter API [CW-1605] (#7120)
* feat(perf): don't use count

* feat(perf): include messages in the conversation query

* feat: include contact inboxes

* refactor: use blank?
2023-05-22 16:03:11 +05:30
Tejaswini ChileandGitHub 9553329092 chore: find instagram_direct_message query (#7157) 2023-05-22 16:01:31 +05:30
Nithin David ThomasandGitHub d01f2063d0 feat: Creates component to show articles search results [CW-1451] (#7126)
* feat: Creates component to show articles search results

* Adds story for the component
2023-05-22 15:15:19 +05:30
Tejaswini ChileandGitHub 590e4e9c1c Fix: prevent IMAPBadResponse exception from sending the authorization mail (#7154) 2023-05-22 13:51:56 +05:30
Tejaswini ChileandGitHub 0e903d2365 chore: Add delay for slack job when message has attachments (#7107) 2023-05-22 13:51:14 +05:30
Shivam MishraandGitHub d6ce1ceeeb fix: CSAT chart showing incorrect data (#7152)
* fix: computation of data for csat chart

* fix: make horizontal chart reactive
2023-05-22 11:01:01 +05:30
Sivin VargheseandGitHub e8f56d0e56 chore: Update greeting message label in settings (#7088) 2023-05-21 21:07:37 -07:00
Pranav Raj SandGitHub b8dae07c0f feat: Add an option to use darkMode only in the widget (#7151) 2023-05-22 09:05:05 +05:30
Sojan JoseandGitHub e3f4be97c0 fix: Reauthorize when channel settings updated (#7134)
Fixes: https://linear.app/chatwoot/issue/CW-1803/bug-inbox-doesnt-update-reauthorisation-required-automattically
2023-05-19 22:04:34 +05:30
Sojan 1f4d096804 Merge branch 'hotfix/2.17.1' into develop 2023-05-19 20:56:16 +05:30
Sojan 08fa370261 Merge branch 'hotfix/2.17.1'
Publish Chatwoot CE docker images / build (push) Waiting to run
2023-05-19 20:56:06 +05:30
Sivin VargheseandGitHub 1bcc438b21 fix: Problem when using Brazilian Portuguese (#7135)
Fixes:  #7127
2023-05-19 20:55:01 +05:30
Vishnu NarayananandGitHub 8b3d13a920 fix: add libvips to Dockerfile for rails7 (#7133)
Fixes: #7124
Fixes: https://linear.app/chatwoot/issue/CW-1805/investigate-217-upgrade-issues-for-dockerk8s-installations
2023-05-19 17:59:33 +05:30
Sojan dcdd58bae5 Bump version to 2.17.1 2023-05-19 16:00:27 +05:30
Sojan JoseandGitHub 7b9a9831c1 chore: Fix rubococop failures (#7130)
- fixes rubocop failures on develop
2023-05-19 15:32:25 +05:30
Sojan JoseandGitHub 7ab7bac6bf chore: Enable the new Rubocop rules (#7122)
fixes: https://linear.app/chatwoot/issue/CW-1574/renable-the-disabled-rubocop-rules
2023-05-19 14:37:10 +05:30
Shivam MishraandGitHub b988a01df3 fix: exclude private and activity messages from public API (#7123)
- Exclude private messages
2023-05-19 14:24:49 +05:30
105f9a27d2 feat: more CSAT filters (#7038)
* refactor: use grid instead of flex

* refactor: let the parent layout decide the spacing

* feat: add a separate date-range component

* refactor: use new date-range component

* fix: destructure all options

* refactor: separate group by component

* refactor: better handle group by data

* fix: defaul group by

* refactor: variable naming

* refactor: use DATE_RANGE_OPTIONS directly

* chore: update platform in gemfile.lock

* refactor: trigger fetch on filter change

* refactor: remove redundant method

* refactor: simplify methods and emitting

* refactor: simplify filter logic

* refactor: simplify fetching

* refactor: imports

* refactor: prop name

* refactor: CSAT response to use new APIs

* refactor: use common filter event

* refactor: use computed value for validGroupBy

* refactor: better function names

* refactor: rename prop

* refactor: remove redundant props

* refactor: separate agents filter component

* feat: add labels filter

* feat: add inboxes filter

* fix: event

* refactor: send label and inbox along with request payload

* feat: add inbox filter

* feat: add inbox to download

* refactor: use request payload from computed property

* refactor: params

* feat: add team to csat filters

* feat: add team to csat filters

* feat: add filter for rating

* feat: reverse options

* feat: add labels for ratings and translations

* feat: update translation

* fix: margin and spacing

* fix: trailing whitespace

* feat: add tests for filters

* chore: move files

* feat: add try catch with alerts

* feat: update import

* fix: imports

* Updates broken imports

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
2023-05-18 22:50:46 +05:30
132cf802d5 fix: Open AI Integration should respond in conversation language (#7092)
Appended "Reply in the user's language." to obtain the answer in the user's language.
Fixes: https://linear.app/chatwoot/issue/CW-1735/chore-use-account-language-for-the-prompts


Co-authored-by: Sojan <sojan@pepalo.com>
2023-05-18 18:50:48 +05:30
Shivam MishraandGitHub f2f33038f2 fix: Make category non-mandatory (#7117)
Creating articles in a new help center without categories throws an error. This PR fixes that.
2023-05-18 18:42:28 +05:30
Vishnu NarayananandGitHub 590ce788b9 fix: update linux script(cwctl) to account for rails7 upgrade (#7106)
* chore: modify cwctl to fetch latest redis version on new installations

* fix: add libvips for activestorage imageprocessing support

* chore: update cwctl version

* feat: upgrade redis and install libvps for existing installations
2023-05-18 16:53:47 +05:30
Clairton Rodrigo HeinzenandGitHub a25179c342 fix: Instagram events job NoMethodError: undefined method for nil:NilClass (#7105)
- Sometimes tag entry does not have messaging or standby and cause a error
2023-05-18 15:22:01 +05:30
Sivin VargheseandGitHub aea9470b6a fix: RTL issue for basic filter dropdown (#7118) 2023-05-18 15:06:18 +05:30
Muhsin KelothandGitHub 6382707146 chore: Check assignee exists or not before rendering the assignee avatar (#7104) 2023-05-17 15:41:23 +05:30
Pranav Raj SandGitHub 49ef4e54ca feat: Add cmd/ctrl click open on the conversation cards (#7100) 2023-05-16 16:57:25 -07:00
Sojan db0d32f01d Merge branch 'release/2.17.0' into develop 2023-05-16 12:34:00 +05:30
Sojan de1fb6ba4e Merge branch 'release/2.17.0'
Publish Chatwoot CE docker images / build (push) Waiting to run
2023-05-16 12:33:47 +05:30
Sojan 7b8bcaba11 Bump version to 2.17.0 2023-05-16 12:33:16 +05:30
Pranav Raj SandGitHub 3f39b7ad1f fix: Avoid styles getting purged on prod build (#7086) 2023-05-15 19:05:07 -07:00
Pranav Raj SandGitHub a3547c5a1f feat: Show Table of Contents in the article sidebar (#7085) 2023-05-15 18:43:16 -07:00
Tejaswini ChileandGitHub 0f776a173c Fix: Mail ate compare with nil date (#7084)
fixes: https://chatwoot-p3.sentry.io/issues/4185144468/?project=6382945
2023-05-15 21:42:22 +05:30
Sojan JoseandGitHub d320605556 chore: Fix Activerecord querry cancelled when fetching email (#7083)
limiting the query to 2 days to ensure that it runs timebound.

fixes: https://linear.app/chatwoot/issue/CW-1747/activerecordquerycanceled-pgquerycanceled-error-canceling-statement
2023-05-15 21:23:17 +05:30
Sojan JoseandGitHub ca85d4e1c6 fix: External url validation in attachment (#7082)
fixes: https://linear.app/chatwoot/issue/CW-1746/activerecordrecordinvalid-validation-failed-external-url-is-too-long
2023-05-15 20:33:58 +05:30
Tejaswini ChileandGitHub b994706265 fix: Email date attribute not being set (#7081)
Fixes: https://linear.app/chatwoot/issue/CW-1738/typeerror-no-implicit-conversion-of-nil-into-string-typeerror
2023-05-15 20:19:03 +05:30
d9f2cd0a6e chore: Enable Hebrew language for widget (#7079)
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-05-15 16:56:04 +05:30
Sojan JoseandGitHub f2a34ad8aa Chore: Remove deprecation warning post rails upgrade (#7080)
Fixes: https://linear.app/chatwoot/issue/CW-1575/fix-deprecations-post-upgrade-to-rails-7
2023-05-15 16:32:27 +05:30
Tejaswini ChileandGitHub 65e91f6a6f fix: Duplicate instagram conversations for echo messages (#7078) 2023-05-15 16:25:15 +05:30
Nithin David ThomasandGitHub 7dd1562b40 fix: Welcome email copy changes and canned response API error handling [cw-1290] (#7054)
Fixes: https://linear.app/chatwoot/issue/CW-1290/minor-ui-issues
2023-05-15 16:17:55 +05:30
Shivam MishraandGitHub c70367bbd7 feat: add migration to fix image signed keys (#7076) 2023-05-15 15:13:26 +05:30
Nithin David ThomasandGitHub 5a8eff35b5 chore: Enable support for hebrew in dashboard [CW-1736] (#7077) 2023-05-15 14:03:29 +05:30
Muhsin KelothandGitHub 1936369b12 feat: Add analytics event for OpenAI (#7074)
* Add analytics event for OpenAI

* Add more variations
2023-05-15 11:57:56 +05:30
Tejaswini ChileandGitHub 354010a6e1 chore: fetch mails with multiple attachments (#7030) 2023-05-14 10:02:36 +05:30
Sojan JoseandGitHub 385eab6b96 chore: Add max length validation to text fields (#7073)
Introduces a default max length validation for all string and text fields to prevent processing large payloads.
2023-05-12 22:12:21 +05:30
198cd9b28d feat: Show next available day/hour and minutes on widget (#6902)
* feat: Show next available hour and minutes on widget

* chore: Adds spec

* chore: Show days

* chore: Code clean up

* chore: Review fixes

* chore: Minor fixes

* chore: Review suggestion fixes

* chore: Minor fixes

* Added timezone to widget payload

* chore: Adds time zone

* chore: Review fixes

* chore: Adds comments

* chore: Rounded up min with nearest multiple of 5

* chore: Review fixes

* chore: Review fixes

* chore: Review fixes

* chore: Review fixes

* chore: Fix specs

* chore: Review fixes

* chore: Fix specs

* chore: Review fixes

* chore: Moved day names to i18n

* chore: Review fixes

* chore: Fix specs

---------

Co-authored-by: Tejaswini Chile <tejaswini@chatwoot.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
2023-05-12 19:25:51 +05:30
Nithin David ThomasandGitHub abdf00d2cf fixes: Editor adding slash char while creating block quotes [cw-1505] (#7069)
* fixes: Editor adding slash char while creating block quotes [cw-1505]

* Update with latest package
2023-05-12 16:39:18 +05:30
Muhsin KelothandGitHub 2c3160cfee feat: API to list all attachments for a conversation (#7059)
Fixes: https://linear.app/chatwoot/issue/CW-1678/api-to-list-all-attachments-for-a-conversation
2023-05-12 15:48:06 +05:30
Muhsin KelothandGitHub 708bddf4db feat: Refetch the latest messages on action cable reconnect in widget (#6996) 2023-05-12 14:05:22 +05:30
Pranav Raj SandGitHub 020dcc4dc7 fix: Avoid audio URLs getting cached at the frontend (#7062) 2023-05-11 12:14:56 -07:00
271263bcc2 feat: SLA CRUD APIs (EE) (#7027)
Fixes: https://linear.app/chatwoot/issue/CW-1613/sla-api

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-05-11 22:42:56 +05:30
Muhsin KelothandGitHub c97d6021e0 chore: Add migration to set the default empty string value for contact name (#7052)
Fixes: https://linear.app/chatwoot/issue/CW-1650/issue-with-the-contact-name
2023-05-11 17:35:19 +05:30
d99997d17d feat: Add ability to filter Conversations by underlying source_id (#6979)
This change adds the ability to include a `source_id` param when querying the `/api/v1/accounts/{account_id}/conversations/search` endpoint. It restricts to results to only conversations related to a contact_inbox with the provided parameter. My motivation for adding this feature was to allow an external API to communicate with a specific conversation with only an awareness of the conversation `source_id` from the client.


Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-05-11 17:32:29 +05:30
Sivin VargheseandGitHub 9c5d062efc fix: Fix greeting message label in settings (#7056) 2023-05-11 17:30:07 +05:30
Muhsin KelothandGitHub 87f758ee1f feat: Order conversations by priority (#7053) 2023-05-11 12:56:43 +05:30
Shivam MishraandGitHub d0a1ad746a feat: add index migration (#7050) 2023-05-10 17:55:14 +05:30
86384bf876 feat: Reply suggestion and summary generation using OpenAI (#7029)
Add `reply_suggestions` and `summary_generation` options for OpenAI integration

Fixes: https://linear.app/chatwoot/issue/CW-1595/frontend-for-generating-conversation-summary

Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-05-10 17:50:37 +05:30
Muhsin KelothandGitHub 55e5fa2205 chore: Add the specs for sort conversation (#7047) 2023-05-10 17:49:17 +05:30
Sojan 65bad90b69 Revert "fix: Welcome email copy changes and canned response API error handling [cw-1290] (#6905)"
This reverts commit 07aaa046c1.
2023-05-10 16:43:18 +05:30
07aaa046c1 fix: Welcome email copy changes and canned response API error handling [cw-1290] (#6905)
* fix: Welcome email copy changes and canned response API error handling

* Review fixes

* Uses mixin for alerts in canned page

* Typo fixes

* Copy changes

* Fixes broken tests

* Fixes review comments

* Fixes typo errors with mail template

* Removes unwanted case

* Fixes repetitive texts

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-05-10 15:55:48 +05:30
giquieuandGitHub 520bdabefe fix: Record audio in wav format for web/facebook (#7046) 2023-05-10 12:29:56 +05:30
Shivam MishraandGitHub 662967b5d3 feat(perf): add index to messages created at (#7044)
* feat: add index to messages created at

* feat: run migration
2023-05-10 11:34:49 +05:30
6137a45214 chore: Update link in the reply summary email (#7024)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-05-09 17:39:09 -07:00
Pranav Raj SandGitHub 5e0ce7793c fix: Re-order gem list to fix rubocop errors (#7043) 2023-05-08 16:15:27 -07:00
Pranav Raj SandGitHub ce3e38df0f chore: Update the design of the help center portal (#6775) 2023-05-08 15:31:38 -07:00
2b88ecdfc4 feat: Add a feature flag for Audit Log UI (#7035)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-05-08 12:44:15 -07:00
Pranav Raj SandGitHub 683f259771 fix: Fix rendering issues in Help Center (#7042) 2023-05-08 12:23:26 -07:00
Vishnu NarayananandGitHub 51fb3b7e8e fix: enable lograge in superadmin path (#7026)
* fix: lograge superadmin path
* chore: add spec for superadmin devise session controller
* chore: address review comment
2023-05-08 13:43:55 +05:30
3dedfee350 chore: Update translations (#7033)
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-05-06 15:10:50 +05:30
Sojan JoseandGitHub 022383d942 chore: Upgrade to Rails 7 (#6719)
fixes: #6736
2023-05-06 10:44:52 +05:30
59433d9d3c feat: Adds the ability to sort conversations (#6853)
* Add sort filter

* Change UI

* Change filter

* Complete sort by filters

* Style fixes

* Fix default sort

* Update app/javascript/dashboard/components/widgets/conversation/ConversationBasicFilter.vue

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>

* Update app/javascript/dashboard/components/widgets/conversation/ConversationBasicFilter.vue

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>

* Update app/javascript/dashboard/components/ChatList.vue

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>

* Added translation

* Added review fixes

* Add more updates

* Code cleanups

* Update last_activity_at on message received event

* Cleans up the design for chatlist and icons

* Fix sort

* Remove inline styles

* Add tag along with the title

---------

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
2023-05-05 17:08:32 -07:00
Sojan JoseandGitHub 85e57c2e94 chore: Reorganize Sidekiq Queues (#6976)
- Rearrange and reprioritize current sidekiq queues
- Trim the unnecessary queues

ref: https://linear.app/chatwoot/issue/CW-1480/chore-run-all-sidekiq-jobs-async
2023-05-04 15:44:16 +05:30
Tejaswini ChileandGitHub b081fe08b8 feat: whatsapp duplicate message (#7004) 2023-05-03 15:18:20 +05:30
Muhsin KelothandGitHub 0d014d5d4b chore: Bump utils from 0.0.15 to 0.0.16 (#7022) 2023-05-03 14:36:55 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
937338e3ea chore(deps): bump audited from 5.2.0 to 5.3.3 (#7016)
Bumps [audited](https://github.com/collectiveidea/audited) from 5.2.0 to 5.3.3.
- [Release notes](https://github.com/collectiveidea/audited/releases)
- [Changelog](https://github.com/collectiveidea/audited/blob/main/CHANGELOG.md)
- [Commits](https://github.com/collectiveidea/audited/compare/v5.2.0...v5.3.3)

---
updated-dependencies:
- dependency-name: audited
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-03 14:13:04 +05:30
Pranav Raj S 6e506b070e Merge branch 'hotfix/2.16.1' into develop 2023-05-02 15:54:49 -07:00
Pranav Raj S 18c5c47836 Merge branch 'hotfix/2.16.1' 2023-05-02 15:53:33 -07:00
Pranav Raj S 257a294166 Bump the version to 2.16.1 2023-05-02 15:52:50 -07:00
Pranav Raj S 12f121f0d8 fix: Provide a default to name if name is not present 2023-05-02 15:52:33 -07:00
Tejaswini ChileandGitHub 847d7ea082 feat: Add support to uncategorized articles (#6912) 2023-05-02 15:35:26 +05:30
c8041392dc feat: Enable features on successful subscription (#6953)
* feat: Enable features on successful subscription

* fix: Add specs

* disable features for default plan

* Remove mark as cloud customers

---------

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-05-01 14:58:39 -07:00
be3c75e858 chore: Update translations (#6999)
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-04-28 20:28:03 +05:30
Sojan JoseandGitHub 02c467b6db chore: GPT Reply suggestion & summarize endpoints (#7011)
Adds additional endpoints for OpenAI integration which will allow
- Reply Suggestions
- Summarization

ref: #6436
fixes: https://linear.app/chatwoot/issue/CW-1596/backend-for-generating-conversation-summary
2023-04-28 19:57:25 +05:30
Muhsin KelothandGitHub 13fe439d9f Move the reconnect logic from the update presence (#6992) 2023-04-28 14:02:30 +05:30
Shivam MishraandGitHub 2313edd244 feat: update identity validation docs link (#6994)
* feat: update identity validation docs link

* fix: copy

* fix: grammar
2023-04-28 13:36:58 +05:30
Muhsin KelothandGitHub 09c9300c21 chore: Use canned response variable helpers from utils (#7007) 2023-04-27 17:01:34 +05:30
c0e905b5d8 fix: Search improvements and bug fixes [CW-1604] (#6985)
* fix: Search improvements and bug fixes

* Resets tab to all on search

* Fix index bug with tabs

---------

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-04-27 13:20:29 +05:30
Pranav Raj SandGitHub 04da8aa8dc fix: Remove duplicates message in WhatsApp Channel (#7003) 2023-04-26 19:57:06 -07:00
Shivam MishraandGitHub 32f7342cd6 chore: Add issue forms for GitHub (#6982) 2023-04-26 11:25:02 -07:00
74afb785c2 fix: Update spacing for the priority icon in the inbox views (#6993)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-04-26 10:21:30 -07:00
Shivam MishraandGitHub cae1e30160 feat: Update demo data to include better messages (#6995) 2023-04-26 10:20:56 -07:00
Tejaswini ChileandGitHub 99dfe1d5af feat: Enable template variables in channel greeting messages (#6971) 2023-04-26 20:23:46 +05:30
Sojan JoseandGitHub 3fa654f5c6 chore: Add Index for widget contact lookup (#6998)
- Adds an index to improve the contact lookup performance while calling setUser from widget
2023-04-26 19:22:16 +05:30
shaheer-haiderandGitHub 37fde64c67 fix: installation of gem bundles (lograge, rack-mini-profiler, stackprof, nokogiri) in docker (#6897) 2023-04-26 17:04:17 +05:30
Tejaswini ChileandGitHub 3c2d6faf68 feat: Instagram story replies will display the original story link (#6846) 2023-04-26 15:27:07 +05:30
Muhsin KelothandGitHub 5d30dabf97 feat: Command bar action for priority (#6989)
* Add command action for priority assignment

* Fix icon path

* Update conversationHotKeys.js
2023-04-26 13:29:01 +05:30
cef1f97d18 feat: update product copy [CWM-45] (#6372)
* chore: Update non-logged-in-page copy

* Update app/javascript/dashboard/i18n/locale/en/login.json

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>

* Update app/javascript/dashboard/i18n/locale/en/signup.json

* Update app/javascript/dashboard/i18n/locale/en/signup.json

---------

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-04-25 22:02:15 -07:00
Pranav Raj SandGitHub 92705723f1 fix: Add /api/v1 to the team_members API documentation (#6987) 2023-04-25 20:17:15 -07:00
Shivam MishraandGitHub af971c9b18 fix: whatsapp template params validation (#6986) 2023-04-26 08:46:30 +05:30
2f2cdd7e7c feat: Hides dismissed campaigns while browsing [cw-33] (#6842)
* Chore: moves localstorage helper as a shared utility and refactors constants

* Refactors constants file

* feat: Hides dismissed campaigns while browsing

* Snoozes all campaigns for an hour after dismissing

* Fixes error with date parsing

* Snooze ongoing campaigns

* Review fixes

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-04-25 22:38:36 +05:30
Shivam MishraandGitHub d95283f5c2 feat: improvements to priority (#6981)
* fix: colors for urgent icon

* feat: trigger updated event on priority change

* fix: specs
2023-04-25 22:28:19 +05:30
402428fb4d feat: Splits search api by resources to improve query time [cw-47] (#6942)
* feat: Splits search api by resources to improve query time

* Review fixes

* Spacing fixes

* Update app/javascript/dashboard/modules/search/components/SearchView.vue

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>

* Review fixes

* Refactor searchview

---------

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-04-25 17:59:38 +05:30
Shivam MishraandGitHub 5600b518ac fix: validate template_params for WhatsApp (#6881)
- Add JsonSchemaValidator, which takes a declarative schema and validates it for a given property.
- Add specs for JsonSchemaValidator
- Enable the validator for template_params
2023-04-25 16:50:36 +05:30
0bbb28c432 feat: sort conversation on priority (#6943)
* feat: update seed script to include prioritt

* feat: add sort_handler for conversations

* test: sort on priority order

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-04-25 09:47:47 +05:30
Sojan JoseandGitHub cf91e9eb58 chore: Use find_each instead of .all.each (#6975)
- Enable the rubocop Rails/FindEach
- Replace the .all.each with .find_each

This should let us avoid potential memory usage.
Motivation from the speedshop newsletter by Nate Berkopec

ref: https://www.rubyinrails.com/2017/11/16/use-find-each-instead-of-all-each-in-rails/
ref: https://linear.app/chatwoot/issue/CW-1480/chore-run-all-sidekiq-jobs-async
2023-04-25 09:32:35 +05:30
b529baa5eb fix: Pagination bug in chat list (#6899)
* fix: Pagination bug in chat list

* chore: Review fixes

* Improves variable namings

---------

Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
2023-04-25 09:01:54 +05:30
Pranav Raj SandGitHub c071f66cdd fix: Update the icon for low priority (#6978) 2023-04-24 13:52:14 -07:00
92fa9c4fdc feat: Ability to improve drafts in the editor using GPT integration (#6957)
ref: https://github.com/chatwoot/chatwoot/issues/6436
fixes: https://linear.app/chatwoot/issue/CW-1552/ability-to-rephrase-text-in-the-editor-using-gpt-integration

---------

Co-authored-by: Sojan <sojan@pepalo.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
2023-04-24 23:52:23 +05:30
f6e0453bb2 fix vertical overflow scroll on BackButton (#6914)
* fix: vertical overflow scroll on BackButton

Co-authored-by: raph941 <45232708+raph941@users.noreply.github.com>

* chore: adds suggested improvement to handle RTS view

Co-authored-by: raph941 <45232708+raph941@users.noreply.github.com>

---------

Co-authored-by: raph941 <45232708+raph941@users.noreply.github.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-04-24 22:57:58 +05:30
Pranav Raj SandGitHub 1a07828b1b fix: Disable the entire element if priority is missing (#6972) 2023-04-24 10:21:39 -07:00
Shivam MishraandGitHub 54880b2342 feat: Track conversation priority events (#6968) 2023-04-24 20:21:43 +05:30
Muhsin KelothandGitHub e32f3e71e4 feat: Right click context menu action to change the priority (#6947)
* Right click context menu action to change the priority

* Review comments

* Update Index.vue

* Remove selected priority  from menu

* Code cleanup

* Update conversation.json
2023-04-24 20:07:50 +05:30
Shivam MishraandGitHub 0874aeee2d feat: priority UI (#6966) 2023-04-24 19:00:08 +05:30
Muhsin KelothandGitHub f1fc658a0d feat: Add an action in Macro to change the priority (#6940) 2023-04-24 17:14:30 +05:30
Tejaswini ChileandGitHub e3193dcabc feat: Link help center portal to an Inbox (#6903) 2023-04-24 12:49:52 +05:30
Vishnu NarayananandGitHub f825a22997 feat: add Makefile (#6948)
* feat: add  Makefile
* chore: refactor
2023-04-24 11:32:17 +05:30
Muhsin KelothandGitHub 815322b27a feat: Refetch the active conversation messages on action cable reconnect (#6790) 2023-04-24 10:17:12 +05:30
Pranav Raj SandGitHub 474e65f4c8 feat: Save in_reply_to from WhatsApp messages (#6964) 2023-04-23 18:28:14 -07:00
3a35281b3f chore: Update translations (#6941)
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-04-21 15:28:56 +05:30
Muhsin KelothandGitHub ac6de50b4d feat: Add a condition for filters based on the priority of automation (#6939) 2023-04-20 18:10:05 +05:30
a34729c153 feat: add activity message for priority change (#6933)
* feat: add priority const

* feat: add toggle priority method

* feat: update controller route and specs

* refactor: status change method

* refactor: abstract label change and mute activity

* feat: add priority change_activity

* fix: interpolation for previous_changes

* refactor: reduce cognitive complexity of priority_change_activity

* refactor: move priority activity message handler to a separate module

* refactor: move typing logic to a service

* refactor: tests to reduce complexity

* fix: typo

* fix: constants

* fix: priority conditions

* fix: add a response

* fix: argument destructuring in I18n.t

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-04-20 16:41:53 +05:30
6b2736aa63 fix: inconsistency in report and summary for metric counts (#6817)
* feat: include timezone offset in summary calculation

* fix: exlcude end in date range

* test: explicit end of day

* fix: test for report builder

* fix: reports.spec.js

---------

Co-authored-by: Tejaswini Chile <tejaswini@chatwoot.com>
2023-04-20 12:55:04 +05:30
Muhsin KelothandGitHub d1584eea72 feat: Add an action on automation to change the priority (#6925) 2023-04-20 11:31:33 +05:30
Sivin VargheseandGitHub 527042afd1 fix: Code fix from PR #6823 (#6934) 2023-04-19 23:09:37 +05:30
Nithin David ThomasandGitHub bd1e69e4b4 feat: Adds new inbox selector with more info for new message modal [cw-1358] (#6823) 2023-04-19 23:02:50 +05:30
Vishnu NarayananandGitHub 76d4c22c2d fix: build_id in heroku installations (#6932) 2023-04-19 21:39:10 +05:30
Tejaswini ChileandGitHub 5cdc7d654a feat: Support multiple emails in email transcript automation (#6924) 2023-04-19 16:55:25 +05:30
Tejaswini ChileandGitHub 821d49943a Delete inbox api doc update (#6930) 2023-04-19 16:43:51 +05:30
Shivam MishraandGitHub 9c0259da6b feat: add priority field to conversation (#6921) (#6927)
* feat: add priority

* feat: add indexes
2023-04-19 13:23:14 +05:30
Pranav Raj SandGitHub ea2c442328 chore: Add account_id as custom_attribute for cloud users (#6926) 2023-04-18 22:35:11 -07:00
Volodymyr MakukhandGitHub b93b8cdab6 Fix flaky reporting_event_listener_spec (#6923) 2023-04-19 10:42:45 +05:30
Pranav Raj SandGitHub e6505fc7a4 chore: Cache the dashboard app on the first load (#6774) 2023-04-18 19:44:57 -07:00
Pranav Raj SandGitHub c5c36af529 fix: Remove fallback phone_number search in WhatsApp event processing (#6904) 2023-04-18 18:30:01 -07:00
026e03c307 fix: Handle spaces in CC/BCC email lists (#6788)
When the CC field is generated in the UI, the email values are joined together
with ", " but when they are parsed, we currently split by just ",".

This causes an error on the backend and on the frontend.

It seems reasonable to update the code to allow whitespace in the input and to
split by `\s*,\s` and also to trim leading and trailing whitespace from the CC
list.

---------

Co-authored-by: Sojan <sojan@pepalo.com>
2023-04-18 19:18:23 +05:30
Sojan 37b7098673 Merge branch 'release/2.16.0' into develop 2023-04-18 01:04:27 +05:30
Sojan 7bd400772d Merge branch 'release/2.16.0'
Publish Chatwoot CE docker images / build (push) Waiting to run
2023-04-18 01:04:19 +05:30
Sojan cb2f86b983 Bump version to 2.16.0 2023-04-18 01:02:19 +05:30
905e77048f chore: Contact import improvements (CW-1362) (#6747)
Fixes: https://linear.app/chatwoot/issue/CW-1362/csv-imports-are-not-working-properly
Fixes: #3462

---------

Co-authored-by: Sojan <sojan@pepalo.com>
2023-04-18 00:40:55 +05:30
Vishnu NarayananandGitHub 4505c5dda3 chore: add build id to settings page (#6873)
- Adds a build Id to the settings page
2023-04-18 00:35:35 +05:30
Sivin VargheseGitHubMuhsin Keloth <muhsinkeramam@gmail.com>, Nithin David
c9ce9e5b8f feat: Improved country code in contact form view. (#6801)
* feat: Improved country code in contact.

* chore: Minor fixes

* chore: Minor fixes

* chore: Adds arrow key navigation and cursor pointer

* chore: Minor fix

* chore: Code clean up

* chore: Handle outside click

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>, Nithin David
2023-04-17 20:32:09 +05:30
9e2f991484 feat: audit logs UI (#6803)
* feat: init auditlogs ui

* chore: add api

* fix: action

* chore: add action,username,time

* feat: add pagination support

* chore: format time

* chore: refactor

* chore: refactor auditlogs api response

* chore: update icon

* chore: rubocop fixes

* Fixes the way meta is handled in store

* Fixes meta not appearing issue

---------

Co-authored-by: Sojan Jose <sojan@pepalo.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
2023-04-17 19:11:05 +05:30
Sivin VargheseandGitHub 80dcd17f6e fix: Border color for CSAT component in widget (#6915) 2023-04-17 17:50:30 +05:30
Shivam MishraandGitHub a38ecf3dde feat: show webhook verify token for WhatsApp (#6916)
- Display WhatsApp webhook verify token in configuration settings
2023-04-17 17:14:08 +05:30
9090eabb8a chore: Update translations (#6895)
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-04-17 14:45:49 +05:30
ca2506a941 feat: allow sorting of articles (#6833)
* feat: sort by position

* chore: whitespace change

* feat: add border bottom color to list item

* feat: allow dragging articles

* feat: add migration to reorder all articles

* feat: add onsort method

* feat: finish UI sorting

* feat: show 50 per page in articles list

* feat: add article sorting methods

* feat: patch up reorder action with the API

* refactor: better naming

* chore: add comments

* feat: attach position to article before create

* feat: move article to end if moved between categories

* chore: add comments

* chore: update version

* fix: don't change position if previous category was nil

* fix: condition to trigger update on category change

* refactor: store new_position

* refactor: use grid instead of table

* feat: add snug spacing

* feat: add grab-icon

* feat: add grab icon to list

* refactor: show draggable only for category page

* feat: add update_positions as a class method

---------

Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
2023-04-17 14:43:10 +05:30
Shivam MishraandGitHub 1886d4ce08 fix: response body in twitter callback (#6907)
* fix: response body

* fix: tests
2023-04-14 16:48:28 +05:30
Shivam MishraandGitHub 4d49b81f1c fix: use response.status instead of success (#6906)
* fix: use response.status instead of success

* refactor: use sentry to capture exception

* refactor: explicitly convert to i
2023-04-14 15:22:08 +05:30
Tejaswini ChileandGitHub 2b736f4698 fix: Update from_email in the name to fix the syntax error (#6900) 2023-04-13 10:42:38 -07:00
Tejaswini ChileandGitHub 9ca21df9fd feat: Route emails based on x-original-to in email channel (#6901)
Fixes: #6608
ref: https://linear.app/chatwoot/issue/CW-30/emails-not-routed-based-on-x-original-to
2023-04-13 14:52:12 +05:30
Tejaswini ChileandGitHub 44837aa657 Fix: save twitter profile for inbox (#6667)
Fixes: #737
2023-04-12 14:16:24 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Sojan Jose
d04344c094 chore(deps): bump commonmarker from 0.23.7 to 0.23.9 (#6892)
Bumps [commonmarker](https://github.com/gjtorikian/commonmarker) from 0.23.7 to 0.23.9.
- [Release notes](https://github.com/gjtorikian/commonmarker/releases)
- [Changelog](https://github.com/gjtorikian/commonmarker/blob/main/CHANGELOG.md)
- [Commits](https://github.com/gjtorikian/commonmarker/compare/v0.23.7...v0.23.9)

---
updated-dependencies:
- dependency-name: commonmarker
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-04-12 14:08:14 +05:30
d45512df72 feat: Account deletion with deleteObjectJob (#6885)
Fixes: https://linear.app/chatwoot/issue/CW-1365/allow-super-admin-to-delete-an-account

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-04-12 13:54:01 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2731c2a5be chore(deps): bump nokogiri from 1.14.2 to 1.14.3 (#6893)
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.14.2 to 1.14.3.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.14.2...v1.14.3)

---
updated-dependencies:
- dependency-name: nokogiri
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-12 13:29:57 +05:30
Tejaswini ChileandGitHub 610463c980 fix: flatten template array for whatsapp templates (#6880)
- Refactor the WhatsApp template sync job
- Fix the issue when fetching the next set of templates
2023-04-11 17:48:17 +05:30
09ce85b30d Chore: moves localstorage helper as a shared utility (#6838)
* Chore: moves localstorage helper as a shared utility and refactors constants

* Refactors constants file

* Fixes merge conflicts

* Delete constants.js

---------

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-04-11 15:50:46 +05:30
Shivam MishraandGitHub 17ff1f11a7 feat: better download for conversation traffic heatmap (#6755)
* feat: genearte report in a grid

* refactor: update API usage

* refactor: separate generate method

* refactor: abstract transform_data

* feat: annotate with comments

* feat: add explicit timezone

* feat: download data only in user timezone

* fix: dates included in heatmap
2023-04-11 09:40:54 +05:30
Pranav Raj SandGitHub f4e121cc44 fix: Update the profile API URL in the documentation (#6875) 2023-04-10 18:23:20 -07:00
Pranav Raj SandGitHub cf934450ab chore: Remove context menu on links (#6874) 2023-04-10 14:13:08 -07:00
Vishnu NarayananandGitHub ad75a79135 feat: add pagination support for audit logs API (#6843)
Add pagination support for audit logs API
2023-04-10 21:07:01 +05:30
Tejaswini ChileandGitHub d49989ace1 chore: Specs for Whatsapp template pagination (#6870)
Spec for https://github.com/chatwoot/chatwoot/pull/6835
2023-04-10 20:44:43 +05:30
Tejaswini ChileandGitHub e69e0bc984 Add status reopen activity message for api channel (#6839) 2023-04-10 19:12:20 +05:30
e877b01e00 fix: Invalidate cache if any of the related objects change (#6860)
* fix: Invalidate cache if any of the related objects change

* Add specs:

* Update context

---------

Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
2023-04-10 15:47:13 +05:30
da11feb39b feat: one-click codepen for widget configuration (#6865)
* feat: allow codepen in code

* feat: enable codepen in config

* feat: update codepen title

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-04-10 15:44:06 +05:30
Tejaswini ChileandGitHub 138afd9af6 Feat: Fetch whatsapp templates till next cursor (#6835) 2023-04-10 14:44:27 +05:30
e753365493 feat: Add the ability to change the agent availability status (#6855)
* Add the option change agent availability

* Remove callout

* Move `AVAILABILITY_STATUS_KEYS` to constants

* Update app/javascript/dashboard/i18n/locale/en/agentMgmt.json

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>

---------

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-04-10 13:37:12 +05:30
Pranav Raj SandGitHub 91dc7733b0 feat: Use inbox image as avatar for the bot (#6859) 2023-04-07 13:25:18 -07:00
Pranav Raj SandGitHub 463c09184c fix: Disable processing events if account is suspended (#6849) 2023-04-07 12:01:03 -07:00
040e9a732f chore: Update translations (#6854)
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-04-07 16:05:33 +05:30
71c5a1e1d4 feat: add lograge to improve logging (#5423)
- Add lograge gem to improve rails logging using `LOGRAGE_ENABLED` env variable
- When enabled Single line log for requests in JSON formatting
- Switch sidekiq also to use JSON formatting

Fixes: chatwoot/product#437
---------

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-04-07 13:44:30 +05:30
Muhsin KelothandGitHub a521762dd6 feat: Support after param in messages end point (#6848)
Adds support to `after` param while fetching messages
Fixes: https://linear.app/chatwoot/issue/CW-1475/support-after-param-in-messages-end-point
2023-04-07 13:42:54 +05:30
406e8405eb fix: Specs failing for teams/actions.js (#6845)
* fix: specs failing

* fix: specs for labels and inboxes

* Update reports.js

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-04-06 20:48:49 +05:30
37dd898c9a Search bar improvements (#6827)
* chore: implement search improvement

Co-authored-by: BikashSah999 <51731962+BikashSah999@users.noreply.github.com>

* Update app/javascript/dashboard/routes/dashboard/conversation/search/PopOverSearch.vue

Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>

* Update app/javascript/dashboard/routes/dashboard/conversation/search/PopOverSearch.vue

---------

Co-authored-by: BikashSah999 <51731962+BikashSah999@users.noreply.github.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
2023-04-06 18:56:56 +05:30
Sivin VargheseandGitHub be2356724e fix: Time specs (#6841) 2023-04-06 16:33:31 +05:30
Sivin VargheseandGitHub ab6276327a feat: Show year in message timestamp if the message is not from the current year (#6830)
* feat: Shows year in message timestamp if the message is not from the current year

* chore: Naming fix
2023-04-06 15:09:38 +05:30
Sivin VargheseandGitHub ee131011f9 fix: Canned Responses are not sent in the new message editor (#6829) 2023-04-05 12:42:39 +05:30
balawaandGitHub 2ca8726005 feat: Extend the message limit for the Facebook Channels (#6816) 2023-04-04 12:07:13 -07:00
Shivam MishraandGitHub b39e5bb642 feat: Remove isAdmin check on merge contact button (#6825) 2023-04-04 09:58:10 -07:00
Pranav Raj SandGitHub ebd5fbef17 chore: Use feature_flags attribute instead of settings_flags (#6820)
* chore: Use feature_flag instead of settings_flag

* Remove unnecessary changes
2023-04-04 09:56:58 -07:00
Shivam MishraandGitHub b7d0016d99 fix: inconsistent usage of snake_case and camelCase (#6824) 2023-04-04 16:22:45 +05:30
Muhsin KelothandGitHub a0eafc94d7 fix: Pre-chat message is not showing in campaign (#6821)
* Fix pre-chat form header issue

* Show pre-message if pre-chat form enabled
2023-04-04 13:37:51 +05:30
Sivin VargheseandGitHub 110e28d08e chore: Disable import option in agent account (#6822) 2023-04-04 13:37:13 +05:30
a040aee96b feat: allow adding custom attributes to conversations from the SDK (#6782)
* feat: add conversation attributes method to sdk and widget app

* feat: add endpoints to update custom attributes

* refactor: update SDK api

* feat: add api and actions for conversation updates

* fix: error message

* test: custom attributes on conversations controller

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-04-04 08:57:55 +05:30
Tejaswini ChileandGitHub 6a0ca35de4 Feat: detect language of the message content (#6660) 2023-04-04 08:57:27 +05:30
Sivin VargheseandGitHub 268eababa3 feat: Adds an option to edit City/Country (#6792)
* feat: Adds an option to edit City/Country

* chore: Minor fix
2023-04-03 19:51:27 +05:30
Tejaswini ChileandGitHub d2d6d271c3 CW-1399 Phone number import (#6815) 2023-04-03 13:53:59 +05:30
Muhsin KelothandGitHub 363ffdbde3 fix: Disable form if pre-chat disabled on new conversation (#6813) 2023-04-03 12:03:58 +05:30
Tejaswini ChileandGitHub 44f73e044a slack with template message link (#6811) 2023-04-03 11:32:37 +05:30
Pranav Raj SandGitHub ebc144683a chore: Update conversation thread rendering in Slack (#6812) 2023-04-02 22:26:08 -07:00
44e4eee28b chore: Update translations (#6806)
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-04-02 13:24:13 +05:30
Shivam MishraandGitHub 2e9eead20c feat: update contacts filter query (#6802)
- Update contacts API query to be faster
2023-04-02 13:23:01 +05:30
Tejaswini ChileandGitHub d1ac33e98c feat: Phone number based automation conditions (#6783) 2023-04-02 10:54:51 +05:30
Tejaswini ChileandGitHub 21da03fe5b Fix: Consider bot message on slack integration (#6793) 2023-03-31 18:56:51 +05:30
bd5ff7a8bf fix: Agent avatar instead of bot avatar in pending message (#6777)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-03-31 18:49:31 +05:30
Sivin VargheseandGitHub fd41529b82 chore: Adds the ability to copy phone number from user details (#6791) 2023-03-30 11:03:51 -07:00
Tejaswini ChileandGitHub 7bd830ebfe fix: Email based automation conditions filter (#6786) 2023-03-30 22:34:18 +05:30
Sojan JoseandGitHub 7930902ec8 chore: Refactor Automation Specs (#6796)
The current way of writing specs for automation in one single file automation_listener isn't effective. Hence we are breaking down the specs for each class into separate spec files.

fixes: CW-1447
2023-03-30 21:02:52 +05:30
Tejaswini ChileandGitHub d8604107aa fix: Add link to conversation in slack message (#6768) 2023-03-30 13:03:19 +05:30
cef44bc557 fix: Check valid params exists in WhatsAapp payload (#6780)
Fixes #6779

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-03-30 12:10:59 +05:30
Sojan JoseandGitHub 7e3a4d2c20 fix: Adds assignee as a participant during auto-assign (#6789)
- Ensures that the assignee is added as a participant during auto-assign
2023-03-30 11:39:53 +05:30
Sojan JoseandGitHub a4c9a2b2f2 chore: Support telegram edited_message events (#6785)
- Add support for telegram edited_message events: Update the user message back in the Chatwoot dashboard when updated by the contact on telegram
2023-03-29 18:48:16 +05:30
d1b65b6c9e chore: Fixes avatar position on failed messages (#6784)
* feat: show external error in message

* Fixes avatar position on failed messages

---------

Co-authored-by: Clairton Rodrigo Heinzen <clairton.rodrigo@gmail.com>
2023-03-29 18:09:18 +05:30
Clairton Rodrigo HeinzenandGitHub 4ed35cf461 feat: show external error in message as tooltip (#6701) 2023-03-29 17:30:57 +05:30
Jordan BroughandGitHub 803015b7f8 chore: Re-add "public" prefix to "public.gen_random_uuid()" in schema.rb (#6770)
Revert unintended schema change from https://github.com/chatwoot/chatwoot/pull/5338#discussion_r957645071
2023-03-29 16:02:13 +05:30
Jordan BroughandGitHub aa75666ad9 chore: Remove extra audit column (#6769)
- Drop unintentional "audits.integer" column
2023-03-29 12:24:14 +05:30
Pavel KuzminandGitHub 2b7ff48bcd fix: Turn off FOCUS_CUSTOM_ATTRIBUTE event to avoid memory leak (#6772) 2023-03-28 18:29:15 -07:00
6002394fcf feat: Support input_select messages on telegram (#5887)
- Adding interactive button support for telegram for outgoing and incoming messages. 


Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-03-28 22:50:07 +05:30
Shivam MishraandGitHub bc8e8f3bb5 feat: add index to conversation id and account_id (#6757)
- This PR adds an index to conversations id and account_id. This improves the performance of some reports query
2023-03-28 22:34:04 +05:30
54a809ea54 fix: Case insensitive email match (#6760)
Fixes: https://linear.app/chatwoot/issue/CW-1354/email-id-case-sensitive

Co-authored-by: Sojan <sojan@pepalo.com>
2023-03-28 15:23:41 +05:30
Tejaswini ChileandGitHub fdb067a352 fix: mentions are not rendered properly in slack (#6762) 2023-03-28 13:40:16 +05:30
Nithin David ThomasandGitHub d082aa50a8 fix: Adds support for multiple file uploads in whatsapp inbox (#6763) 2023-03-28 13:10:16 +05:30
Muhsin KelothandGitHub 3535a1a708 chore: Auto capitalize the last name field while sending the canned response/variables (#6767)
* Capitalize last name

* Add more spec

* Fix last name spec issue

* More spec fixes

* Add more spec fixes

* Update user_drop_spec.rb
2023-03-28 13:03:51 +05:30
Shivam MishraandGitHub 4c10845acd fix: [CW-44] don't count private message as first reply (#6707)
* fix: don't count private message as first reply

* fix: update first_human_response_logic

* refactor: separate valid_first_reply method

* test: valid first reply

* feat: add check for automation rule

* test: update step that creates data

* fix: add boundary condition in case first_reply_created_at is not present

* test: fix report builder

* refactor: conditions

* test: remove second message condition
2023-03-27 21:23:37 +05:30
Muhsin KelothandGitHub 5b7bed9640 chore: Auto capitalize the name field while sending the canned response/variables (#6758)
* capitalize name before sending the message

* Fix specs

* Code cleanups
2023-03-27 18:49:48 +05:30
b3850cb4fa fix: Show meaning full error message while creating and email inbox [CW-1312] (#6711)
* chore: Shows error message while creating and email inbox

* chore: Review fixes

---------

Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
2023-03-27 16:15:11 +05:30
7de89b6f9b chore: Update translations (#6751)
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-03-27 14:45:50 +05:30
Shivam MishraandGitHub 00ee0478eb feat: IndexedDB based caching for labels, inboxes and teams [CW-50] (#6710)
* feat: allow caching of labels in the account scope

* feat: send cache keys in account json response

* feat: kickstart web worker

* feat: setup basic architecture for workers

* feat: install idb

* feat: add datamanger

* fix: typos

* refactor: rename method

* feat: make init db a manual step

* refactor: separate accountIdFromRoute

* feat: cache enabled API client

* feat: enable caching for inboxes and labels

* feat: enable cache for team

* feat: manage exceptions for team

* feat: add team to data manager

* feat: add a generic listener

* refactor: send only cache keys

* refactor: separate validate method

* feat: add listeners

* feat: add event for revalidate

* feat: add cache keys endpoint

* refactor: fetch cache keys instead of full account data

* fix: key pattern

* feat: don't fetch account for cache_keys

* fix: cache key base class

* refactor: cache keys helper

* feat: add helper

* fix: cache-key update logic

* feat: delete indexeddb on logout

* feat: remove worker.js

* refactor: move data-manager

* refactor: name of file

* feat: add test for DataManager

* refactor: add fake idb to jest setup

* test: cache keys helper

* test: cache keys helper

* test: cache_keys in accounts controller

* refactor: remove cache_keys context

* feat: add policy for cache-keys
2023-03-27 12:16:25 +05:30
Pranav Raj SandGitHub 6000028f64 feat: Allow agents/admins to copy the link to a message (#5912) 2023-03-26 22:58:42 -07:00
Pranav Raj SandGitHub 1e8881577a fix: Display native context menu on image, video preview modals (#6756) 2023-03-26 15:16:56 -07:00
Pranav Raj SandGitHub 4b83bcb5ca fix: Move subscription to after initialize (#6752) 2023-03-26 12:19:29 -07:00
Pranav Raj SandGitHub 70e7530cb4 feat: Setup context menu for message (#6750) 2023-03-24 16:20:19 -07:00
Pranav Raj SandGitHub d666afd757 chore: Refactor messages to support right click context menu (#6748) 2023-03-24 13:49:44 -07:00
Muhsin KelothandGitHub a6e7737c56 feat: Show custom attributes in pre-chat form on new conversation (#6735) 2023-03-23 15:22:49 +05:30
Tejaswini ChileandGitHub 856d9067b0 fix: Super admin redirect issue [CW-1370] (#6715) 2023-03-23 14:37:21 +05:30
Tejaswini ChileandGitHub d94f195284 feat: Add link for instagram profile link (#6721) 2023-03-23 13:34:42 +05:30
1370cf3c07 chore: Update translations
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-03-23 13:30:21 +05:30
Sivin VargheseandGitHub 1dd7cfc25d fix: Design issues after RTL changes (#6718) 2023-03-21 13:25:35 -07:00
Nithin David ThomasandGitHub f3aba84063 fix: Fixes scroll behavior for search page (#6717) 2023-03-21 12:10:08 +05:30
Tejaswini ChileandGitHub 9c040af028 [CW-1348] fix: Update email regex validation for contact_inbox (#6705) 2023-03-21 10:51:12 +05:30
Sivin VargheseandGitHub 4cae5c7d51 chore: The label creation UI input is transform to lowercase (#6712) 2023-03-20 20:35:15 +05:30
Shivam MishraandGitHub e5134c9ef5 [CW-53] feat: allow downloading heatmap report (#6683)
* feat: add control header slot

* feat: add download API call

* feat: add conversation traffic template

* feat: allow downloading heatmap content

* feat: wire up download

* fix: grid layout for mobile

* chore: revert formatting

* revert: en.yml file

* feat: add conversation traffic text

* feat: disable rule for map block

* test: conversation traffic

* fix: timezone offset

* feat: download report in UTC

* feat: add UTC warning

* chore: revert formatting

* feat: add traffic text

* chore: fix whitespace change
2023-03-20 15:46:29 +05:30
Tejaswini ChileandGitHub 4f936aada5 [CW-1342]: Inbox deletion in background job (#6708) 2023-03-20 13:46:07 +05:30
TarangandGitHub 0c9f129c74 Fix issues with Microsoft Provider (#6702) 2023-03-20 12:27:43 +05:30
Nithin David ThomasandGitHub d2aa5f4c69 fix: Reverts popover styling for search page (#6688) 2023-03-20 11:04:56 +05:30
Nithin David ThomasandGitHub e76b63f91d chore: Upgrade prosemirror package to fix link rendering issue (#6685) 2023-03-16 13:42:52 -07:00
Muhsin KelothandGitHub 5c5764ca85 chore: Enable icelandic language(#6682)
ref: #6681
2023-03-16 20:32:55 +05:30
Tejaswini ChileandGitHub cf487c76a0 fix: delete user record if belongs to no account (#6664) 2023-03-15 21:49:49 +05:30
Sojan 6848433a4c Merge branch 'release/2.15.0' into develop 2023-03-15 19:58:28 +05:30
Sojan 3e6d23e071 Merge branch 'release/2.15.0'
Publish Chatwoot CE docker images / build (push) Waiting to run
2023-03-15 19:58:19 +05:30
Sojan 565b87fa98 Bump version to 2.15.0 2023-03-15 19:57:59 +05:30
Sojan JoseandGitHub de8c26dce8 chore: Additional indexes and fixes (#6675)
- Fix breakage related to the look-up job in Heroku deploys 
- Add additional db indexes for performance optimisations
2023-03-15 19:52:02 +05:30
7331154f04 chore: Update translations
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-03-15 15:23:38 +05:30
Sojan JoseandGitHub a99c37ae5e chore: Resolve bundle audit (#6671)
- Update gems to resolve bundle Audit advisories
2023-03-15 14:05:54 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
a4bcb7f154 chore(deps): bump @xmldom/xmldom from 0.7.5 to 0.7.9 (#6666)
Bumps [@xmldom/xmldom](https://github.com/xmldom/xmldom) from 0.7.5 to 0.7.9.
- [Release notes](https://github.com/xmldom/xmldom/releases)
- [Changelog](https://github.com/xmldom/xmldom/blob/master/CHANGELOG.md)
- [Commits](https://github.com/xmldom/xmldom/compare/0.7.5...0.7.9)

---
updated-dependencies:
- dependency-name: "@xmldom/xmldom"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-14 19:00:09 -07:00
Pranav Raj SandGitHub eb7070d946 feat(poc): Disable widget based on country (#6658) 2023-03-14 09:09:57 -07:00
Sojan JoseandGitHub e8a174f689 chore: Add sidekiq metrics to newrelic (#6659)
* chore: Add sidekiq stats to newrelic

* chore: add gemlock
2023-03-14 20:50:28 +05:30
Tejaswini ChileandGitHub 24f8befdf2 Fix: Add articles order in category show page (#6662) 2023-03-14 20:00:01 +05:30
Sojan JoseandGitHub abe57873db chore: Disable throwing Webhook exceptions to Sentry (#6663)
- There is little value in throwing the third-party webhook-related exceptions to sentry. Let's rather write it to logs instead.
2023-03-14 17:40:40 +05:30
Nithin David ThomasandGitHub cae3ac94cd feat: Search improvements for conversations (#6645)
* feat: Shows search as a popover

* Reverts search from popover to page

* Fixes review comments on usability

* Fixes keyboard navigation issues
2023-03-14 13:09:43 +05:30
Sojan JoseandGitHub da76537011 chore: Search optimisations (#6644)
- Strip search term before searching
- order messages by created_at desc
- order contacts by last_activity_at desc
- order conversations by created_at desc
- Search only resolved contacts
- Optimize resolved contacts query

ref: #6583
2023-03-13 19:10:31 +05:30
Sojan JoseandGitHub 7cbf1857e4 chore: Set statement timeout for Postgres (#6641)
By default, Rails does not set a timeout on database statements. For example, this will run for a full day, even if your ruby process goes away. But it's configurable in the database.yml with the statement_timeout variable.

Hence we are enforcing a 14s timeout by default. Migration commands inside chatwoot will run with a 10 minutes timeout. For specific cases like migrations, we can override this timeout using the environment variable POSTGRES_STATEMENT_TIMEOUT while starting a new rails console.

Test the timeouts from the rails console using.

```
ActiveRecord::Base.connection.execute("SELECT pg_sleep(15);")
```

ref: https://github.com/ankane/the-ultimate-guide-to-ruby-timeouts#postgresql
ref: https://til.hashrocket.com/posts/b44baf657d-railspg-statement-timeout-
2023-03-13 18:34:18 +05:30
Tejaswini ChileandGitHub 8f4d4798c2 feat: Backend changes for article and categories ordering (#6655) 2023-03-13 17:39:07 +05:30
2e95d3a173 fix: Duplicate conversations and contacts WA and Brazil numbers (#6222)
Resolves issue when receiving a message from Brazil  Whatsapp number.
Fixes: #5840


Co-authored-by: Sojan <sojan@pepalo.com>
2023-03-13 13:20:53 +05:30
Tejaswini ChileandGitHub c9b63ae8eb fix: hook exception for empty hook (#6646) 2023-03-10 16:40:15 +05:30
Tejaswini ChileandGitHub f2684545d9 fix: Handle dialogflow hook without setting and credentials (#6638) 2023-03-09 20:11:08 +05:30
Tejaswini ChileandGitHub fbdc79df76 Fix: skip invalid access token from sentry (#6639) 2023-03-09 16:28:45 +05:30
Tejaswini ChileandGitHub 54b7c98795 fix: Warn Facebook error code 100-2018218 (#6632) 2023-03-09 13:51:10 +05:30
Tejaswini ChileandGitHub 757e1bb1f7 fix: String interpolation (#6635) 2023-03-09 13:50:26 +05:30
Shivam MishraandGitHub 4673cf8cf1 fix: timing in the API (#6633)
* fix: timing in the API

* test: fix params
2023-03-09 00:40:38 +05:30
dd8f8fc845 chore: Disable error tracking for Whatsapp error webhooks (#6627)
https://developers.facebook.com/docs/whatsapp/on-premises/webhooks/components

We are not going to handle the WhatsApp error component webhook event.

https://chatwoot-p3.sentry.io/issues/3957884597/?project=4504723538771968&query=is%3Aunresolved&referrer=issue-stream

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-03-08 20:50:59 +05:30
c20410f3f4 feat: Ability to update CSAT over Client APIs (#6470)
This PR allows updating CSAT over Client APIs.

ref: #6328

Co-authored-by: Cristian Duta <Cristian.Duta@ti8m.ch>
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-03-08 18:42:49 +05:30
Sojan JoseandGitHub 9bc0f67f54 feat: Add specs for WHATSAPP_CLOUD_BASE_URL env variable (#6630)
ref: #6622
2023-03-08 18:38:54 +05:30
Clairton Rodrigo HeinzenandGitHub eb4da33cdc feat: Ability to customize the base url for Whatsapp Cloud Service (#6622)
Configure a custom endpoint for Whatsapp Cloud Service via `WHATSAPP_CLOUD_BASE_URL`.

refs:  #5142
2023-03-08 18:23:25 +05:30
0fe05dc1b9 feat: add trigram index to tags (#6615)
Fixes: chatwoot/product#796

This migration adds a trigram index to the tags table on the name column. This is used to speed up the search for tags by name, this is a heavy sub-query when generating reports where labels are involved.

Trigram indexes are used to speed up LIKE queries; they are not used for equality queries. This is because the index is not a btree index, it is a GIN index. This means that the index is not ordered and so cannot be used for equality queries.

Read more: https://www.postgresql.org/docs/current/pgtrgm.html

The index is created concurrently: https://thoughtbot.com/blog/how-to-create-postgres-indexes-concurrently-in
---------

Co-authored-by: Sojan <sojan@pepalo.com>
2023-03-08 18:11:07 +05:30
Sojan JoseandGitHub d59fd6b747 chore: Ensure Template messages work even when bot is connected (#6455)
ref: #5592
2023-03-08 18:01:00 +05:30
Sojan JoseandGitHub 5166fd8948 chore: Update gems (#6628)
- Updating gems based on ruby advisory warnings
2023-03-08 17:40:21 +05:30
5214be67c7 chore: Update translations
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-03-08 14:00:00 +05:30
d6f3643bf0 fix : Meta tags input in help center clears the input value after clicking outside (#6552)
* chore: supports preserving input value after clicking out

Co-authored-by: BikashSah999 <51731962+BikashSah999@users.noreply.github.com>

* chore: supports tag addition on blur

Co-authored-by: BikashSah999 <51731962+BikashSah999@users.noreply.github.com>

* feat: use search-change instead of vue-multiselect refs

Co-authored-by: BikashSah999 <51731962+BikashSah999@users.noreply.github.com>

---------

Co-authored-by: BikashSah999 <51731962+BikashSah999@users.noreply.github.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-03-07 19:27:10 +05:30
Tejaswini ChileandGitHub 9c9183a352 chore: spec ensuring first_reply_created doesn't trigger automations
Specs to ensure that first_reply_created event doesn't trigger automations

ref: #6618
2023-03-07 17:40:17 +05:30
c88792f4a3 feat: add Conversation traffic heatmap (#6508)
* feat: add heatmap component

* feat: add heatmap component

* feat: add dummy heatmap

* refactor: compact tiles

* feat: allow hour

* feat: wire up heatmap query

* feat: allow arbritrary number of weeks

* feat: update position of the widget

* chore: update heatmap title

* refactor: move traffic heatmap to overview

* chore: add comment for perf

* feat: add reconcile logic for heatmap fetching

Fetching the data for the last 6 days all the time is wasteful
So we fetch only the data for today and reconcile it with the data we already have

* refactor: re-org code for new utils

* feat: add translations

* feat: translate days of the week

* chore: update chatwoot utils

* feat: add markers to heatmap

* refactor: update class names

* refactor: move flatten as a separate method

* test: Heatmap Helpers

* chore: add comments

* refactor: method naming

* refactor: use heatmap-level mixin

* refactor: cleanup css

* chore: remove log

* refactor: reports.js to use object instead of separate params

* refactor: report store to use new API design

* refactor: rename HeatmapHelper -> ReportsDataHelper

* refactor: separate clampDataBetweenTimeline

* feat: add tests

* fix: group by hour

* feat: add scroll for smaller screens

* refactor: add base data to reconcile with

* fix: tests

* fix: overflow only on smaller screens

* feat: translate tooltip

* refactor: simplify reconcile

* chore: add docs

* chore: remoev heatmap from account report

* feat: let Heatmap handle loading state

* chore: Apply suggestions from code review

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>

* feat: update css

* refactor: color assignment to range

* feat: add short circuit

* Update app/javascript/dashboard/routes/dashboard/settings/reports/components/Heatmap.vue

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-03-07 09:01:58 +05:30
Tejaswini ChileandGitHub 2abc57300c fix: Add a check for automation_created message in FIRST_REPLY_CREATED event (#6618) 2023-03-06 17:47:35 +05:30
WojtekandGitHub 9c6eb8b03d chore: Fix the comment in schedule.yml (#6606) 2023-03-03 10:22:25 -08:00
88ed028a06 feat: Revamps search to use new search API's (#6582)
* feat: Revamps search to use new search API's

* Fixes search result spacing

* Fixes message result

* Fixes issue with empty search results

* Remove console errors

* Remove console errors

* Fix console errors, canned responses

* Fixes message rendering on results

* Highlights search term

* Fixes html rendering for emails

* FIxes email rendering issues

* Removes extra spaces and line breaks

---------

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-03-03 20:58:21 +05:30
2a385f377c chore: Use markdown-it instead of marked (#6123)
* chore: Use markdown-it instead of marked

* Adds styling for markdown rendered content

* fixes codeclimate issue

* Fixes blockquote styles for widget in darkmode

* fix: issue block quote color issue in light mode

* fix: issue block quote color issue in light mode

* Fixes blockquote color in dark mode

* Remove usage of dark mode mixin in user bubble

* chore: code clean up

---------

Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: iamsivin <iamsivin@gmail.com>
2023-03-03 13:26:54 +05:30
Tejaswini ChileandGitHub ec04ddc725 Fallback name branch (#6591) 2023-03-03 12:26:59 +05:30
Tejaswini ChileandGitHub 60fee519bd Exception tracker with account (#6603) 2023-03-03 12:14:44 +05:30
Sivin VargheseandGitHub a685e065da fix: Fixes assignee and inbox name spacing issues (#6589) 2023-03-02 22:00:43 +05:30
Tejaswini ChileandGitHub a4fc0eef4b fix: Exception tracking for dialogflow bot service (#6593) 2023-03-02 21:33:07 +05:30
Shivam MishraandGitHub a6405ea339 fix: migration script to run on all reporting events (#6590)
* fix: migration script to run on all reporting events

* fix: don't update user_id if it is already present

* refactor: create a new migration

* feat: update schema

* feat: ignore events with bot handoff

* feat: prefetch conversations with handoff events

* Revert "feat: update schema"

This reverts commit 25ed2856e62655f5f1db14fd0cffad3a69d0b1fb.

* feat: update schema

* refactor: separate method get_conversations_with_bot_handoffs

* refactor: cognitive complexity

* refactor: early return if last_bot_reply is blank

* feat: add async_database_migration queue

* feat: update queue priority
2023-03-02 19:03:31 +05:30
Sojan JoseandGitHub b185059681 chore: Handle APM variables being empty (#6594)
- handle the case where the system fails to start when empty APM environment variables are present
2023-03-02 16:00:16 +05:30
89c391e7c0 fix: Clicking contact name in conversation should open contact details panel (#6580)
* chore: support panel trigger on contact name click

Co-authored-by: BikashSah999 <51731962+BikashSah999@users.noreply.github.com>

* Update ConversationHeader.vue

---------

Co-authored-by: BikashSah999 <51731962+BikashSah999@users.noreply.github.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
2023-03-02 13:16:57 +05:30
Pranav Raj SandGitHub 9e8eb293e9 fix: Allow integration apps to be listed by an agent (#6587)
* fix: Allow integration apps to be listed by an agent

* Fix rubocop
2023-03-02 13:02:21 +05:30
Tejaswini ChileandGitHub 61d0a63bf7 Fix: product#804: email sender improvement (#6579) 2023-03-02 10:57:14 +05:30
Tejaswini ChileandGitHub f1827c82fd Update contact create swagger (#6576) 2023-03-01 20:24:21 +05:30
Vishnu NarayananandGitHub d870b0815a feat: Audit log APIs (#6434)
- Adds the appropriate APIs for Audit Logs.

ref: #6015
2023-03-01 20:02:58 +05:30
Nithin David ThomasandGitHub daf17046e9 feat: Creates component to display conversation search results (#6575)
* feat: Creates component to display conversation search results

* Fixes minor bugs
2023-03-01 19:11:10 +05:30
c8cdff8bc4 feat: Creates component to show contact search results (#6571)
* feat: Creates component to show contact search results

* Refactors unused code

* Review fixes

* Update app/javascript/dashboard/modules/search/components/SearchResultContactItem.vue

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>

---------

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-03-01 18:26:29 +05:30
34a2486e9c chore: Support plus forwarding in email channel (#6482)
- Support for plus forwarding in the email addresses for email channels

Co-authored-by: Sojan <sojan@pepalo.com>
2023-03-01 15:42:48 +05:30
40e81c63ad chore: New Crowdin updates (#6566)
- Pulling the latest translation updates from Crowdin.

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-03-01 14:35:04 +05:30
Sojan JoseandGitHub c9c3ac4b44 chore: Load only required APMs (#6497)
- Disable requiring the gems for all the APMs 
- Switch to selectively requiring them.
2023-03-01 14:31:51 +05:30
Sojan JoseandGitHub 4c921d3d0e chore: fix flaky tests (#6569)
- fixing flaky test in search service spec
2023-03-01 11:44:16 +05:30
Pranav Raj SandGitHub e5090fcdc7 fix: Show only categories where published articles count > 0 (#6567) 2023-03-01 11:02:54 +05:30
Sivin VargheseandGitHub 0a993978ba bug: Bulk actions Assign agent is not working (#6568) 2023-03-01 10:53:40 +05:30
Sojan JoseandGitHub d4e7eaecce feat: New APIs for search (#6564)
- Adding new API endpoints for search
- Migrations to add appropriate indexes
2023-02-28 22:00:36 +05:30
Sivin VargheseandGitHub 9bd47588fc bug: Fixes i18n is not working on the help center dashboard (#6562) 2023-02-28 16:12:08 +05:30
d5a2756462 feat: Add the option for consent form (#6511)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-02-28 13:57:05 +05:30
Vishnu NarayananandGitHub 42d9b6ffed chore: upload log artifact in nightly gh action (#6513) 2023-02-28 12:18:06 +05:30
Chatwoot BotandGitHub 04f30e3033 chore: Update translations (#6534) 2023-02-27 18:15:34 -08:00
Pranav Raj SandGitHub 69a1c4527f fix: Fix i18n issues with help center (#6559) 2023-02-27 17:45:57 -08:00
Pranav Raj SandGitHub b141fc1289 fix: Fetch categories by locale (#6557) 2023-02-27 09:12:14 -08:00
Tejaswini ChileandGitHub ce807d3251 fix: Condition based backend validation (#6554) 2023-02-27 20:22:07 +05:30
Tejaswini ChileandGitHub b76fda53a2 fix: Email subject automation issue (#6533) 2023-02-27 18:33:11 +05:30
Sivin VargheseandGitHub eb55ff5c9b chore: Adds the ability to automatically initialize the RTL direction (#6531) 2023-02-27 12:03:40 +05:30
Sivin VargheseandGitHub bfb445186d chore: Refactor reports css for RTL (#6537) 2023-02-27 11:50:21 +05:30
7d4e6d0257 chore: Refactor tables in all screen for RTL (#6525)
* chore: Refactor tables in all screen for RTL

* Notification page footer

* Apply suggestions from code review

* chore: Minor ixes

* chore: Adds rtl comment

* chore: Code clean up for contact table

---------

Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
2023-02-27 11:36:28 +05:30
06ffaa90fc fix: bots included in time to response metrics (#6409)
* feat: ignore bots in avg_first_response_time

* feat: ignore bots in avg_first_response count

* feat: add bot handoff event

* feat: add handoff event listener and reporting event

* fix: ignore agent bot in first response

* refactor: calculate first_response with last handoff

* refactor: method defn order

* test: new reporting events

* feat: Revert "feat: ignore bots in avg_first_response count"

This reverts commit de1977c219a2e7a9180dd02272244fe3b3f7ce89.

* feat: Revert "feat: ignore bots in avg_first_response_time"

This reverts commit bb9171945d5e3b2f6015f4f96dd1b76b3efb6987.

* fix: business hour calculation for first_reply

* fix: event_start_time for first_response

* feat: add migration to recompute first_responses

* refactor: separate mute helpers for conversation

* refactor: rename migration

* refactor: migration script

* fix: migration typo

* fix: typo in query

* feat: update schema.rb

* Revert "feat: update schema.rb"

This reverts commit 353ef355f2d956dd219907bb66982dc90ca5d896.

* feat: update schema

* refactor: update events as a batch job

* fix: ignore the event if value is negative

* feat: don't create a new hand-off if it's already present

* refactor: break the action into smaller chunks

* refactor: update reporting listener spec

Handle the case to ensure extra bot handoffs are not created for a give conversation

* fix: import error

---------

Co-authored-by: Vishnu Narayanan <vishnu@chatwoot.com>
2023-02-25 09:48:48 +05:30
Sivin VargheseandGitHub 92d0398744 chore: Refactor conversation info panel for RTL (#6526)
* chore: Refactor conversation info panel for RTL

* chore: Adds comments

* chore: Settings header icon fix

* chore: Toggle layout switch

* chore: Border fix in chat list
2023-02-24 19:20:17 +05:30
Shivam MishraandGitHub 76650c86cd chore: add --force-exclusion option (#6535)
The pre-commit hook would format event those files excluded in the config. This is because the files were passed as args instead of the linter running on the entire project. When this happens, the exclude is not respect.

The --force-exclusion flag instructs our machine overlords to force exlucde files specified in the configuration Exclude even if they are explicitly passed as arguments.
2023-02-24 17:15:11 +05:30
Pranav Raj SandGitHub c998c84bc0 fix: Name missing when email is collected via email hook (#6530)
- The name is not updated when the email is updated via the email collect message. This PR fixes that.
2023-02-24 15:24:53 +05:30
Tejaswini ChileandGitHub 26e760a281 Add sender_name in the SMTP reply mails (#6528) 2023-02-24 13:20:56 +05:30
9fcb29484d chore: Refactor sidebar related changes for RTL (#6519)
* Woot tabs

* Refactor sidebar related RTL

* Context menu

* chore: Minor fixes

* chore: Dropdown

* chore: Toggle switch

* chore: sidebar fixes

* fix: spacing issues and minor fixes

* chore: Space slab to small

---------

Co-authored-by: Nithin David <1277421+nithindavid@users.noreply.github.com>
2023-02-24 13:01:54 +05:30
Sivin VargheseandGitHub 6d4b894f95 chore: Refactor chat list for RTL (#6524)
* chore: Refactor chat list for RTL

* chore: Modal

* fix: Show more button margin

* chore: Inbox name fix
2023-02-24 12:35:06 +05:30
Pranav Raj SandGitHub e7d0bf8a1b chore: Display CSAT responses in the message itself. (#6529) 2023-02-23 18:11:46 -08:00
60f953cd27 chore: Refactor reports for RTL (#6517)
* Refactor reports

* fix: spacing issues and minor fixes

---------

Co-authored-by: Nithin David <1277421+nithindavid@users.noreply.github.com>
2023-02-23 19:50:49 +05:30
Vishnu NarayananandGitHub 71f2b27728 fix: ActiveRecord::RecordNotFound Couldn't find Channel::WebWidget (#6523)
* fix: resucue ActiveRecord::RecordNotFound for webwidget controller

* chore: add rails.log
2023-02-23 19:16:07 +05:30
Sivin VargheseandGitHub 6407745571 chore: Woot tabs for RTL(#6518) 2023-02-23 18:18:28 +05:30
Sivin VargheseandGitHub 409466bbd5 chore: RTL configuration (#6521)
* chore: RTL configuration

* Adds scss file
2023-02-23 17:50:44 +05:30
87aabfbb9a chore: Refactor integrations pages for RTL (#6516)
* Refactor integrations

* Adjust spacing for integration item

---------

Co-authored-by: Nithin David <1277421+nithindavid@users.noreply.github.com>
2023-02-23 17:29:28 +05:30
Sivin VargheseandGitHub fdf8b3f369 chore: Refactor utility files for RTL (#6515)
* Chore: Refactor for RTL

* Chore: mInor fixes

* minor fixes
2023-02-23 16:59:48 +05:30
Nithin David ThomasandGitHub 2674130714 chore: Refactors chatlist header css to work with RTL (#6520)
authored by 1277421+nithindavid@users.noreply.github.com
2023-02-23 16:45:56 +05:30
Clairton Rodrigo HeinzenandGitHub 8935933266 fix: First attachment with caption for whatsapp channel (#6486) 2023-02-22 18:20:10 +05:30
cd6a836bf6 fix: Resolves icelandic locale not shown properly on UI (#6505)
Closes #6484

Co-authored-by: raph941 <45232708+raph941@users.noreply.github.com>
2023-02-22 15:40:48 +05:30
b905d4854a fix: Access token should be hidden/masked by default in Agent Dashboard (#6492)
Supports masking/unmasking sensitive data such as API Tokens in the agent dashboard.

Fixes: #6322

Co-authored-by: raph941 <45232708+raph941@users.noreply.github.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
2023-02-21 19:19:15 +05:30
aff97bff26 feat: Supports masking tokens in super admin (#6491)
Supports masking/unmasking sensitive data such as API Tokens in the super admin dashboard.
ref: #6322

Co-authored-by: raph941 <45232708+raph941@users.noreply.github.com>
Co-authored-by: phunguyenmurcul <51897872+phunguyenmurcul@users.noreply.github.com>
2023-02-21 17:50:55 +05:30
Afonso LageandGitHub e3d9a0441d chore: Bumped Ruby version on codespace image to 3.1.3 (#6490)
- Bumped Ruby version on codespace docker image to match the new Ruby version 3.1.3, which is required since from 2.14.
2023-02-21 17:05:46 +05:30
930863b25b fix: sentry CHATWOOT-37A ActiveRecord::RecordNotUnique (#6496)
* fix: sentry CHATWOOT-37A #6457

* chore: add spec
---------

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-02-21 09:34:51 +05:30
62de25960c feat: Integrate LogRocket (#6494)
* feat: install logrocket

* feat: allow log rocket

* feat: enable vuex log-rocket

* feat: integrate vuex with log rocket

* feat: add log rocket identify

* fix: identify if log rocket is initialized

---------

Co-authored-by: Vishnu Narayanan <vishnu@chatwoot.com>
2023-02-21 08:42:45 +05:30
Vishnu NarayananandGitHub 26f164d6a0 fix: foss_spec github action (#6495)
* fix: foss_spec gh action
* chore: upload log artifact in foss_spec gh action
* chore: ping foss_spec gh action runner os version to ubuntu-20.04
* fix: set nodeversion to 16
2023-02-20 23:37:41 +05:30
Nithin David ThomasandGitHub c9242fac9e fix: Warning in conversations page from participants (#6479) 2023-02-17 08:44:16 -08:00
Pranav Raj SandGitHub b479b7c6d7 chore: Enable push permissions if available (#6474) 2023-02-17 08:43:28 -08:00
Nithin David ThomasandGitHub 4d719a8fe3 fix: Add a settings link for portals in sidebar (#6475) 2023-02-17 17:48:16 +05:30
Pranav Raj SandGitHub 71d8195845 fix: Add scoped CSS for participants (#6472) 2023-02-16 09:57:11 -08:00
59964a4f41 swagger: fixed invalid specification (#5485)
Currently, the swagger spec doesn't follow the Swagger 2.0 specification. So, I facing 4 errors when trying generate the Golang client for chatwoot.
Due to the spec, the binary field should use format: binary beside type: string

Signed-off-by: Giau. Tran Minh <hello@giautm.dev>
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-02-16 17:47:26 +05:30
Sojan 8c49a2efc5 Merge branch 'release/2.14.0' into develop 2023-02-16 13:42:32 +05:30
Sojan 0e3eb51d7a Merge branch 'release/2.14.0'
Publish Chatwoot CE docker images / build (push) Waiting to run
2023-02-16 13:42:21 +05:30
Sojan 0bbc8ebd6f Bump version to 2.14.0 2023-02-16 13:41:10 +05:30
ca1adb9960 feat: conversation participants (#4145)
Fixes #241
Fixes: chatwoot/product#648

Co-authored-by: Aswin Dev P.S <aswindevps@gmail.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-02-16 13:35:06 +05:30
7be2ef3292 feat: Google OAuth for login & signup (#6346)
This PR adds Google OAuth for all existing users, allowing users to log in or sign up via their Google account.

---------

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
Co-authored-by: Fayaz Ahmed <15716057+fayazara@users.noreply.github.com>
Co-authored-by: Sojan <sojan@pepalo.com>
2023-02-16 11:12:02 +05:30
2c8ecbeceb feat: Adds image attachment for help center articles (#6426)
* Added one more endpoint to attach tempfile and get logo

* Added one more endpoint to attach tempfile and get logo

* spec fixes

* Upload file for articles irrespective of the association

* Upload file for articles irrespective of the association

* Add multiple images with different keys

* feat: Adds image attachment for help center articles

* Adds validation for file upload

* Fixes space above image after adding to doc

* chore: Removed svg from file upload type

* Update app/javascript/dashboard/components/widgets/WootWriter/FullEditor.vue

Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>

* Update app/javascript/dashboard/components/widgets/WootWriter/FullEditor.vue

Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>

* Removes caption for the image

* Fixes woot prosemirror package version

* Update yarn.lock

* Update yarn.lock

---------

Co-authored-by: Tejaswini Chile <tejaswini@chatwoot.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: iamsivin <iamsivin@gmail.com>
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-02-15 21:11:32 -08:00
Pranav Raj SandGitHub 80784e3cab feat: Add Google Translate API Integration (#6454) 2023-02-15 20:50:45 -08:00
Chatwoot BotandGitHub c12bdc8350 chore: Update translations (#6449) 2023-02-15 20:42:45 -08:00
Sojan JoseandGitHub 0888596b83 chore: Limit widget endpoint with rack attack (#6465)
ref: https://github.com/chatwoot/chatwoot/issues/1007#issuecomment-1427156094
2023-02-15 20:41:40 -08:00
7044eda281 chore: Add controllers for conversation participants (#6462)
Co-authored-by: Aswin Dev P.S <aswindevps@gmail.com>
Co-authored-by: Sojan Jose <sojan@chatwoot.com>
2023-02-15 16:33:31 -08:00
Pranav Raj SandGitHub 949ddf68ba chore: Refactor the notification service for participants (#6461) 2023-02-15 14:14:56 -08:00
d6baa5db85 fix: Send attachments as multiple messages for whatsapp channel (#6428)
* fix: Send attachments as multiple messages for whatsapp channel

* Review fixes

* Fixes bug with whatsapp inbox check condition

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-02-15 12:53:20 -08:00
97b1b4c6f9 fix: Prevents duplicate action trigger on interactive messages (#6448)
Co-authored-by: raph941 <45232708+raph941@users.noreply.github.com>
Co-authored-by: phunguyenmurcul <51897872+phunguyenmurcul@users.noreply.github.com>
2023-02-14 11:57:22 -08:00
Pranav Raj SandGitHub 98ff185d42 chore: Add formatting for the view count (#6447) 2023-02-13 14:29:14 -08:00
caca99a823 fix : Help Center article view count (#6429)
* fix: resolves issue with non updating article view count

Co-authored-by: BikashSah999 <51731962+BikashSah999@users.noreply.github.com>

* Update articles_controller.rb

---------

Co-authored-by: BikashSah999 <51731962+BikashSah999@users.noreply.github.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-02-13 14:27:17 -08:00
Sojan JoseandGitHub f0fbaacaf7 chore: Switch to csv-safe gem to avoid csv injection (#6444) 2023-02-13 13:38:36 -08:00
Chatwoot BotandGitHub ff9cadc9a0 chore: Update translations from Crowdin (#6283) 2023-02-13 13:34:53 -08:00
29025759d6 feat: Add webhook events for contact created, updated (#6415)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-02-13 13:28:27 -08:00
Shivam MishraandGitHub ba69f4cd35 test: fix time spec breaking circle CI (#6443) 2023-02-13 18:35:09 +05:30
Sojan JoseandGitHub 5cbfcfbfa0 chore: Limit conversation resolution Job (#6433)
We will be adding a limit to the resolution job so that it is performed at a spaced interval. This will ensure there won't be a sudden spike in resource usage

fixes: chatwoot/product#707
2023-02-13 14:00:52 +05:30
Shivam MishraandGitHub a06a5a574a fix: use innerText instead of innerHTML (#6431)
* refactor: use inner text instead of inner html

* refactor: use innerText instead of innerHTML
2023-02-10 17:20:15 +05:30
Pranav Raj SandGitHub 8db40f2d82 chore: Add chatwoot:on-message event (#6425) 2023-02-09 12:48:22 -08:00
53d5d2af3c chore: Remove pagination from macros listing api (#6419)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-02-09 16:56:37 +05:30
e18f4aeee9 fix: Text color bug on attachment bubble in widget (#6399)
* fix: Text color bug on attachment bubble

* chore: Fix file bubble text color issue

---------

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: iamsivin <iamsivin@gmail.com>
2023-02-09 16:50:11 +05:30
Tejaswini ChileandGitHub c5b245977a Added one more endpoint to attach tempfile and get logo (#6407) 2023-02-09 14:05:45 +05:30
0a7a5abec1 feat: Adds the ability to change WhatsApp API key (#6348)
This PR adds the ability to change the WhatsApp API key through the settings under the configuration section

Fixes: #6199

Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Sojan <sojan@pepalo.com>
2023-02-08 19:57:59 +05:30
Sojan JoseandGitHub aab6b10b67 [Snyk] Fix for 9 vulnerabilities (#6304) 2023-02-08 18:29:41 +05:30
JanWarlenandGitHub 8a6f647027 fixBug: email notification error, Attachment Message without content (#6408) 2023-02-08 12:51:52 +05:30
Tejaswini ChileandGitHub 7c21cef467 Added event for conversation opened (#6412) 2023-02-08 12:05:22 +05:30
73d14f204e feat: Add the ability to receive contact(vCard) on a WhatsApp inbox (#6330)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-02-07 19:36:38 -08:00
Pranav Raj SandGitHub bc96e5ed22 fix: Add defaults for the cc, bcc emails (#6405) 2023-02-06 18:12:45 -08:00
f8aa544aae fix: order for canned response (#6400)
* feat: order canned response

Order canned responses by short_code match first and then with content

* Added specs

---------

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-02-06 12:53:48 -08:00
Pranav Raj SandGitHub d672aa357b chore: Add subject to the slack message (#6404) 2023-02-06 12:42:06 -08:00
Pranav Raj SandGitHub 527bf593b1 fix: data.attachments is undefined for emails without body (#6403) 2023-02-06 11:45:15 -08:00
Muhsin KelothandGitHub 5902c7a5e1 chore: Update user account availability status (#6375) 2023-02-06 11:07:31 -08:00
Sojan JoseandGitHub 6b839a0442 feat: Ability for super admin to impersonate a user (#6382) 2023-02-06 11:00:08 -08:00
brunosfgandGitHub 0a2d3130e0 Wrong Translation (#6384)
The "open action" translation would be "Abrir" (verb) instead of "Abertas" (which is the adjective).
2023-02-06 13:20:59 +05:30
8ac1cab27e feat: Show contact created date in contact panel (#6364)
* feat: Show contact created date in contact panel

* Add created at in Contacts table

* Moves created at info as tooltip

---------

Co-authored-by: Nithin David <1277421+nithindavid@users.noreply.github.com>
2023-02-04 10:40:23 +05:30
Sojan JoseandGitHub 38aee8d9ea chore: Switch to web-push gem (#6390)
- The previous gem, `webpush` was last updated a while ago. Also, with the recent ruby upgrade, we needed a fix for zaru/webpush#106. Hence switching to the `web-push` gem where the issues are fixed.
2023-02-03 18:55:22 +05:30
Vishnu Narayanan 46eeee7d92 Merge branch 'hotfix/2.13.1' into develop 2023-02-03 18:47:57 +05:30
Vishnu Narayanan 4ffe73a1ce Merge branch 'hotfix/2.13.1'
Publish Chatwoot CE docker images / build (push) Waiting to run
2023-02-03 18:47:31 +05:30
Vishnu Narayanan 76b0279571 chore: Bump version to v2.13.1 2023-02-03 18:46:25 +05:30
Vishnu Narayanan 76731ae31a chore: fix docker public assets issue #6341 2023-02-03 18:45:35 +05:30
Sojan JoseandGitHub ef02fff71e chore: Update Newrelic agent (#6388)
- update new relic agent to 8.15
2023-02-03 16:47:10 +05:30
Shubham KumarandGitHub 51e0388779 feat: Skip gh thread lock gh action on forks (#6381) 2023-02-03 12:20:49 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
30fcb47477 chore(deps): bump commonmarker from 0.23.6 to 0.23.7 (#6342)
Bumps [commonmarker](https://github.com/gjtorikian/commonmarker) from 0.23.6 to 0.23.7.
- [Release notes](https://github.com/gjtorikian/commonmarker/releases)
- [Changelog](https://github.com/gjtorikian/commonmarker/blob/main/CHANGELOG.md)
- [Commits](https://github.com/gjtorikian/commonmarker/compare/v0.23.6...v0.23.7)

---
updated-dependencies:
- dependency-name: commonmarker
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-02 13:13:35 -08:00
Sivin VargheseandGitHub 84e46adf1c fix: Cannot delete message with attachments without content (#6378) 2023-02-02 11:03:19 -08:00
Nithin David ThomasandGitHub c9667190f6 fix: Increase font size for canned response list item (#6380) 2023-02-02 10:58:03 -08:00
Tejaswini ChileandGitHub 5cce04da78 Chore: specs for process_emails in message builder (#6379) 2023-02-02 18:36:52 +05:30
Divyansh SinghandGitHub 2030c2ebd6 fix: added cc and bcc email validation to message (#6320) 2023-02-02 17:32:04 +05:30
Tejaswini ChileandGitHub 2ab0b8552a fix: Identity JSON response header (#6326) 2023-02-02 11:01:18 +05:30
Sojan JoseandGitHub 2d245cef91 chore: Enable language icelandic(is) (#6373) 2023-02-01 09:43:29 -08:00
Vishnu NarayananandGitHub 992a367d93 fix: redis health status in superadmin panel (#6363) 2023-01-31 22:57:49 +05:30
Shivam MishraandGitHub e1e836cb59 chore: Run linters on staged files only (#6347)
- This PR speeds up the pre-commit hook to lint only the staged files instead of running it across all files as it does now.
2023-01-31 17:29:34 +05:30
4d92cafd3f feat: Order articles by updated_at (#6324)
* feat: Order articles by updated_at

* Sort before pagination

---------

Co-authored-by: Fayaz Ahmed <15716057+fayazara@users.noreply.github.com>
Co-authored-by: Vishnu Narayanan <vishnu@chatwoot.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
2023-01-31 17:28:14 +05:30
ee3124cf84 fix: Uses woot-button in mention box (#6317)
* fix: Uses woot-button in mention box

* Style changes to fix mention box position

* Fixes review comments

* Fixes review comments

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Vishnu Narayanan <vishnu@chatwoot.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-01-31 16:25:24 +05:30
Vishnu NarayananandGitHub b1af814eab feat: add chatwoot instance status in superadmin (#6045)
* feat: add chatwoot instance status in superadmin

* feat: add redis metrics to instance health page

* chore: fix rubocop

* chore: rescue redis no connection

* chore: add rspec

* chore: refactor

* feat: add instance health to /api

* chore: rescue postgres

* chore: fix spec
2023-01-30 18:37:51 +05:30
Nithin David ThomasandGitHub 747e6cacb9 fix: Fixes enter key sending text while mentions menu is active (#6359) 2023-01-30 16:59:22 +05:30
Muhsin KelothandGitHub 024af909e3 feat: Add support of variables in macros and automation (#6358) 2023-01-30 13:17:33 +05:30
Tejaswini ChileandGitHub 6013cc9bea fix: validate instagram story only while saving the message (#6340) 2023-01-30 13:03:59 +05:30
Pranav Raj SandGitHub 6bd4e8853b fix: Update styles for canned responses modal (#6350) 2023-01-25 19:11:54 -08:00
Pranav Raj SandGitHub 5d331f0bb2 fix: Add missing timestamp in the real-time event (#6349)
* fix: Add missing timestamp in the real-time event

* Fix broken specs
2023-01-25 15:21:41 -08:00
b1ec67d110 chore: upgrade ruby to 3.1.3 (#5555)
* chore: update to ruby 3.1.3

* chore: ping docker version to alpine3.16 for nodev16.x

Starting with Node 17, nodejs switched to OpenSSL3. The docker builds
are installing node18.xx with alpine-3.1.3.

From Node.js 17's announcement post:

    If you hit an ERR_OSSL_EVP_UNSUPPORTED error in your application
with Node.js 17, it’s likely that your application or a module you’re
using is attempting to use an algorithm or key size which is no longer
allowed by default with OpenSSL 3.0. A new command-line option,
--openssl-legacy-provider, has been added to revert to the legacy
provider as a temporary workaround for these tightened restrictions.

Looks like a webpack issue. This is fixed in webpacl 5+ and we are on
webpack4 at the moment.
Solutions

    Upgrade webpack.
    Pin nodejs version to be 16.x.x
    Use  --openssl-legacy-provider as a workaround.

Pin docker version to alpine3.16 branch to have node16.x by default

ref:
https://github.com/chatwoot/chatwoot/pull/5555#issuecomment-1379778532

* chore: update webmock

* chore: fix ruby gem path in dockerfile

* chore: switch to node16 in circleci

* chore: update ruby version in linux installer script

* chore: update ruby version in linux installer script

* chore: fix circleci

* chore: fix circleci

* feat: upgrade node version to 16.x in linux installer

* chore: update systemd files

Co-authored-by: Sojan Jose <sojan@chatwoot.com>
2023-01-24 23:55:07 +05:30
Fayaz AhmedandGitHub b196492f23 fix: Remove whatsapp formats which do we do not support yet (#6331)
- Filters out all the templates where formats are either of these ['DOCUMENT', 'IMAGE', 'VIDEO']
2023-01-24 18:45:39 +05:30
Muhsin KelothandGitHub d9a1154977 feat: Support variables in canned response (#6077)
- Added the option to insert variables in canned responses.
- Populate variables on selecting a canned response.
- Show a warning if there are any undefined variables in the message before sending a message.
2023-01-24 13:06:50 +05:30
cab409f3ef chore: Fixes grammatical errors with content on inbox page (#6308)
* Fixes #6307

- Typo fixed.
- Period added.

* Update app/javascript/dashboard/i18n/locale/en/inboxMgmt.json

Co-authored-by: Hricha Shandily <103104754+Hricha-Shandily@users.noreply.github.com>

Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Hricha Shandily <103104754+Hricha-Shandily@users.noreply.github.com>
2023-01-24 11:46:26 +05:30
Sivin VargheseandGitHub af5c71e060 chore: Adds the ability to see the existing filter when we apply a new filter (#6310)
* feat: Adds existing filter to advance filter modal when we apply a filter
2023-01-24 09:10:17 +05:30
Sivin VargheseandGitHub 9782f71bdf feat: Shows the last activity, created at timestamp in the same row (#6267) 2023-01-23 21:50:16 +05:30
487d90207b fix: Update node version in setup_20.04.sh (#5986)
Co-authored-by: Vishnu Narayanan <vishnu@chatwoot.com>
2023-01-23 16:34:45 +05:30
Tejaswini ChileandGitHub 551dd81d21 chore: change the execution flow for deleting the invalid instagram story (#6313)
* fix: change the execution flow for deleting the invalid instagram story

* fix: bundle audit update fix
2023-01-23 16:23:35 +05:30
Fayaz AhmedandGitHub 4deff9ce77 Break words in phones - iPhones etc (#6287) 2023-01-23 11:36:11 +05:30
Pranav Raj SandGitHub 3b1036e3d6 chore: Add an event for conversation filter (#6306) 2023-01-19 14:07:02 -08:00
Sivin VargheseandGitHub a745068473 chore: Adds a settings button to the notification settings from the notification popup (#6233) 2023-01-19 18:53:42 +05:30
Shivam MishraandGitHub 845311a539 chore: add stale PR bot (#6289)
The PR only adds the stale label and puts a comment, does not close them (yet)
2023-01-19 18:53:21 +05:30
Sojan JoseandGitHub e2ccac78d2 fix: Error when unsupported Whatsapp message status (#6295)
fixes error when unsupported WhatsApp message status
2023-01-19 18:52:38 +05:30
Shivam MishraandGitHub 1193cf1847 feat: ignore errors from extensions (#6297)
This PR ignores errors from chrome and safari extensions, and any local scripts by developers
2023-01-19 18:49:57 +05:30
fgrepandGitHub a86c2705e9 Fix: more events tracking for SaaS (#6234) (#6298) 2023-01-19 17:19:27 +05:30
Fayaz AhmedandGitHub 905fca7869 fix: Whatsapp template picker bug
- Enforce lowercasing the template status value before checking the value
2023-01-19 16:40:46 +05:30
Fayaz AhmedandGitHub 6151e42bdf Filter and return only approved templates (#6288) 2023-01-19 13:40:50 +05:30
Tejaswini ChileandGitHub 83ea2a87e2 Microsoft Re-authorization flow (#6268) 2023-01-19 01:06:01 +05:30
Prithvi TharunandGitHub 8d60bd9970 Fixes #3655 (#6264) 2023-01-18 14:45:37 +05:30
Shivam MishraandGitHub 37b9816827 feat: more events tracking for SaaS (#6234) 2023-01-17 21:53:40 -08:00
Pranav Raj SandGitHub 1df1b1f8e4 fix: Update the inbox id if changed (#6272) 2023-01-18 00:09:17 +05:30
Sojan 0b595211e3 Merge branch 'release/2.13.0' into develop 2023-01-17 18:20:54 +05:30
3493 changed files with 162405 additions and 45630 deletions
+40 -30
View File
@@ -7,17 +7,17 @@ defaults: &defaults
working_directory: ~/build
docker:
# specify the version you desire here
- image: cimg/ruby:3.0.4-browsers
- image: cimg/ruby:3.2.2-browsers
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
- image: cimg/postgres:14.1
- image: cimg/postgres:15.3
- image: cimg/redis:6.2.6
environment:
- RAILS_LOG_TO_STDOUT: false
- COVERAGE: true
- LOG_LEVEL: warn
- RAILS_LOG_TO_STDOUT: false
- COVERAGE: true
- LOG_LEVEL: warn
parallelism: 4
resource_class: large
@@ -38,6 +38,18 @@ jobs:
name: Which bundler?
command: bundle -v
- run:
name: Swap node versions
command: |
set +e
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
nvm install v20
echo 'export NVM_DIR="$HOME/.nvm"' >> $BASH_ENV
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
# Run bundler
# Load installed gems from cache if possible, bundle install then save cache
# Multiple caches are used to increase the chance of a cache hit
@@ -52,7 +64,6 @@ jobs:
- ~/.bundle
key: chatwoot-bundle-{{ .Environment.CACHE_VERSION }}-v20220524-{{ checksum "Gemfile.lock" }}
# Only necessary if app uses webpacker or yarn in some other way
- restore_cache:
keys:
@@ -61,7 +72,7 @@ jobs:
- run:
name: yarn
command: yarn install --cache-folder ~/.cache/yarn
command: yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
# Store yarn / webpacker cache
- save_cache:
@@ -70,7 +81,7 @@ jobs:
- ~/.cache/yarn
- run:
name: Download cc-test-reporter
name: Download cc-test-reporter
command: |
mkdir -p ~/tmp
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ~/tmp/cc-test-reporter
@@ -90,11 +101,10 @@ jobs:
echo "ERROR: The swagger.json file is not in sync with the yaml specification. Run 'rake swagger:build' and commit 'swagger/swagger.json'."
exit 1
fi
curl -L https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.3.0/openapi-generator-cli-5.3.0.jar > ~/tmp/openapi-generator-cli-5.3.0.jar
java -jar ~/tmp/openapi-generator-cli-5.3.0.jar validate -i swagger/swagger.json
curl -L https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.3.0/openapi-generator-cli-6.3.0.jar > ~/tmp/openapi-generator-cli-6.3.0.jar
java -jar ~/tmp/openapi-generator-cli-6.3.0.jar validate -i swagger/swagger.json
# Database setup
- run: yarn install --check-files
- run: bundle exec rake db:create
- run: bundle exec rake db:schema:load
@@ -105,7 +115,7 @@ jobs:
- run:
name: Rubocop
command: bundle exec rubocop
# - run:
# name: Brakeman
# command: bundle exec brakeman
@@ -114,6 +124,21 @@ jobs:
name: eslint
command: yarn run eslint
# Run frontend tests
- run:
name: Run frontend tests
command: |
mkdir -p ~/tmp/test-results/frontend_specs
~/tmp/cc-test-reporter before-build
TESTFILES=$(circleci tests glob **/specs/*.spec.js | circleci tests split --split-by=timings)
yarn test:coverage --profile 10 \
--out ~/tmp/test-results/yarn.xml \
-- ${TESTFILES}
- run:
name: Code Climate Test Coverage
command: |
~/tmp/cc-test-reporter format-coverage -t lcov -o "coverage/codeclimate.frontend_$CIRCLE_NODE_INDEX.json"
# Run rails tests
- run:
name: Run backend tests
@@ -133,20 +158,6 @@ jobs:
command: |
~/tmp/cc-test-reporter format-coverage -t simplecov -o "coverage/codeclimate.$CIRCLE_NODE_INDEX.json"
- run:
name: Run frontend tests
command: |
mkdir -p ~/tmp/test-results/frontend_specs
~/tmp/cc-test-reporter before-build
TESTFILES=$(circleci tests glob **/specs/*.spec.js | circleci tests split --split-by=timings)
yarn test:coverage --profile 10 \
--out ~/tmp/test-results/yarn.xml \
-- ${TESTFILES}
- run:
name: Code Climate Test Coverage
command: |
~/tmp/cc-test-reporter format-coverage -t lcov -o coverage/codeclimate.frontend_$CIRCLE_NODE_INDEX.json buildreports/lcov.info
- persist_to_workspace:
root: coverage
paths:
@@ -170,7 +181,7 @@ jobs:
- attach_workspace:
at: ~/build
- run:
name: Download cc-test-reporter
name: Download cc-test-reporter
command: |
mkdir -p ~/tmp
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ~/tmp/cc-test-reporter
@@ -192,5 +203,4 @@ workflows:
- build
- upload-coverage:
requires:
- build
- build
+1 -1
View File
@@ -2,7 +2,7 @@
# It has the dependencies already installed so that codespace will boot up fast
FROM ghcr.io/chatwoot/chatwoot_codespace:latest
# Do the set up required for chatwoot app
# Do the set up required for chatwoot app
WORKDIR /workspace
COPY . /workspace
RUN yarn && gem install bundler && bundle install
+14 -11
View File
@@ -1,10 +1,14 @@
ARG VARIANT=ubuntu-20.04
FROM mcr.microsoft.com/vscode/devcontainers/base:${VARIANT}
ARG VARIANT
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}
ARG NODE_VERSION
ARG RUBY_VERSION
ARG USER_UID
ARG USER_GID
# Update args in docker-compose.yaml to set the UID/GID of the "vscode" user.
ARG USER_UID=1000
ARG USER_GID=$USER_UID
RUN if [ "$USER_GID" != "1000" ] || [ "$USER_UID" != "1000" ]; then \
groupmod --gid $USER_GID vscode \
&& usermod --uid $USER_UID --gid $USER_GID vscode \
@@ -27,10 +31,10 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
tmux \
zsh \
git-flow \
npm
npm \
libyaml-dev
# Install rbenv and ruby
ARG RUBY_VERSION="3.0.4"
RUN git clone https://github.com/rbenv/rbenv.git ~/.rbenv \
&& echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc \
&& echo 'eval "$(rbenv init -)"' >> ~/.bashrc
@@ -46,7 +50,7 @@ RUN rbenv install $RUBY_VERSION && \
RUN curl -L https://github.com/DarthSim/overmind/releases/download/v2.1.0/overmind-v2.1.0-linux-amd64.gz > overmind.gz \
&& gunzip overmind.gz \
&& sudo mv overmind /usr/local/bin \
&& chmod +x /usr/local/bin/overmind
&& chmod +x /usr/local/bin/overmind
# Install gh
@@ -56,7 +60,7 @@ RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | s
&& sudo apt install gh
# Do the set up required for chatwoot app
# Do the set up required for chatwoot app
WORKDIR /workspace
COPY . /workspace
@@ -65,8 +69,7 @@ COPY Gemfile Gemfile.lock ./
RUN gem install bundler && bundle install
# set up node js
RUN npm install npm@latest -g && \
npm install n -g && \
n latest
RUN npm install n -g && \
n $NODE_VERSION
RUN npm install --global yarn
RUN yarn
+1 -1
View File
@@ -25,7 +25,7 @@
// 1025,8025 mailhog
"forwardPorts": [8025, 3000, 3035],
"postCreateCommand": ".devcontainer/scripts/setup.sh && bundle exec rake db:chatwoot_prepare && yarn",
"postCreateCommand": ".devcontainer/scripts/setup.sh && POSTGRES_STATEMENT_TIMEOUT=600s bundle exec rake db:chatwoot_prepare && yarn",
"portsAttributes": {
"3000": {
"label": "Rails Server"
+23 -13
View File
@@ -1,30 +1,41 @@
# https://github.com/microsoft/vscode-dev-containers/blob/master/containers/python-3-postgres/.devcontainer/docker-compose.yml
# https://github.com/microsoft/vscode-dev-containers/blob/master/containers/ruby-rails/.devcontainer/devcontainer.json
#
#
version: '3'
services:
app:
base:
build:
context: ..
dockerfile: .devcontainer/Dockerfile.base
args:
VARIANT: "ubuntu-22.04"
NODE_VERSION: "20.9.0"
RUBY_VERSION: "3.2.2"
# On Linux, you may need to update USER_UID and USER_GID below if not your local UID is not 1000.
USER_UID: "1000"
USER_GID: "1000"
image: base:latest
app:
build:
context: ..
dockerfile: .devcontainer/Dockerfile
args:
# Update 'VARIANT' to pick a Ruby version: https://github.com/microsoft/vscode-dev-containers/tree/main/containers/ruby
VARIANT: 3
# [Choice] Install Node.js
INSTALL_NODE: "true"
NODE_VERSION: "lts/*"
VARIANT: "ubuntu-22.04"
NODE_VERSION: "20.9.0"
RUBY_VERSION: "3.2.2"
# On Linux, you may need to update USER_UID and USER_GID below if not your local UID is not 1000.
USER_UID: 1000
USER_GID: 1000
USER_UID: "1000"
USER_GID: "1000"
volumes:
- ..:/workspace:cached
# Overrides default command so things don't shut down after the process ends.
command: sleep infinity
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
network_mode: service:db
@@ -49,8 +60,7 @@ services:
restart: unless-stopped
image: mailhog/mailhog
network_mode: service:db
volumes:
postgres-data:
redis-data:
-3
View File
@@ -1,8 +1,6 @@
.bundle
.env
.env.*
.git
.gitignore
docker-compose.*
docker/Dockerfile
docker/dockerfiles
@@ -11,7 +9,6 @@ storage
public/system
tmp
.codeclimate.yml
public/assets
public/packs
node_modules
vendor/bundle
+46 -9
View File
@@ -52,6 +52,8 @@ POSTGRES_HOST=postgres
POSTGRES_USERNAME=postgres
POSTGRES_PASSWORD=
RAILS_ENV=development
# Changes the Postgres query timeout limit. The default is 14 seconds. Modify only when required.
# POSTGRES_STATEMENT_TIMEOUT=14s
RAILS_MAX_THREADS=5
# The email from which all outgoing emails are sent
@@ -79,7 +81,7 @@ SMTP_OPENSSL_VERIFY_MODE=peer
# Mail Incoming
# This is the domain set for the reply emails when conversation continuity is enabled
MAILER_INBOUND_EMAIL_DOMAIN=
# Set this to appropriate ingress channel with regards to incoming emails
# Set this to the appropriate ingress channel with regards to incoming emails
# Possible values are :
# relay for Exim, Postfix, Qmail
# mailgun for Mailgun
@@ -89,10 +91,20 @@ MAILER_INBOUND_EMAIL_DOMAIN=
RAILS_INBOUND_EMAIL_SERVICE=
# Use one of the following based on the email ingress service
# Ref: https://edgeguides.rubyonrails.org/action_mailbox_basics.html
# Set this to a password of your choice and use it in the Inbound webhook
RAILS_INBOUND_EMAIL_PASSWORD=
MAILGUN_INGRESS_SIGNING_KEY=
MANDRILL_INGRESS_API_KEY=
# Creating Your Inbound Webhook Instructions for Postmark and Sendgrid:
# Inbound webhook URL format:
# https://actionmailbox:[YOUR_RAILS_INBOUND_EMAIL_PASSWORD]@[YOUR_CHATWOOT_DOMAIN.COM]/rails/action_mailbox/[RAILS_INBOUND_EMAIL_SERVICE]/inbound_emails
# Note: Replace the values inside the brackets; do not include the brackets themselves.
# Example: https://actionmailbox:mYRandomPassword3@chatwoot.example.com/rails/action_mailbox/postmark/inbound_emails
# For Postmark
# Ensure the 'Include raw email content in JSON payload' checkbox is selected in the inbound webhook section.
# Storage
ACTIVE_STORAGE_SERVICE=local
@@ -108,6 +120,8 @@ AWS_REGION=
RAILS_LOG_TO_STDOUT=true
LOG_LEVEL=info
LOG_SIZE=500
# Configure this environment variable if you want to use lograge instead of rails logger
#LOGRAGE_ENABLED=true
### This environment variables are only required if you are setting up social media channels
@@ -131,6 +145,11 @@ TWITTER_ENVIRONMENT=
SLACK_CLIENT_ID=
SLACK_CLIENT_SECRET=
# Google OAuth
GOOGLE_OAUTH_CLIENT_ID=
GOOGLE_OAUTH_CLIENT_SECRET=
GOOGLE_OAUTH_CALLBACK_URL=
### Change this env variable only if you are using a custom build mobile app
## Mobile app env variables
IOS_APP_ID=L7YLMN4634.com.chatwoot.app
@@ -152,9 +171,6 @@ ANDROID_SHA256_CERT_FINGERPRINT=AC:73:8E:DE:EB:56:EA:CC:10:87:02:A7:65:37:7B:38:
# for mobile apps
# FCM_SERVER_KEY=
## Bot Customizations
USE_INBOX_AVATAR_FOR_BOT=true
### APM and Error Monitoring configurations
## Elastic APM
## https://www.elastic.co/guide/en/apm/agent/ruby/current/getting-started-rails.html
@@ -164,6 +180,15 @@ USE_INBOX_AVATAR_FOR_BOT=true
## Sentry
# SENTRY_DSN=
## LogRocket
# LOG_ROCKET_PROJECT_ID=xxxxx/some-project
# MICROSOFT CLARITY
# MS_CLARITY_TOKEN=xxxxxxxxx
# GOOGLE_TAG_MANAGER
# GOOGLE_TAG = GTM-XXXXXXX
## Scout
## https://scoutapm.com/docs/ruby/configuration
# SCOUT_KEY=YOURKEY
@@ -181,16 +206,14 @@ USE_INBOX_AVATAR_FOR_BOT=true
## https://github.com/DataDog/dd-trace-rb/blob/master/docs/GettingStarted.md#environment-variables
# DD_TRACE_AGENT_URL=
## IP look up configuration
## ref https://github.com/alexreisner/geocoder/blob/master/README_API_GUIDE.md
## works only on accounts with ip look up feature enabled
# IP_LOOKUP_SERVICE=geoip2
# maxmindb api key to use geoip2 service
# MaxMindDB API key to download GeoLite2 City database
# IP_LOOKUP_API_KEY=
## Rack Attack configuration
## To prevent and throttle abusive requests
# ENABLE_RACK_ATTACK=true
# RACK_ATTACK_LIMIT=300
# ENABLE_RACK_ATTACK_WIDGET_API=true
## Running chatwoot as an API only server
## setting this value to true will disable the frontend dashboard endpoints
@@ -222,3 +245,17 @@ AZURE_APP_SECRET=
## Change these values to fine tune performance
# control the concurrency setting of sidekiq
# SIDEKIQ_CONCURRENCY=10
# AI powered features
## OpenAI key
# OPENAI_API_KEY=
# Sentiment analysis model file path
SENTIMENT_FILE_PATH=
# Housekeeping/Performance related configurations
# Set to true if you want to remove stale contact inboxes
# contact_inboxes with no conversation older than 90 days will be removed
# REMOVE_STALE_CONTACT_INBOX_JOB_STATUS=false
+8 -3
View File
@@ -4,9 +4,10 @@ module.exports = {
'prettier',
'plugin:vue/recommended',
'plugin:storybook/recommended',
'plugin:cypress/recommended',
],
parserOptions: {
parser: 'babel-eslint',
parser: '@babel/eslint-parser',
ecmaVersion: 2020,
sourceType: 'module',
},
@@ -24,13 +25,16 @@ module.exports = {
'jsx-a11y/label-has-for': 'off',
'jsx-a11y/anchor-is-valid': 'off',
'import/no-unresolved': 'off',
'vue/html-indent': 'off',
'vue/multi-word-component-names': 'off',
'vue/max-attributes-per-line': [
'error',
{
singleline: 20,
singleline: {
max: 20,
},
multiline: {
max: 1,
allowFirstLine: false,
},
},
],
@@ -47,6 +51,7 @@ module.exports = {
},
],
'vue/no-v-html': 'off',
'vue/component-definition-name-casing': 'off',
'vue/singleline-html-element-content-newline': 'off',
'import/extensions': ['off'],
'no-console': 'error',
-78
View File
@@ -1,78 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: 'Bug'
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See the error
**Expected behavior**
Share a clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Browser logs**
Share the browser logs to debug the issue further.
**Server logs**
Share the server logs to debug the issue further.
**Environment**
Describe whether you are using Chatwoot Cloud (app.chatwoot.com) or a self-hosted installation of Chatwoot. If you are using a self-hosted installation of Chatwoot, describe the type of deployment (Docker/Linux VM installation/Heroku/Kubernetes/Other).
- [ ] app.chatwoot.com (Chatwoot Cloud)
- [ ] Self-hosted
- - [ ] Linux VM
- - [ ] Docker
- - [ ] Kubernetes
- - [ ] Heroku
- - [ ] Other (Please specify)
**Desktop (please complete the following information)** (If applicable)
- OS: [e.g. Linux, Windows, MacOS]
- Browser [e.g. chrome, firefox, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information)** (If applicable)
- Device: [e.g. iPhone6, Pixel7]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, firefox, safari]
- Version [e.g. 22]
**Docker** (If applicable)
Please share the output of the following.
- `docker version`
- `docker info`
- `docker-compose version`
**Cloud Provider** (If applicable)
- [ ] AWS
- [ ] GCP
- [ ] Azure
- [ ] DigitalOcean
- [ ] Others
**Additional context**
Add any other context about the problem here.
+78
View File
@@ -0,0 +1,78 @@
name: 🐞 Bug report
description: Create a report to help us improve
labels: 'Bug'
body:
- type: textarea
attributes:
label: Describe the bug
description: A concise description of what you expected to happen along with screenshots if applicable.
validations:
required: true
- type: textarea
attributes:
label: To Reproduce
description: Steps to reproduce the behavior.
placeholder: |
1. In this environment...
2. With this config...
3. Run '...'
4. See error...
validations:
required: true
- type: textarea
attributes:
label: Expected behavior
description: A concise description of what you expected to happen.
- type: dropdown
id: environment
attributes:
label: Environment
description: Describe whether you are using Chatwoot Cloud (app.chatwoot.com) or a self-hosted installation of Chatwoot. If you are using a self-hosted installation of Chatwoot, describe the type of deployment (Docker/Linux VM installation/Heroku/Kubernetes/Other).
options:
- app.chatwoot.com
- Linux VM
- Docker
- Kubernetes
- Heroku
- Other [please specify in the description]
validations:
required: true
- type: dropdown
id: provider
attributes:
label: Cloud Provider
description:
options:
- AWS
- GCP
- Azure
- DigitalOcean
- Other [please specify in the description]
- type: dropdown
id: platform
attributes:
label: Platform
description: Describe the platform you are using
options:
- Browser
- Mobile
- type: input
attributes:
label: Operating system
description: The operating system and the version you are using.
- type: input
attributes:
label: Browser and version
description: The name of the browser and version you are using.
- type: textarea
attributes:
label: Docker (if applicable)
description: |
Please share the output of the following.
- `docker version`
- `docker info`
- `docker-compose version`
- type: textarea
attributes:
label: Additional context
description: Add any other context about the problem here.
+8
View File
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Report a security issue
url: https://www.chatwoot.com/docs/contributing-guide/security-reports/
about: Guidelines and steps to report a security vulnerability. Please report security vulnerabilities here.
- name: Product Documentation
url: https://www.chatwoot.com/help-center
about: If you have questions, are confused, or just want to understand our product better, please check out our documentation.
@@ -1,20 +0,0 @@
---
name: Enhancement request
about: Suggest any enhancements for this project
title: ''
labels: ''
assignees: ''
---
**Is your enhancement request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions you've considered.
**Additional context**
Add any other context or screenshots about the enhancement request here.
-20
View File
@@ -1,20 +0,0 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
@@ -0,0 +1,28 @@
name: 🧙 Feature request
description: Suggest an idea for this project
labels: 'feature-request'
body:
- type: textarea
attributes:
label: Is your feature or enhancement related to a problem? Please describe.
description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
validations:
required: true
- type: textarea
attributes:
label: Describe the solution you'd like
description: A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
attributes:
label: Describe alternatives you've considered
description: A clear and concise description of any alternative solutions or features you've considered.
validations:
required: false
- type: textarea
attributes:
label: Additional context
description: Add any other context or screenshots about the feature request here.
validations:
required: false
+23
View File
@@ -0,0 +1,23 @@
# ref: https://github.com/amannn/action-semantic-pull-request
# ensure PR title is in semantic format
name: "Lint PR"
on:
pull_request_target:
types:
- opened
- edited
- synchronize
permissions:
pull-requests: read
jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+1
View File
@@ -19,6 +19,7 @@ concurrency:
jobs:
action:
runs-on: ubuntu-latest
if: ${{ github.repository == 'chatwoot/chatwoot' }}
steps:
- uses: dessant/lock-threads@v3
with:
@@ -0,0 +1,55 @@
name: Log Lines Percentage Check
on:
pull_request:
branches:
- develop
jobs:
log_lines_check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Check for log lines and calculate percentage
run: |
# Define the log line pattern
LOG_LINE_PATTERN="Rails\.logger"
# Get the list of changed files in the pull request
CHANGED_FILES=$(git diff --name-only)
# Initialize a flag to track if any files have insufficient log lines
INSUFFICIENT_LOGS=0
for file in $CHANGED_FILES; do
if [[ $file =~ \.rb$ && ! $file =~ _spec\.rb$ ]]; then
# Count the total number of lines in the file
total_lines=$(wc -l < "$file")
# Count the number of log lines in the file
log_lines=$(grep -c "$LOG_LINE_PATTERN" "$file")
# Calculate the percentage of log lines
if [ "$total_lines" -gt 0 ]; then
percentage=$(awk "BEGIN { pc=100*${log_lines}/${total_lines}; i=int(pc); print (pc-i<0.5)?i:i+1 }")
else
percentage=0
fi
# Check if the percentage is less than 5%
if [ "$percentage" -lt 5 ]; then
echo "Error: Log lines percentage is less than 5% ($percentage%) in $file. Please add more log lines using Rails.logger statements."
INSUFFICIENT_LOGS=1
else
echo "Log lines percentage is $percentage% in $file. Code looks good!"
fi
fi
done
# If any files have insufficient log lines, fail the action
if [ "$INSUFFICIENT_LOGS" -eq 1 ]; then
exit 1
fi
+6
View File
@@ -44,3 +44,9 @@ jobs:
# sudo systemctl restart chatwoot.target
# curl http://localhost:3000/api
- name: Upload chatwoot setup log file as an artifact
uses: actions/upload-artifact@v3
if: always()
with:
name: chatwoot-setup-log-file
path: /var/log/chatwoot-setup.log
@@ -19,5 +19,6 @@ jobs:
- name: Build the Codespace Base Image
run: |
docker build . -t ghcr.io/chatwoot/chatwoot_codespace:latest -f .devcontainer/Dockerfile.base
docker-compose -f .devcontainer/docker-compose.yml build base
docker tag base:latest ghcr.io/chatwoot/chatwoot_codespace:latest
docker push ghcr.io/chatwoot/chatwoot_codespace:latest
+17 -3
View File
@@ -15,14 +15,15 @@ on:
jobs:
test:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
services:
postgres:
image: postgres:10.8
image: postgres:15.3
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ""
POSTGRES_DB: postgres
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
@@ -47,9 +48,13 @@ jobs:
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.4 # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- uses: actions/setup-node@v3
with:
node-version: 20
cache: yarn
- name: yarn
run: yarn install
@@ -71,3 +76,12 @@ jobs:
- name: Run backend tests
run: |
bundle exec rspec --profile=10 --format documentation
env:
NODE_OPTIONS: --openssl-legacy-provider
- name: Upload rails log folder
uses: actions/upload-artifact@v3
if: always()
with:
name: rails-log-folder
path: log
@@ -0,0 +1,84 @@
# #
# # This workflow will run specs related to response bot
# # This can only be activated in installations Where vector extension is available.
# #
name: Run Response Bot spec
on:
push:
branches:
- develop
- master
pull_request:
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-20.04
services:
postgres:
image: ankane/pgvector
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ""
POSTGRES_DB: postgres
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
# tmpfs makes DB faster by using RAM
options: >-
--mount type=tmpfs,destination=/var/lib/postgresql/data
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis
ports:
- 6379:6379
options: --entrypoint redis-server
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- uses: actions/setup-node@v3
with:
node-version: 20
cache: yarn
- name: yarn
run: yarn install
- name: Create database
run: bundle exec rake db:create
- name: Seed database
run: bundle exec rake db:schema:load
- name: Enable ResponseBotService in installation
run: RAILS_ENV=test bundle exec rails runner "Features::ResponseBotService.new.enable_in_installation"
# Run Response Bot specs
- name: Run backend tests
run: |
bundle exec rspec \
spec/enterprise/controllers/api/v1/accounts/response_sources_controller_spec.rb \
spec/enterprise/services/enterprise/message_templates/response_bot_service_spec.rb \
spec/enterprise/controllers/enterprise/api/v1/accounts/inboxes_controller_spec.rb:47 \
--profile=10 \
--format documentation
- name: Upload rails log folder
uses: actions/upload-artifact@v3
if: always()
with:
name: rails-log-folder
path: log
+41
View File
@@ -0,0 +1,41 @@
name: Run Size Limit Check
on:
pull_request:
branches:
- develop
jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- uses: actions/setup-node@v3
with:
node-version: 20
cache: 'yarn'
- name: yarn
run: yarn install
- name: Strip enterprise code
run: |
rm -rf enterprise
rm -rf spec/enterprise
- name: Run asset compile
run: bundle exec rake assets:precompile
env:
NODE_OPTIONS: --openssl-legacy-provider
- name: Size Check
run: yarn run size
+28
View File
@@ -0,0 +1,28 @@
# This workflow warns and then closes PRs that have had no activity for a specified amount of time.
#
# You can adjust the behavior by modifying this file.
# For more information, see:
# https://github.com/actions/stale
name: Mark stale issues and pull requests
on:
schedule:
- cron: '28 3 * * *'
jobs:
stale:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/stale@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-issue-close: -1,
days-before-issue-stale: -1
days-before-pr-close: -1,
days-before-pr-stale: 30,
stale-pr-message: '🐢 Turtley slow progress alert! This pull request has been idle for over 30 days. Can we please speed things up and either merge it or release it back into the wild?'
stale-pr-label: 'stale'
+15 -1
View File
@@ -61,4 +61,18 @@ test/cypress/videos/*
/config/master.key
/config/*.enc
.vscode/settings.json
#ignore files under .vscode directory
.vscode
# yalc for local testing
.yalc
yalc.lock
/public/packs
/public/packs-test
/node_modules
/yarn-error.log
yarn-debug.log*
.yarn-integrity
/storybook-static
+9 -3
View File
@@ -1,5 +1,11 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npm run eslint
bundle exec rubocop -a
git add
# lint js and vue files
npx --no-install lint-staged
# lint only staged ruby files
git diff --name-only --cached | xargs ls -1 2>/dev/null | grep '\.rb$' | xargs bundle exec rubocop --force-exclusion -a
# stage rubocop changes to files
git diff --name-only --cached | xargs git add
+1 -1
View File
@@ -1 +1 @@
14.17.4
20.5.1
+37 -9
View File
@@ -8,16 +8,11 @@ Layout/LineLength:
Max: 150
Metrics/ClassLength:
Max: 125
Max: 175
Exclude:
- 'app/models/conversation.rb'
- 'app/models/contact.rb'
- 'app/mailers/conversation_reply_mailer.rb'
- 'app/models/message.rb'
- 'app/builders/messages/facebook/message_builder.rb'
- 'app/controllers/api/v1/accounts/contacts_controller.rb'
- 'app/listeners/action_cable_listener.rb'
- 'app/models/conversation.rb'
RSpec/ExampleLength:
Max: 25
Style/Documentation:
@@ -63,6 +58,7 @@ Metrics/BlockLength:
Metrics/ModuleLength:
Exclude:
- lib/seeders/message_seeder.rb
- spec/support/slack_stubs.rb
Rails/ApplicationController:
Exclude:
- 'app/controllers/api/v1/widget/messages_controller.rb'
@@ -72,6 +68,10 @@ Rails/ApplicationController:
- 'app/controllers/platform_controller.rb'
- 'app/controllers/public_controller.rb'
- 'app/controllers/survey/responses_controller.rb'
Rails/FindEach:
Enabled: true
Include:
- 'app/**/*.rb'
Rails/CompactBlank:
Enabled: false
Rails/EnvironmentVariableAccess:
@@ -84,8 +84,13 @@ Style/ClassAndModuleChildren:
EnforcedStyle: compact
Exclude:
- 'config/application.rb'
- 'config/initializers/monkey_patches/*'
Style/MapToHash:
Enabled: false
Style/HashSyntax:
Enabled: true
EnforcedStyle: no_mixed_keys
EnforcedShorthandSyntax: never
RSpec/NestedGroups:
Enabled: true
Max: 4
@@ -155,11 +160,35 @@ Rails/RenderInline:
Performance/CollectionLiteralInLoop:
Exclude:
- 'db/migrate/20210315101919_enable_email_channel.rb'
Rails/ThreeStateBooleanColumn:
Exclude:
- 'db/migrate/20200509044639_add_hide_input_flag_to_bot_config.rb'
- 'db/migrate/20200605130625_agent_away_message_to_auto_reply.rb'
- 'db/migrate/20200606132552_create_labels.rb'
- 'db/migrate/20201027135006_create_working_hours.rb'
- 'db/migrate/20210112174124_add_hmac_token_to_inbox.rb'
- 'db/migrate/20210114202310_create_teams.rb'
- 'db/migrate/20210212154240_add_request_for_email_on_channel_web_widget.rb'
- 'db/migrate/20210428135041_add_campaigns.rb'
- 'db/migrate/20210602182058_add_hmac_to_api_channel.rb'
- 'db/migrate/20210609133433_add_email_collect_to_inboxes.rb'
- 'db/migrate/20210618095823_add_csat_toggle_for_inbox.rb'
- 'db/migrate/20210927062350_add_trigger_only_during_business_hours_collect_to_campaigns.rb'
- 'db/migrate/20211027073553_add_imap_smtp_config_to_channel_email.rb'
- 'db/migrate/20211109143122_add_tweet_enabled_flag_to_twitter_channel.rb'
- 'db/migrate/20211216110209_add_allow_messages_after_resolved_to_inbox.rb'
- 'db/migrate/20220116103902_add_open_ssl_verify_mode_to_channel_email.rb'
- 'db/migrate/20220216151613_add_open_all_day_to_working_hour.rb'
- 'db/migrate/20220511072655_add_archive_column_to_portal.rb'
- 'db/migrate/20230503101201_create_sla_policies.rb'
RSpec/IndexedLet:
Enabled: false
RSpec/NamedSubject:
Enabled: false
# we should bring this down
RSpec/MultipleMemoizedHelpers:
Max: 12
Max: 14
AllCops:
NewCops: enable
@@ -184,4 +213,3 @@ AllCops:
- db/migrate/20200927135222_add_last_activity_at_to_conversation.rb
- db/migrate/20210306170117_add_last_activity_at_to_contacts.rb
- db/migrate/20220809104508_revert_cascading_indexes.rb
-1
View File
@@ -68,7 +68,6 @@ Naming/AccessorMethodName:
- 'app/controllers/api/v1/accounts_controller.rb'
- 'app/controllers/api/v1/callbacks_controller.rb'
- 'app/controllers/api/v1/conversations_controller.rb'
- 'app/controllers/passwords_controller.rb'
# Offense count: 9
# Configuration parameters: EnforcedStyleForLeadingUnderscores.
+1 -1
View File
@@ -1 +1 @@
3.0.4
3.2.2
+1
View File
@@ -0,0 +1 @@
/spec
+13 -1
View File
@@ -23,6 +23,18 @@ module.exports = {
},
'@storybook/addon-links',
'@storybook/addon-essentials',
{
/**
* Fix Storybook issue with PostCSS@8
* @see https://github.com/storybookjs/storybook/issues/12668#issuecomment-773958085
*/
name: '@storybook/addon-postcss',
options: {
postcssLoaderOptions: {
implementation: require('postcss'),
},
},
},
],
webpackFinal: config => {
const newConfig = {
@@ -35,7 +47,7 @@ module.exports = {
newConfig.module.rules.push({
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader'],
use: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader'],
include: path.resolve(__dirname, '../app/javascript'),
});
+4
View File
@@ -4,10 +4,12 @@ import Vuex from 'vuex';
import VueI18n from 'vue-i18n';
import Vuelidate from 'vuelidate';
import Multiselect from 'vue-multiselect';
import VueDOMPurifyHTML from 'vue-dompurify-html';
import FluentIcon from 'shared/components/FluentIcon/DashboardIcon';
import WootUiKit from '../app/javascript/dashboard/components';
import i18n from '../app/javascript/dashboard/i18n';
import { domPurifyConfig } from 'shared/helpers/HTMLSanitizer';
import '../app/javascript/dashboard/assets/scss/storybook.scss';
@@ -15,6 +17,8 @@ Vue.use(VueI18n);
Vue.use(Vuelidate);
Vue.use(WootUiKit);
Vue.use(Vuex);
Vue.use(VueDOMPurifyHTML, domPurifyConfig);
Vue.component('multiselect', Multiselect);
Vue.component('fluent-icon', FluentIcon);
+6 -1
View File
@@ -1 +1,6 @@
{}
{
"cSpell.words": [
"chatwoot",
"dompurify"
]
}
+81 -33
View File
@@ -1,10 +1,10 @@
source 'https://rubygems.org'
ruby '3.0.4'
ruby '3.2.2'
##-- base gems for rails --##
gem 'rack-cors', require: 'rack/cors'
gem 'rails', '~> 6.1', '>= 6.1.6.1'
gem 'rails', '~> 7.0.8.0'
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', require: false
@@ -15,7 +15,7 @@ gem 'browser'
gem 'hashie'
gem 'jbuilder'
gem 'kaminari'
gem 'responders'
gem 'responders', '>= 3.1.1'
gem 'rest-client'
gem 'telephone_number'
gem 'time_diff'
@@ -34,17 +34,21 @@ gem 'commonmarker'
# Validate Data against JSON Schema
gem 'json_schemer'
# Rack middleware for blocking & throttling abusive requests
gem 'rack-attack'
gem 'rack-attack', '>= 6.7.0'
# a utility tool for streaming, flexible and safe downloading of remote files
gem 'down', '~> 5.0'
gem 'down'
# authentication type to fetch and send mail over oauth2.0
gem 'gmail_xoauth'
# Prevent CSV injection
gem 'csv-safe'
##-- for active storage --##
gem 'aws-sdk-s3', require: false
gem 'azure-storage-blob', require: false
# original gem isn't maintained actively
# we wanted updated version of faraday which is a dependency for slack-ruby-client
gem 'azure-storage-blob', git: 'https://github.com/chatwoot/azure-storage-ruby', branch: 'chatwoot', require: false
gem 'google-cloud-storage', require: false
gem 'image_processing', '~> 1.12.2'
gem 'image_processing'
##-- gems for database --#
gem 'groupdate'
@@ -58,56 +62,65 @@ gem 'activerecord-import'
gem 'dotenv-rails'
gem 'foreman'
gem 'puma'
gem 'webpacker', '~> 5.4', '>= 5.4.3'
gem 'webpacker'
# metrics on heroku
gem 'barnes'
##--- gems for authentication & authorization ---##
gem 'devise'
gem 'devise-secure_password', '~> 2.0', git: 'https://github.com/chatwoot/devise-secure_password'
gem 'devise', '>= 4.9.3'
gem 'devise-secure_password', git: 'https://github.com/chatwoot/devise-secure_password', branch: 'chatwoot'
gem 'devise_token_auth'
# authorization
gem 'jwt'
gem 'pundit'
# super admin
gem 'administrate'
gem 'administrate', '>= 0.19.0'
gem 'administrate-field-active_storage', '>= 1.0.1'
gem 'administrate-field-belongs_to_search', '>= 0.9.0'
##--- gems for pubsub service ---##
# https://karolgalanciak.com/blog/2019/11/30/from-activerecord-callbacks-to-publish-slash-subscribe-pattern-and-event-driven-design/
gem 'wisper', '2.0.0'
##--- gems for channels ---##
# TODO: bump up gem to 2.0
gem 'facebook-messenger'
gem 'line-bot-api'
gem 'twilio-ruby', '~> 5.66'
# twitty will handle subscription of twitter account events
# gem 'twitty', git: 'https://github.com/chatwoot/twitty'
gem 'twitty'
gem 'twitty', '~> 0.1.5'
# facebook client
gem 'koala'
# slack client
gem 'slack-ruby-client'
gem 'slack-ruby-client', '~> 2.2.0'
# for dialogflow integrations
gem 'google-cloud-dialogflow'
gem 'google-cloud-dialogflow-v2'
gem 'grpc'
# Translate integrations
# 'google-cloud-translate' gem depends on faraday 2.0 version
# this dependency breaks the slack-ruby-client gem
gem 'google-cloud-translate-v3'
##-- apm and error monitoring ---#
gem 'ddtrace'
gem 'elastic-apm'
gem 'newrelic_rpm'
gem 'scout_apm'
gem 'sentry-rails', '~> 5.3', '>= 5.3.1'
gem 'sentry-ruby', '~> 5.3'
gem 'sentry-sidekiq', '~> 5.3'
# loaded only when environment variables are set.
# ref application.rb
gem 'ddtrace', require: false
gem 'elastic-apm', require: false
gem 'newrelic_rpm', require: false
gem 'newrelic-sidekiq-metrics', '>= 1.6.2', require: false
gem 'scout_apm', require: false
gem 'sentry-rails', '>= 5.14.0', require: false
gem 'sentry-ruby', require: false
gem 'sentry-sidekiq', '>= 5.14.0', require: false
##-- background job processing --##
gem 'sidekiq', '~> 6.4.0'
gem 'sidekiq', '>= 7.2.1'
# We want cron jobs
gem 'sidekiq-cron', '~> 1.3'
gem 'sidekiq-cron', '>= 1.12.0'
##-- Push notification service --##
gem 'fcm'
gem 'webpush'
gem 'web-push'
##-- geocoding / parse location from ip --##
# http://www.rubygeocoder.com/
@@ -122,7 +135,10 @@ gem 'procore-sift'
# parse email
gem 'email_reply_trimmer'
gem 'html2text'
# TODO: we might have to fork this gem since 0.3.1 has hard depency on nokogir 1.10.
# and this gem hasn't been updated for a while.
gem 'html2text', git: 'https://github.com/chatwoot/html2text_ruby', branch: 'chatwoot'
# to calculate working hours
gem 'working_hours'
@@ -137,7 +153,33 @@ gem 'stripe'
## to populate db with sample data
gem 'faker'
group :production, :staging do
# Include logrange conditionally in intializer using env variable
gem 'lograge', '~> 0.14.0', require: false
# worked with microsoft refresh token
gem 'omniauth-oauth2'
gem 'audited', '~> 5.4', '>= 5.4.1'
# need for google auth
gem 'omniauth', '>= 2.1.2'
gem 'omniauth-google-oauth2'
gem 'omniauth-rails_csrf_protection', '~> 1.0'
## Gems for reponse bot
# adds cosine similarity to postgres using vector extension
gem 'neighbor'
gem 'pgvector'
# Convert Website HTML to Markdown
gem 'reverse_markdown'
# Sentiment analysis
gem 'informers'
### Gems required only in specific deployment environments ###
##############################################################
group :production do
# we dont want request timing out in development while using byebug
gem 'rack-timeout'
end
@@ -146,18 +188,25 @@ group :development do
gem 'annotate'
gem 'bullet'
gem 'letter_opener'
gem 'web-console'
gem 'scss_lint', require: false
gem 'web-console', '>= 4.2.1'
# used in swagger build
gem 'json_refs'
# When we want to squash migrations
gem 'squasher'
# profiling
gem 'rack-mini-profiler', '>= 3.2.0', require: false
gem 'stackprof'
# Should install the associated chrome extension to view query logs
gem 'meta_request'
end
group :test do
# Cypress in rails.
gem 'cypress-on-rails', '~> 1.0'
gem 'cypress-on-rails'
# fast cleaning of database
gem 'database_cleaner'
# mock http calls
@@ -174,12 +223,13 @@ group :development, :test do
gem 'bundle-audit', require: false
gem 'byebug', platform: :mri
gem 'climate_control'
gem 'factory_bot_rails'
gem 'debug', '~> 1.8'
gem 'factory_bot_rails', '>= 6.4.3'
gem 'listen'
gem 'mock_redis'
gem 'pry-rails'
gem 'rspec_junit_formatter'
gem 'rspec-rails', '~> 5.0.3'
gem 'rspec-rails'
gem 'rubocop', require: false
gem 'rubocop-performance', require: false
gem 'rubocop-rails', require: false
@@ -190,5 +240,3 @@ group :development, :test do
gem 'spring'
gem 'spring-watcher-listen'
end
# worked with microsoft refresh token
gem 'omniauth-oauth2'
+490 -357
View File
File diff suppressed because it is too large Load Diff
+52
View File
@@ -0,0 +1,52 @@
# Variables
APP_NAME := chatwoot
RAILS_ENV ?= development
# Targets
setup:
gem install bundler
bundle install
yarn install
db_create:
RAILS_ENV=$(RAILS_ENV) bundle exec rails db:create
db_migrate:
RAILS_ENV=$(RAILS_ENV) bundle exec rails db:migrate
db_seed:
RAILS_ENV=$(RAILS_ENV) bundle exec rails db:seed
db:
RAILS_ENV=$(RAILS_ENV) bundle exec rails db:chatwoot_prepare
console:
RAILS_ENV=$(RAILS_ENV) bundle exec rails console
server:
RAILS_ENV=$(RAILS_ENV) bundle exec rails server -b 0.0.0.0 -p 3000
burn:
bundle && yarn
run:
@if [ -f ./.overmind.sock ]; then \
echo "Overmind is already running. Use 'make force_run' to start a new instance."; \
else \
overmind start -f Procfile.dev; \
fi
force_run:
rm -f ./.overmind.sock
overmind start -f Procfile.dev
debug:
overmind connect backend
debug_worker:
overmind connect worker
docker:
docker build -t $(APP_NAME) -f ./docker/Dockerfile .
.PHONY: setup db_create db_migrate db_seed db console server burn docker run force_run debug debug_worker
+3 -3
View File
@@ -1,3 +1,3 @@
release: bundle exec rails db:chatwoot_prepare
web: bin/rails server -p $PORT -e $RAILS_ENV
worker: bundle exec sidekiq -C config/sidekiq.yml
release: POSTGRES_STATEMENT_TIMEOUT=600s bundle exec rails db:chatwoot_prepare && echo $SOURCE_VERSION > .git_sha
web: bundle exec rails ip_lookup:setup && bin/rails server -p $PORT -e $RAILS_ENV
worker: bundle exec rails ip_lookup:setup && bundle exec sidekiq -C config/sidekiq.yml
+1 -1
View File
@@ -1,4 +1,4 @@
backend: bin/rails s -p 3000
frontend: bin/webpack-dev-server
frontend: export NODE_OPTIONS=--openssl-legacy-provider && bin/webpack-dev-server
# https://github.com/mperham/sidekiq/issues/3090#issuecomment-389748695
worker: dotenv bundle exec sidekiq -C config/sidekiq.yml
+2 -2
View File
@@ -1,3 +1,3 @@
backend: RAILS_ENV=test bin/rails s -p 5050
frontend: bin/webpack-dev-server
worker: dotenv RAILS_ENV=test bundle exec sidekiq -C config/sidekiq.yml
frontend: export NODE_OPTIONS=--openssl-legacy-provider && bin/webpack-dev-server
worker: RAILS_ENV=test dotenv bundle exec sidekiq -C config/sidekiq.yml
+11 -12
View File
@@ -1,10 +1,12 @@
<p align="center">
<img src="https://s3.us-west-2.amazonaws.com/gh-assets.chatwoot.com/brand.svg" alt="Woot-logo" width="240" />
<img src="https://user-images.githubusercontent.com/2246121/282256557-1570674b-d142-4198-9740-69404cc6a339.png#gh-light-mode-only" width="100%" alt="Chat dashboard dark mode"/>
<img src="https://user-images.githubusercontent.com/2246121/282256632-87f6a01b-6467-4e0e-8a93-7bbf66d03a17.png#gh-dark-mode-only" width="100%" alt="Chat dashboard"/>
<p align="center">Customer engagement suite, an open-source alternative to Intercom, Zendesk, Salesforce Service Cloud etc.</p>
</p>
___
<p align="center">
# Chatwoot
Customer engagement suite, an open-source alternative to Intercom, Zendesk, Salesforce Service Cloud etc.
<p>
<a href="https://heroku.com/deploy?template=https://github.com/chatwoot/chatwoot/tree/master" alt="Deploy to Heroku">
<img width="150" alt="Deploy" src="https://www.herokucdn.com/deploy/button.svg"/>
</a>
@@ -13,9 +15,7 @@
</a>
</p>
___
<p align="center">
<p>
<a href="https://codeclimate.com/github/chatwoot/chatwoot/maintainability"><img src="https://api.codeclimate.com/v1/badges/e6e3f66332c91e5a4c0c/maintainability" alt="Maintainability"></a>
<img src="https://img.shields.io/circleci/build/github/chatwoot/chatwoot" alt="CircleCI Badge">
<a href="https://hub.docker.com/r/chatwoot/chatwoot/"><img src="https://img.shields.io/docker/pulls/chatwoot/chatwoot" alt="Docker Pull Badge"></a>
@@ -29,9 +29,8 @@ ___
<a href="https://artifacthub.io/packages/helm/chatwoot/chatwoot"><img src="https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/artifact-hub" alt="Artifact HUB"></a>
</p>
<img src="https://chatwoot-public-assets.s3.amazonaws.com/github/screenshot.png" width="100%" alt="Chat dashboard"/>
<img src="https://user-images.githubusercontent.com/2246121/282255783-ee8a50c9-f42d-4752-8201-2d59965a663d.png#gh-light-mode-only" width="100%" alt="Chat dashboard dark mode"/>
<img src="https://user-images.githubusercontent.com/2246121/282255784-3d1994ec-d895-4ff5-ac68-d819987e1869.png#gh-dark-mode-only" width="100%" alt="Chat dashboard"/>
Chatwoot is an open-source, self-hosted customer engagement suite. Chatwoot lets you view and manage your customer data, communicate with them irrespective of which medium they use, and re-engage them based on their profile.
@@ -119,4 +118,4 @@ Thanks goes to all these [wonderful people](https://www.chatwoot.com/docs/contri
<a href="https://github.com/chatwoot/chatwoot/graphs/contributors"><img src="https://opencollective.com/chatwoot/contributors.svg?width=890&button=false" /></a>
*Chatwoot* &copy; 2017-2023, Chatwoot Inc - Released under the MIT License.
*Chatwoot* &copy; 2017-2024, Chatwoot Inc - Released under the MIT License.
+1 -1
View File
@@ -1 +1 @@
2.2.0
3.3.1
+1 -1
View File
@@ -1 +1 @@
2.1.0
2.7.0
+3
View File
@@ -60,6 +60,9 @@
],
"stack": "heroku-20",
"buildpacks": [
{
"url": "heroku/nodejs"
},
{
"url": "heroku/ruby"
}
+1 -1
View File
@@ -104,7 +104,7 @@ class ContactIdentifyAction
# TODO: replace reject { |_k, v| v.blank? } with compact_blank when rails is upgraded
@contact.discard_invalid_attrs if discard_invalid_attrs
@contact.save!
Avatar::AvatarFromUrlJob.perform_later(@contact, params[:avatar_url]) if params[:avatar_url].present?
Avatar::AvatarFromUrlJob.perform_later(@contact, params[:avatar_url]) if params[:avatar_url].present? && !@contact.avatar.attached?
end
def merge_contact(base_contact, merge_contact)
+5
View File
@@ -12,6 +12,7 @@ class ContactMergeAction
merge_conversations
merge_messages
merge_contact_inboxes
merge_contact_notes
merge_and_remove_mergee_contact
end
@base_contact
@@ -33,6 +34,10 @@ class ContactMergeAction
Conversation.where(contact_id: @mergee_contact.id).update(contact_id: @base_contact.id)
end
def merge_contact_notes
Note.where(contact_id: @mergee_contact.id, account_id: @mergee_contact.account_id).update(contact_id: @base_contact.id)
end
def merge_messages
Message.where(sender: @mergee_contact).update(sender: @base_contact)
end
+2
View File
@@ -1,4 +1,6 @@
//= link_tree ../images
//= link administrate/application.css
//= link administrate/application.js
//= link administrate-field-active_storage/application.css
//= link dashboardChart.js
//= link secretField.js
+1 -1
View File
@@ -11,7 +11,7 @@ function prepareData(data) {
function getChartOptions() {
var fontFamily =
'Inter,-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif';
'PlusJakarta,-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif';
return {
responsive: true,
legend: { labels: { fontFamily } },
+34
View File
@@ -0,0 +1,34 @@
// eslint-disable-next-line
function toggleSecretField(e) {
e.preventDefault();
e.stopPropagation();
const toggler = e.currentTarget;
const secretField = toggler.parentElement;
const textElement = secretField.querySelector('[data-secret-masked]');
if (!textElement) return;
if (textElement.dataset.secretMasked === 'false') {
textElement.textContent = '•'.repeat(10);
textElement.dataset.secretMasked = 'true';
toggler.querySelector('svg use').setAttribute('xlink:href', '#eye-show');
return;
}
textElement.textContent = secretField.dataset.secretText;
textElement.dataset.secretMasked = 'false';
toggler.querySelector('svg use').setAttribute('xlink:href', '#eye-hide');
}
// eslint-disable-next-line
function copySecretField(e) {
e.preventDefault();
e.stopPropagation();
const toggler = e.currentTarget;
const secretField = toggler.parentElement;
navigator.clipboard.writeText(secretField.dataset.secretText);
}
@@ -6,7 +6,6 @@
@import 'utilities/text-color';
@import 'selectize';
@import 'datetime_picker';
@import 'library/clearfix';
@import 'library/data-label';
@@ -26,7 +25,8 @@
@import 'components/flashes';
@import 'components/form-actions';
@import 'components/main-content';
@import 'components/navigation';
@import 'components/pagination';
@import 'components/search';
@import 'components/reports';
@import 'custom_styles';
@@ -24,14 +24,6 @@ select {
font-size: $base-font-size;
}
input,
select,
textarea {
display: block;
font-family: $base-font-family;
font-size: 16px;
}
[type="color"],
[type="date"],
[type="datetime-local"],
@@ -51,6 +43,7 @@ textarea {
background-color: $white;
border: $base-border;
border-radius: $base-border-radius;
font-family: $base-font-family;
padding: 0.5em;
transition: border-color $base-duration $base-timing;
width: 100%;
@@ -1,7 +1,7 @@
html {
background-color: $color-white;
box-sizing: border-box;
font-size: 10px;
font-size: 16px;
-webkit-font-smoothing: antialiased;
}
@@ -4,8 +4,8 @@
float: left;
margin-bottom: $base-spacing;
margin-top: 0.25em;
text-align: right;
width: calc(15% - 1rem);
text-align: left;
width: calc(16% - 1rem);
}
.preserve-whitespace {
@@ -16,8 +16,8 @@
.attribute-data {
float: left;
margin-bottom: $base-spacing;
margin-left: 2rem;
width: calc(85% - 1rem);
margin-left: 1.25rem;
width: calc(84% - 0.625rem);
}
.attribute--nested {
@@ -10,7 +10,7 @@ input[type="submit"],
color: $white;
cursor: pointer;
display: inline-block;
font-size: $font-size-default;
font-size: $font-size-small;
-webkit-font-smoothing: antialiased;
font-weight: $font-weight-medium;
line-height: 1;
@@ -43,3 +43,20 @@
.cell-label--number {
text-align: right;
}
.cell-data__secret-field {
align-items: center;
display: flex;
span {
flex: 1;
}
button {
margin-left: 5px;
svg {
fill: currentColor;
}
}
}
@@ -9,22 +9,22 @@
.field-unit__label {
float: left;
margin-left: 1rem;
margin-left: 0.625rem;
text-align: right;
width: calc(15% - 1rem);
width: calc(15% - 0.625rem);
}
.field-unit__field {
float: left;
margin-left: 2rem;
max-width: 50rem;
margin-left: 1.25rem;
max-width: 31.15rem;
width: 100%;
}
.field-unit--nested {
border: $base-border;
margin-left: 7.5%;
max-width: 60rem;
max-width: 37.5rem;
padding: $small-spacing;
width: 100%;
@@ -1,3 +1,3 @@
.form-actions {
margin-left: calc(15% + 2rem);
margin-left: calc(15% + 1.25rem);
}
@@ -1,13 +1,22 @@
.main-content {
font-size: $font-size-default;
left: 23rem;
left: 21rem;
position: absolute;
right: 0;
top: 0;
}
.main-content__body {
font-size: $font-size-small;
padding: $space-two;
table {
font-size: $font-size-small;
}
form {
margin-top: $space-two;
}
}
.main-content__header {
@@ -15,12 +24,12 @@
background-color: $color-white;
border-bottom: 1px solid $color-border;
display: flex;
min-height: 5.6rem;
min-height: 3.5rem;
padding: $space-small $space-normal;
}
.main-content__page-title {
font-size: $font-size-large;
font-size: $font-size-medium;
font-weight: $font-weight-medium;
margin-right: auto;
}
@@ -1,78 +0,0 @@
.logo-brand {
margin-bottom: $space-normal;
padding: $space-normal $space-smaller $space-small;
text-align: center;
}
.navigation {
background: $white;
border-right: 1px solid $color-border;
display: flex;
flex-direction: column;
font-size: $font-size-default;
font-weight: $font-weight-medium;
height: 100%;
justify-content: flex-start;
left: 0;
margin: 0;
overflow: auto;
padding: $space-normal;
position: fixed;
top: 0;
width: 23rem;
z-index: 1023;
li {
align-items: center;
display: flex;
a {
color: $color-gray;
text-decoration: none;
}
i {
min-width: $space-medium;
}
}
}
.navigation__link {
background-color: transparent;
color: $color-gray;
display: block;
line-height: 1;
margin-bottom: $space-smaller;
padding: $space-one;
&:hover {
color: $blue;
a {
color: $blue;
}
}
&.navigation__link--active {
background-color: $color-background;
border-radius: $base-border-radius;
color: $blue;
a {
color: $blue;
}
}
}
.logout {
bottom: $space-normal;
left: $space-normal;
position: fixed;
}
.app-version {
color: $color-gray;
font-size: $font-size-small;
padding-top: $space-smaller;
}
@@ -1,7 +1,7 @@
.search {
margin-left: auto;
margin-right: 2rem;
max-width: 44rem;
margin-right: 1.25rem;
max-width: 27.5rem;
position: relative;
width: 100%;
}
@@ -0,0 +1,24 @@
// custom styles for the dashboard
.feature-cell {
background: $color-extra-light-blue;
border-radius: 10px;
float: left;
margin-left: 8px;
margin-top: 6px;
padding: 4px 12px;
.icon-container {
margin-right: 4px;
}
.value-container {
margin-left: 6px;
}
}
.feature-container {
max-width: 100rem;
}
@@ -4,7 +4,7 @@ $base-font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto
sans-serif !default;
$heading-font-family: $base-font-family !default;
$base-font-size: 10px !default;
$base-font-size: 16px !default;
$base-line-height: 1.5 !default;
$heading-line-height: 1.2 !default;
@@ -1,30 +1,30 @@
// Font sizes
$font-size-nano: 0.8rem;
$font-size-micro: 1.0rem;
$font-size-mini: 1.2rem;
$font-size-small: 1.4rem;
$font-size-default: 1.6rem;
$font-size-medium: 1.8rem;
$font-size-large: 2.2rem;
$font-size-big: 2.4rem;
$font-size-bigger: 3.0rem;
$font-size-mega: 3.4rem;
$font-size-giga: 4.0rem;
$font-size-nano: 0.5rem;
$font-size-micro: 0.675rem;
$font-size-mini: 0.75rem;
$font-size-small: 0.875rem;
$font-size-default: 1rem;
$font-size-medium: 1.125rem;
$font-size-large: 1.375rem;
$font-size-big: 1.5rem;
$font-size-bigger: 1.75rem;
$font-size-mega: 2.125rem;
$font-size-giga: 2.5rem;
// spaces
$zero: 0;
$space-micro: 0.2rem;
$space-smaller: 0.4rem;
$space-small: 0.8rem;
$space-one: 1rem;
$space-slab: 1.2rem;
$space-normal: 1.6rem;
$space-two: 2.0rem;
$space-medium: 2.4rem;
$space-large: 3.2rem;
$space-larger: 4.8rem;
$space-jumbo: 6.4rem;
$space-mega: 10.0rem;
$space-micro: 0.125rem;
$space-smaller: 0.25rem;
$space-small: 0.5rem;
$space-one: 0.675rem;
$space-slab: 0.75rem;
$space-normal: 1rem;
$space-two: 1.25rem;
$space-medium: 1.5rem;
$space-large: 2rem;
$space-larger: 3rem;
$space-jumbo: 4rem;
$space-mega: 6.25rem;
// font-weight
$font-weight-feather: 100;
@@ -78,11 +78,6 @@ $conv-header-height: 4rem;
$inbox-thumb-size: 4.8rem;
// Spinner
$spinkit-spinner-color: $color-white !default;
$spinkit-spinner-margin: 0 0 0 1.6rem !default;
$spinkit-size: 1.6rem !default;
// Snackbar default
$woot-snackbar-bg: #323232;
$woot-snackbar-button: #ffeb3b;
@@ -25,7 +25,9 @@ class Messages::Facebook::MessageBuilder < Messages::Messenger::MessageBuilder
build_contact_inbox
build_message
end
rescue Koala::Facebook::AuthenticationError
rescue Koala::Facebook::AuthenticationError => e
Rails.logger.warn("Facebook authentication error for inbox: #{@inbox.id} with error: #{e.message}")
Rails.logger.error e
@inbox.channel.authorization_error!
rescue StandardError => e
ChatwootExceptionTracker.new(e, account: @inbox.account).capture_exception
@@ -93,6 +95,9 @@ class Messages::Facebook::MessageBuilder < Messages::Messenger::MessageBuilder
message_type: @message_type,
content: response.content,
source_id: response.identifier,
content_attributes: {
in_reply_to_external_id: response.in_reply_to_external_id
},
sender: @outgoing_echo ? nil : @contact_inbox.contact
}
end
@@ -105,22 +110,32 @@ class Messages::Facebook::MessageBuilder < Messages::Messenger::MessageBuilder
}
end
# rubocop:disable Metrics/AbcSize
# rubocop:disable Metrics/MethodLength
def contact_params
begin
k = Koala::Facebook::API.new(@inbox.channel.page_access_token) if @inbox.facebook?
result = k.get_object(@sender_id) || {}
rescue Koala::Facebook::AuthenticationError
rescue Koala::Facebook::AuthenticationError => e
Rails.logger.warn("Facebook authentication error for inbox: #{@inbox.id} with error: #{e.message}")
Rails.logger.error e
@inbox.channel.authorization_error!
raise
rescue Koala::Facebook::ClientError => e
result = {}
# OAuthException, code: 100, error_subcode: 2018218, message: (#100) No profile available for this user
# We don't need to capture this error as we don't care about contact params in case of echo messages
ChatwootExceptionTracker.new(e, account: @inbox.account).capture_exception unless @outgoing_echo
if e.message.include?('2018218')
Rails.logger.warn e
else
ChatwootExceptionTracker.new(e, account: @inbox.account).capture_exception unless @outgoing_echo
end
rescue StandardError => e
result = {}
ChatwootExceptionTracker.new(e, account: @inbox.account).capture_exception
end
process_contact_params_result(result)
end
# rubocop:enable Metrics/AbcSize
# rubocop:enable Metrics/MethodLength
end
@@ -20,7 +20,9 @@ class Messages::Instagram::MessageBuilder < Messages::Messenger::MessageBuilder
ActiveRecord::Base.transaction do
build_message
end
rescue Koala::Facebook::AuthenticationError
rescue Koala::Facebook::AuthenticationError => e
Rails.logger.warn("Instagram authentication error for inbox: #{@inbox.id} with error: #{e.message}")
Rails.logger.error e
@inbox.channel.authorization_error!
raise
rescue StandardError => e
@@ -46,6 +48,10 @@ class Messages::Instagram::MessageBuilder < Messages::Messenger::MessageBuilder
@outgoing_echo ? recipient_id : sender_id
end
def message_is_unsupported?
message[:is_unsupported].present? && @messaging[:message][:is_unsupported] == true
end
def sender_id
@messaging[:sender][:id]
end
@@ -63,28 +69,47 @@ class Messages::Instagram::MessageBuilder < Messages::Messenger::MessageBuilder
end
def conversation
@conversation ||= Conversation.find_by(conversation_params) || build_conversation
@conversation ||= Conversation.where(conversation_params).find_by(
"additional_attributes ->> 'type' = 'instagram_direct_message'"
) || build_conversation
end
def message_content
@messaging[:message][:text]
end
def story_reply_attributes
message[:reply_to][:story] if message[:reply_to].present? && message[:reply_to][:story].present?
end
def message_reply_attributes
message[:reply_to][:mid] if message[:reply_to].present? && message[:reply_to][:mid].present?
end
def build_message
return if @outgoing_echo && already_sent_from_chatwoot?
return if message_content.blank? && all_unsupported_files?
@message = conversation.messages.create!(message_params)
save_story_id
attachments.each do |attachment|
process_attachment(attachment)
end
end
def save_story_id
return if story_reply_attributes.blank?
@message.save_story_info(story_reply_attributes)
end
def build_conversation
@contact_inbox ||= contact.contact_inboxes.find_by!(source_id: message_source_id)
Conversation.create!(conversation_params.merge(
contact_inbox_id: @contact_inbox.id
contact_inbox_id: @contact_inbox.id,
additional_attributes: { type: 'instagram_direct_message' }
))
end
@@ -92,22 +117,25 @@ class Messages::Instagram::MessageBuilder < Messages::Messenger::MessageBuilder
{
account_id: @inbox.account_id,
inbox_id: @inbox.id,
contact_id: contact.id,
additional_attributes: {
type: 'instagram_direct_message'
}
contact_id: contact.id
}
end
def message_params
{
params = {
account_id: conversation.account_id,
inbox_id: conversation.inbox_id,
message_type: message_type,
source_id: message_identifier,
content: message_content,
sender: @outgoing_echo ? nil : contact
sender: @outgoing_echo ? nil : contact,
content_attributes: {
in_reply_to_external_id: message_reply_attributes
}
}
params[:content_attributes][:is_unsupported] = true if message_is_unsupported?
params
end
def already_sent_from_chatwoot?
+56 -6
View File
@@ -9,11 +9,11 @@ class Messages::MessageBuilder
@user = user
@message_type = params[:message_type] || 'outgoing'
@attachments = params[:attachments]
@automation_rule = @params&.dig(:content_attributes, :automation_rule_id)
@automation_rule = content_attributes&.dig(:automation_rule_id)
return unless params.instance_of?(ActionController::Parameters)
@in_reply_to = params.to_unsafe_h&.dig(:content_attributes, :in_reply_to)
@items = params.to_unsafe_h&.dig(:content_attributes, :items)
@in_reply_to = content_attributes&.dig(:in_reply_to)
@items = content_attributes&.dig(:items)
end
def perform
@@ -26,6 +26,38 @@ class Messages::MessageBuilder
private
# Extracts content attributes from the given params.
# - Converts ActionController::Parameters to a regular hash if needed.
# - Attempts to parse a JSON string if content is a string.
# - Returns an empty hash if content is not present, if there's a parsing error, or if it's an unexpected type.
def content_attributes
params = convert_to_hash(@params)
content_attributes = params.fetch(:content_attributes, {})
return parse_json(content_attributes) if content_attributes.is_a?(String)
return content_attributes if content_attributes.is_a?(Hash)
{}
end
# Converts the given object to a hash.
# If it's an instance of ActionController::Parameters, converts it to an unsafe hash.
# Otherwise, returns the object as-is.
def convert_to_hash(obj)
return obj.to_unsafe_h if obj.instance_of?(ActionController::Parameters)
obj
end
# Attempts to parse a string as JSON.
# If successful, returns the parsed hash with symbolized names.
# If unsuccessful, returns nil.
def parse_json(content)
JSON.parse(content, symbolize_names: true)
rescue JSON::ParserError
{}
end
def process_attachments
return if @attachments.blank?
@@ -48,11 +80,28 @@ class Messages::MessageBuilder
def process_emails
return unless @conversation.inbox&.inbox_type == 'Email'
cc_emails = @params[:cc_emails].split(',') if @params[:cc_emails]
bcc_emails = @params[:bcc_emails].split(',') if @params[:bcc_emails]
cc_emails = process_email_string(@params[:cc_emails])
bcc_emails = process_email_string(@params[:bcc_emails])
to_emails = process_email_string(@params[:to_emails])
all_email_addresses = cc_emails + bcc_emails + to_emails
validate_email_addresses(all_email_addresses)
@message.content_attributes[:cc_emails] = cc_emails
@message.content_attributes[:bcc_emails] = bcc_emails
@message.content_attributes[:to_emails] = to_emails
end
def process_email_string(email_string)
return [] if email_string.blank?
email_string.gsub(/\s+/, '').split(',')
end
def validate_email_addresses(all_emails)
all_emails&.each do |email|
raise StandardError, 'Invalid email address' unless email.match?(URI::MailTo::EMAIL_REGEXP)
end
end
def message_type
@@ -100,7 +149,8 @@ class Messages::MessageBuilder
content_type: @params[:content_type],
items: @items,
in_reply_to: @in_reply_to,
echo_id: @params[:echo_id]
echo_id: @params[:echo_id],
source_id: @params[:source_id]
}.merge(external_created_at).merge(automation_rule_id).merge(campaign_id).merge(template_params)
end
end
+8 -6
View File
@@ -1,22 +1,20 @@
class NotificationBuilder
pattr_initialize [:notification_type!, :user!, :account!, :primary_actor!]
pattr_initialize [:notification_type!, :user!, :account!, :primary_actor!, :secondary_actor]
def perform
return unless user_subscribed_to_notification?
build_notification
end
private
def secondary_actor
def current_user
Current.user
end
def user_subscribed_to_notification?
notification_setting = user.notification_settings.find_by(account_id: account.id)
# added for the case where an assignee might be removed from the account but remains in conversation
return if notification_setting.blank?
return false if notification_setting.blank?
return true if notification_setting.public_send("email_#{notification_type}?")
return true if notification_setting.public_send("push_#{notification_type}?")
@@ -25,11 +23,15 @@ class NotificationBuilder
end
def build_notification
# Create conversation_creation notification only if user is subscribed to it
return if notification_type == 'conversation_creation' && !user_subscribed_to_notification?
user.notifications.create!(
notification_type: notification_type,
account: account,
primary_actor: primary_actor,
secondary_actor: secondary_actor
# secondary_actor is secondary_actor if present, else current_user
secondary_actor: secondary_actor || current_user
)
end
end
+33 -12
View File
@@ -15,12 +15,15 @@ class V2::ReportBuilder
end
def timeseries
send(params[:metric])
return send(params[:metric]) if metric_valid?
Rails.logger.error "ReportBuilder: Invalid metric - #{params[:metric]}"
{}
end
# For backward compatible with old report
def build
if %w[avg_first_response_time avg_resolution_time].include?(params[:metric])
if %w[avg_first_response_time avg_resolution_time reply_time].include?(params[:metric])
timeseries.each_with_object([]) do |p, arr|
arr << { value: p[1], timestamp: p[0].in_time_zone(@timezone).to_i, count: @grouped_values.count[p[0]] }
end
@@ -33,18 +36,27 @@ class V2::ReportBuilder
def summary
{
conversations_count: conversations_count.values.sum,
incoming_messages_count: incoming_messages_count.values.sum,
outgoing_messages_count: outgoing_messages_count.values.sum,
conversations_count: conversations.count,
incoming_messages_count: incoming_messages.count,
outgoing_messages_count: outgoing_messages.count,
avg_first_response_time: avg_first_response_time_summary,
avg_resolution_time: avg_resolution_time_summary,
resolutions_count: resolutions_count.values.sum
resolutions_count: resolutions.count,
reply_time: reply_time_summary
}
end
def short_summary
{
conversations_count: conversations.count,
avg_first_response_time: avg_first_response_time_summary,
avg_resolution_time: avg_resolution_time_summary
}
end
def conversation_metrics
if params[:type].equal?(:account)
conversations
live_conversations
else
agent_metrics.sort_by { |hash| hash[:metric][:open] }.reverse
end
@@ -52,6 +64,16 @@ class V2::ReportBuilder
private
def metric_valid?
%w[conversations_count
incoming_messages_count
outgoing_messages_count
avg_first_response_time
avg_resolution_time reply_time
resolutions_count
reply_time].include?(params[:metric])
end
def inbox
@inbox ||= account.inboxes.find(params[:id])
end
@@ -74,7 +96,7 @@ class V2::ReportBuilder
:created_at,
default_value: 0,
range: range,
permit: %w[day week month year],
permit: %w[day week month year hour],
time_zone: @timezone
)
end
@@ -89,17 +111,16 @@ class V2::ReportBuilder
email: @user.email,
thumbnail: @user.avatar_url,
availability: account_user.availability_status,
metric: conversations
metric: live_conversations
}
end
end
def conversations
def live_conversations
@open_conversations = scope.conversations.where(account_id: @account.id).open
first_response_count = @account.reporting_events.where(name: 'first_response', conversation_id: @open_conversations.pluck('id')).count
metric = {
open: @open_conversations.count,
unattended: @open_conversations.count - first_response_count
unattended: @open_conversations.unattended.count
}
metric[:unassigned] = @open_conversations.unassigned.count if params[:type].equal?(:account)
metric
@@ -9,7 +9,6 @@ class Api::V1::Accounts::Actions::ContactMergesController < Api::V1::Accounts::B
mergee_contact: @mergee_contact
)
contact_merge_action.perform
render json: @base_contact
end
private
@@ -10,11 +10,18 @@ class Api::V1::Accounts::AgentBotsController < Api::V1::Accounts::BaseController
def show; end
def create
@agent_bot = Current.account.agent_bots.create!(permitted_params)
@agent_bot = Current.account.agent_bots.create!(permitted_params.except(:avatar_url))
process_avatar_from_url
end
def update
@agent_bot.update!(permitted_params)
@agent_bot.update!(permitted_params.except(:avatar_url))
process_avatar_from_url
end
def avatar
@agent_bot.avatar.purge if @agent_bot.avatar.attached?
@agent_bot
end
def destroy
@@ -30,6 +37,10 @@ class Api::V1::Accounts::AgentBotsController < Api::V1::Accounts::BaseController
end
def permitted_params
params.permit(:name, :description, :outgoing_url, :bot_type, bot_config: [:csml_content])
params.permit(:name, :description, :outgoing_url, :avatar, :avatar_url, :bot_type, bot_config: [:csml_content])
end
def process_avatar_from_url
::Avatar::AvatarFromUrlJob.perform_later(@agent_bot, params[:avatar_url]) if params[:avatar_url].present?
end
end
@@ -19,6 +19,7 @@ class Api::V1::Accounts::AgentsController < Api::V1::Accounts::BaseController
def destroy
@agent.current_account_user.destroy!
delete_user_record(@agent)
head :ok
end
@@ -74,4 +75,8 @@ class Api::V1::Accounts::AgentsController < Api::V1::Accounts::BaseController
def validate_limit
render_payment_required('Account limit exceeded. Please purchase more licenses') if agents.count >= Current.account.usage_limits[:agents]
end
def delete_user_record(agent)
DeleteObjectJob.perform_later(agent) if agent.reload.account_users.blank?
end
end
@@ -1,16 +1,24 @@
class Api::V1::Accounts::ArticlesController < Api::V1::Accounts::BaseController
before_action :portal
before_action :check_authorization
before_action :fetch_article, except: [:index, :create]
before_action :fetch_article, except: [:index, :create, :reorder]
before_action :set_current_page, only: [:index]
def index
@portal_articles = @portal.articles
@all_articles = @portal_articles.search(list_params)
@articles_count = @all_articles.count
@articles = @all_articles.page(@current_page)
@articles = if list_params[:category_slug].present?
@all_articles.order_by_position.page(@current_page)
else
@all_articles.order_by_updated_at.page(@current_page)
end
end
def show; end
def edit; end
def create
@article = @portal.articles.create!(article_params)
@article.associate_root_article(article_params[:associated_article_id])
@@ -18,12 +26,9 @@ class Api::V1::Accounts::ArticlesController < Api::V1::Accounts::BaseController
render json: { error: @article.errors.messages }, status: :unprocessable_entity and return unless @article.valid?
end
def edit; end
def show; end
def update
@article.update!(article_params)
@article.update!(article_params) if params[:article].present?
render json: { error: @article.errors.messages }, status: :unprocessable_entity and return unless @article.valid?
end
def destroy
@@ -31,6 +36,11 @@ class Api::V1::Accounts::ArticlesController < Api::V1::Accounts::BaseController
head :ok
end
def reorder
Article.update_positions(params[:positions_hash])
head :ok
end
private
def fetch_article
@@ -43,8 +53,9 @@ class Api::V1::Accounts::ArticlesController < Api::V1::Accounts::BaseController
def article_params
params.require(:article).permit(
:title, :slug, :content, :description, :position, :category_id, :author_id, :associated_article_id, :status, meta: [:title, :description,
{ tags: [] }]
:title, :slug, :position, :content, :description, :position, :category_id, :author_id, :associated_article_id, :status, meta: [:title,
:description,
{ tags: [] }]
)
end
@@ -6,6 +6,8 @@ class Api::V1::Accounts::AutomationRulesController < Api::V1::Accounts::BaseCont
@automation_rules = Current.account.automation_rules
end
def show; end
def create
@automation_rule = Current.account.automation_rules.new(automation_rules_permit)
@automation_rule.actions = params[:actions]
@@ -18,18 +20,6 @@ class Api::V1::Accounts::AutomationRulesController < Api::V1::Accounts::BaseCont
@automation_rule
end
def attach_file
file_blob = ActiveStorage::Blob.create_and_upload!(
key: nil,
io: params[:attachment].tempfile,
filename: params[:attachment].original_filename,
content_type: params[:attachment].content_type
)
render json: { blob_key: file_blob.key, blob_id: file_blob.id }
end
def show; end
def update
ActiveRecord::Base.transaction do
automation_rule_update
@@ -14,8 +14,18 @@ class Api::V1::Accounts::CallbacksController < Api::V1::Accounts::BaseController
@facebook_inbox = Current.account.inboxes.create!(name: inbox_name, channel: facebook_channel)
set_instagram_id(page_access_token, facebook_channel)
set_avatar(@facebook_inbox, page_id)
rescue StandardError => e
ChatwootExceptionTracker.new(e).capture_exception
end
rescue StandardError => e
ChatwootExceptionTracker.new(e).capture_exception
Rails.logger.error "Error in register_facebook_page: #{e.message}"
# Additional log statements
log_additional_info
end
def log_additional_info
Rails.logger.debug do
"user_access_token: #{params[:user_access_token]} , page_access_token: #{params[:page_access_token]} ,
page_id: #{params[:page_id]}, inbox_name: #{params[:inbox_name]}"
end
end
@@ -30,6 +40,8 @@ class Api::V1::Accounts::CallbacksController < Api::V1::Accounts::BaseController
instagram_id = response['instagram_business_account']['id']
facebook_channel.update(instagram_id: instagram_id)
rescue StandardError => e
Rails.logger.error "Error in set_instagram_id: #{e.message}"
end
# get params[:inbox_id], current_account. params[:omniauth_token]
@@ -61,6 +73,7 @@ class Api::V1::Accounts::CallbacksController < Api::V1::Accounts::BaseController
fb_page&.reauthorized!
rescue StandardError => e
ChatwootExceptionTracker.new(e).capture_exception
Rails.logger.error "Error in update_fb_page: #{e.message}"
end
end
@@ -77,7 +90,7 @@ class Api::V1::Accounts::CallbacksController < Api::V1::Accounts::BaseController
koala = Koala::Facebook::OAuth.new(GlobalConfigService.load('FB_APP_ID', ''), GlobalConfigService.load('FB_APP_SECRET', ''))
koala.exchange_access_token_info(omniauth_token)['access_token']
rescue StandardError => e
Rails.logger.error e
Rails.logger.error "Error in long_lived_token: #{e.message}"
end
def mark_already_existing_facebook_pages(data)
@@ -6,21 +6,21 @@ class Api::V1::Accounts::CampaignsController < Api::V1::Accounts::BaseController
@campaigns = Current.account.campaigns
end
def show; end
def create
@campaign = Current.account.campaigns.create!(campaign_params)
end
def update
@campaign.update!(campaign_params)
end
def destroy
@campaign.destroy!
head :ok
end
def show; end
def update
@campaign.update!(campaign_params)
end
private
def campaign
@@ -33,7 +33,10 @@ class Api::V1::Accounts::CannedResponsesController < Api::V1::Accounts::BaseCont
def canned_responses
if params[:search]
Current.account.canned_responses.where('short_code ILIKE :search OR content ILIKE :search', search: "%#{params[:search]}%")
Current.account.canned_responses
.where('short_code ILIKE :search OR content ILIKE :search', search: "%#{params[:search]}%")
.order_by_search(params[:search])
else
Current.account.canned_responses
end
@@ -9,6 +9,8 @@ class Api::V1::Accounts::CategoriesController < Api::V1::Accounts::BaseControlle
@categories = @portal.categories.search(params)
end
def show; end
def create
@category = @portal.categories.create!(category_params)
@category.related_categories << related_categories_records
@@ -17,8 +19,6 @@ class Api::V1::Accounts::CategoriesController < Api::V1::Accounts::BaseControlle
@category.save!
end
def show; end
def update
@category.update!(category_params)
@category.related_categories = related_categories_records if related_categories_records.any?
@@ -48,7 +48,7 @@ class Api::V1::Accounts::CategoriesController < Api::V1::Accounts::BaseControlle
def category_params
params.require(:category).permit(
:name, :description, :position, :slug, :locale, :parent_category_id, :associated_category_id
:name, :description, :position, :slug, :locale, :icon, :parent_category_id, :associated_category_id
)
end
@@ -18,7 +18,11 @@ class Api::V1::Accounts::Channels::TwilioChannelsController < Api::V1::Accounts:
end
def authenticate_twilio
client = Twilio::REST::Client.new(permitted_params[:account_sid], permitted_params[:auth_token])
client = if permitted_params[:api_key_sid].present?
Twilio::REST::Client.new(permitted_params[:api_key_sid], permitted_params[:auth_token], permitted_params[:account_sid])
else
Twilio::REST::Client.new(permitted_params[:account_sid], permitted_params[:auth_token])
end
client.messages.list(limit: 1)
end
@@ -40,6 +44,7 @@ class Api::V1::Accounts::Channels::TwilioChannelsController < Api::V1::Accounts:
@twilio_channel = Current.account.twilio_sms.create!(
account_sid: permitted_params[:account_sid],
auth_token: permitted_params[:auth_token],
api_key_sid: permitted_params[:api_key_sid],
messaging_service_sid: permitted_params[:messaging_service_sid].presence,
phone_number: phone_number,
medium: medium
@@ -52,7 +57,7 @@ class Api::V1::Accounts::Channels::TwilioChannelsController < Api::V1::Accounts:
def permitted_params
params.require(:twilio_channel).permit(
:account_id, :messaging_service_sid, :phone_number, :account_sid, :auth_token, :name, :medium
:account_id, :messaging_service_sid, :phone_number, :account_sid, :auth_token, :name, :medium, :api_key_sid
)
end
end
@@ -0,0 +1,21 @@
class Api::V1::Accounts::ContactInboxesController < Api::V1::Accounts::BaseController
before_action :ensure_inbox
def filter
contact_inbox = @inbox.contact_inboxes.where(inbox_id: permitted_params[:inbox_id], source_id: permitted_params[:source_id])
return head :not_found if contact_inbox.empty?
@contact = contact_inbox.first.contact
end
private
def ensure_inbox
@inbox = Current.account.inboxes.find(permitted_params[:inbox_id])
authorize @inbox, :show?
end
def permitted_params
params.permit(:inbox_id, :source_id)
end
end
@@ -1,11 +1,13 @@
class Api::V1::Accounts::Contacts::ContactInboxesController < Api::V1::Accounts::Contacts::BaseController
include HmacConcern
before_action :ensure_inbox, only: [:create]
def create
@contact_inbox = ContactInboxBuilder.new(
contact: @contact,
inbox: @inbox,
source_id: params[:source_id]
source_id: params[:source_id],
hmac_verified: hmac_verified?
).perform
end
@@ -5,21 +5,21 @@ class Api::V1::Accounts::Contacts::NotesController < Api::V1::Accounts::Contacts
@notes = @contact.notes.latest.includes(:user)
end
def show; end
def create
@note = @contact.notes.create!(note_params)
end
def update
@note.update(note_params)
end
def destroy
@note.destroy!
head :ok
end
def show; end
def update
@note.update(note_params)
end
private
def note
@@ -4,6 +4,7 @@ class Api::V1::Accounts::ContactsController < Api::V1::Accounts::BaseController
sort_on :name, internal_name: :order_on_name, type: :scope, scope_params: [:direction]
sort_on :phone_number, type: :string
sort_on :last_activity_at, internal_name: :order_on_last_activity_at, type: :scope, scope_params: [:direction]
sort_on :created_at, internal_name: :order_on_created_at, type: :scope, scope_params: [:direction]
sort_on :company, internal_name: :order_on_company_name, type: :scope, scope_params: [:direction]
sort_on :city, internal_name: :order_on_city, type: :scope, scope_params: [:direction]
sort_on :country, internal_name: :order_on_country_name, type: :scope, scope_params: [:direction]
@@ -17,18 +18,19 @@ class Api::V1::Accounts::ContactsController < Api::V1::Accounts::BaseController
def index
@contacts_count = resolved_contacts.count
@contacts = fetch_contacts_with_conversation_count(resolved_contacts)
@contacts = fetch_contacts(resolved_contacts)
end
def search
render json: { error: 'Specify search string with parameter q' }, status: :unprocessable_entity if params[:q].blank? && return
contacts = resolved_contacts.where(
'name ILIKE :search OR email ILIKE :search OR phone_number ILIKE :search OR contacts.identifier LIKE :search',
'name ILIKE :search OR email ILIKE :search OR phone_number ILIKE :search OR contacts.identifier LIKE :search
OR contacts.additional_attributes->>\'company_name\' ILIKE :search',
search: "%#{params[:q].strip}%"
)
@contacts_count = contacts.count
@contacts = fetch_contacts_with_conversation_count(contacts)
@contacts = fetch_contacts(contacts)
end
def import
@@ -42,6 +44,12 @@ class Api::V1::Accounts::ContactsController < Api::V1::Accounts::BaseController
head :ok
end
def export
column_names = params['column_names']
Account::ContactsExportJob.perform_later(Current.account.id, column_names)
head :ok, message: I18n.t('errors.contacts.export.success')
end
# returns online contacts
def active
contacts = Current.account.contacts.where(id: ::OnlineStatusTracker
@@ -56,7 +64,7 @@ class Api::V1::Accounts::ContactsController < Api::V1::Accounts::BaseController
result = ::Contacts::FilterService.new(params.permit!, current_user).perform
contacts = result[:contacts]
@contacts_count = result[:count]
@contacts = fetch_contacts_with_conversation_count(contacts)
@contacts = fetch_contacts(contacts)
end
def contactable_inboxes
@@ -75,14 +83,14 @@ class Api::V1::Accounts::ContactsController < Api::V1::Accounts::BaseController
@contact = Current.account.contacts.new(permitted_params.except(:avatar_url))
@contact.save!
@contact_inbox = build_contact_inbox
process_avatar
process_avatar_from_url
end
end
def update
@contact.assign_attributes(contact_update_params)
@contact.save!
process_avatar if permitted_params[:avatar].present? || permitted_params[:avatar_url].present?
process_avatar_from_url
end
def destroy
@@ -118,16 +126,14 @@ class Api::V1::Accounts::ContactsController < Api::V1::Accounts::BaseController
@current_page = params[:page] || 1
end
def fetch_contacts_with_conversation_count(contacts)
contacts_with_conversation_count = filtrate(contacts).left_outer_joins(:conversations)
.select('contacts.*, COUNT(conversations.id) as conversations_count')
.group('contacts.id')
.includes([{ avatar_attachment: [:blob] }])
.page(@current_page).per(RESULTS_PER_PAGE)
def fetch_contacts(contacts)
contacts_with_avatar = filtrate(contacts)
.includes([{ avatar_attachment: [:blob] }])
.page(@current_page).per(RESULTS_PER_PAGE)
return contacts_with_conversation_count.includes([{ contact_inboxes: [:inbox] }]) if @include_contact_inboxes
return contacts_with_avatar.includes([{ contact_inboxes: [:inbox] }]) if @include_contact_inboxes
contacts_with_conversation_count
contacts_with_avatar
end
def build_contact_inbox
@@ -168,7 +174,7 @@ class Api::V1::Accounts::ContactsController < Api::V1::Accounts::BaseController
@contact = Current.account.contacts.includes(contact_inboxes: [:inbox]).find(params[:id])
end
def process_avatar
def process_avatar_from_url
::Avatar::AvatarFromUrlJob.perform_later(@contact, params[:avatar_url]) if params[:avatar_url].present?
end
@@ -14,7 +14,8 @@ class Api::V1::Accounts::Conversations::AssignmentsController < Api::V1::Account
def set_agent
@agent = Current.account.users.find_by(id: params[:assignee_id])
@conversation.update_assignee(@agent)
@conversation.assignee = @agent
@conversation.save!
render_agent
end
@@ -1,5 +1,4 @@
class Api::V1::Accounts::Conversations::BaseController < Api::V1::Accounts::BaseController
include EnsureCurrentAccountHelper
before_action :conversation
private
@@ -18,6 +18,33 @@ class Api::V1::Accounts::Conversations::MessagesController < Api::V1::Accounts::
end
end
def retry
return if message.blank?
message.update!(status: :sent, content_attributes: {})
::SendReplyJob.perform_later(message.id)
rescue StandardError => e
render_could_not_create_error(e.message)
end
def translate
return head :ok if already_translated_content_available?
translated_content = Integrations::GoogleTranslate::ProcessorService.new(
message: message,
target_language: permitted_params[:target_language]
).perform
if translated_content.present?
translations = {}
translations[permitted_params[:target_language]] = translated_content
translations = message.translations.merge!(translations) if message.translations.present?
message.update!(translations: translations)
end
render json: { content: translated_content }
end
private
def message
@@ -29,6 +56,10 @@ class Api::V1::Accounts::Conversations::MessagesController < Api::V1::Accounts::
end
def permitted_params
params.permit(:id)
params.permit(:id, :target_language)
end
def already_translated_content_available?
message.translations.present? && message.translations[permitted_params[:target_language]].present?
end
end
@@ -0,0 +1,41 @@
class Api::V1::Accounts::Conversations::ParticipantsController < Api::V1::Accounts::Conversations::BaseController
def show
@participants = @conversation.conversation_participants
end
def create
ActiveRecord::Base.transaction do
@participants = participants_to_be_added_ids.map { |user_id| @conversation.conversation_participants.find_or_create_by(user_id: user_id) }
end
end
def update
ActiveRecord::Base.transaction do
participants_to_be_added_ids.each { |user_id| @conversation.conversation_participants.find_or_create_by(user_id: user_id) }
participants_to_be_removed_ids.each { |user_id| @conversation.conversation_participants.find_by(user_id: user_id)&.destroy }
end
@participants = @conversation.conversation_participants
render action: 'show'
end
def destroy
ActiveRecord::Base.transaction do
params[:user_ids].map { |user_id| @conversation.conversation_participants.find_by(user_id: user_id)&.destroy }
end
head :ok
end
private
def participants_to_be_added_ids
params[:user_ids] - current_participant_ids
end
def participants_to_be_removed_ids
current_participant_ids - params[:user_ids]
end
def current_participant_ids
@current_participant_ids ||= @conversation.conversation_participants.pluck(:user_id)
end
end
@@ -1,6 +1,7 @@
class Api::V1::Accounts::ConversationsController < Api::V1::Accounts::BaseController
include Events::Types
include DateRangeHelper
include HmacConcern
before_action :conversation, except: [:index, :meta, :search, :create, :filter]
before_action :inbox, :contact, :contact_inbox, only: [:create]
@@ -22,6 +23,12 @@ class Api::V1::Accounts::ConversationsController < Api::V1::Accounts::BaseContro
@conversations_count = result[:count]
end
def attachments
@attachments = @conversation.attachments
end
def show; end
def create
ActiveRecord::Base.transaction do
@conversation = ConversationBuilder.new(params: params, contact_inbox: @contact_inbox).perform
@@ -29,8 +36,6 @@ class Api::V1::Accounts::ConversationsController < Api::V1::Accounts::BaseContro
end
end
def show; end
def filter
result = ::Conversations::FilterService.new(params.permit!, current_user).perform
@conversations = result[:conversations]
@@ -55,22 +60,36 @@ class Api::V1::Accounts::ConversationsController < Api::V1::Accounts::BaseContro
end
def toggle_status
if params[:status]
# FIXME: move this logic into a service object
if pending_to_open_by_bot?
@conversation.bot_handoff!
elsif params[:status].present?
set_conversation_status
@status = @conversation.save!
else
@status = @conversation.toggle_status
end
assign_conversation if @conversation.status == 'open' && Current.user.is_a?(User) && Current.user&.agent?
assign_conversation if should_assign_conversation?
end
def pending_to_open_by_bot?
return false unless Current.user.is_a?(AgentBot)
@conversation.status == 'pending' && params[:status] == 'open'
end
def should_assign_conversation?
@conversation.status == 'open' && Current.user.is_a?(User) && Current.user&.agent?
end
def toggle_priority
@conversation.toggle_priority(params[:priority])
head :ok
end
def toggle_typing_status
case params[:typing_status]
when 'on'
trigger_typing_event(CONVERSATION_TYPING_ON, params[:is_private])
when 'off'
trigger_typing_event(CONVERSATION_TYPING_OFF, params[:is_private])
end
typing_status_manager = ::Conversations::TypingStatusManager.new(@conversation, current_user, params)
typing_status_manager.toggle_typing_status
head :ok
end
@@ -99,21 +118,13 @@ class Api::V1::Accounts::ConversationsController < Api::V1::Accounts::BaseContro
end
def set_conversation_status
# TODO: temporary fallback for the old bot status in conversation, we will remove after couple of releases
# commenting this out to see if there are any errors, if not we can remove this in subsequent releases
# status = params[:status] == 'bot' ? 'pending' : params[:status]
@conversation.status = params[:status]
@conversation.snoozed_until = parse_date_time(params[:snoozed_until].to_s) if params[:snoozed_until]
end
def assign_conversation
@agent = Current.account.users.find(current_user.id)
@conversation.update_assignee(@agent)
end
def trigger_typing_event(event, is_private)
user = current_user.presence || @resource
Rails.configuration.dispatcher.dispatch(event, Time.zone.now, conversation: @conversation, user: user, is_private: is_private)
@conversation.assignee = current_user
@conversation.save!
end
def conversation
@@ -142,6 +153,8 @@ class Api::V1::Accounts::ConversationsController < Api::V1::Accounts::BaseContro
# and deprecate the support of passing only source_id as the param
@contact_inbox ||= ::ContactInbox.find_by!(source_id: params[:source_id])
authorize @contact_inbox.inbox, :show?
rescue ActiveRecord::RecordNotUnique
render json: { error: 'source_id should be unique' }, status: :unprocessable_entity
end
def build_contact_inbox
@@ -150,7 +163,8 @@ class Api::V1::Accounts::ConversationsController < Api::V1::Accounts::BaseContro
ContactInboxBuilder.new(
contact: @contact,
inbox: @inbox,
source_id: params[:source_id]
source_id: params[:source_id],
hmac_verified: hmac_verified?
).perform
end
@@ -34,9 +34,12 @@ class Api::V1::Accounts::CsatSurveyResponsesController < Api::V1::Accounts::Base
end
def set_csat_survey_responses
@csat_survey_responses = filtrate(
Current.account.csat_survey_responses.includes([:conversation, :assigned_agent, :contact])
).filter_by_created_at(range).filter_by_assigned_agent_id(params[:user_ids])
base_query = Current.account.csat_survey_responses.includes([:conversation, :assigned_agent, :contact])
@csat_survey_responses = filtrate(base_query).filter_by_created_at(range)
.filter_by_assigned_agent_id(params[:user_ids])
.filter_by_inbox_id(params[:inbox_id])
.filter_by_team_id(params[:team_id])
.filter_by_rating(params[:rating])
end
def set_current_page_surveys
@@ -39,6 +39,8 @@ class Api::V1::Accounts::CustomAttributeDefinitionsController < Api::V1::Account
:attribute_display_type,
:attribute_key,
:attribute_model,
:regex_pattern,
:regex_cue,
attribute_values: []
)
end
@@ -1,4 +1,5 @@
class Api::V1::Accounts::CustomFiltersController < Api::V1::Accounts::BaseController
before_action :check_authorization
before_action :fetch_custom_filters, except: [:create]
before_action :fetch_custom_filter, only: [:show, :update, :destroy]
DEFAULT_FILTER_TYPE = 'conversation'.freeze
@@ -11,6 +12,7 @@ class Api::V1::Accounts::CustomFiltersController < Api::V1::Accounts::BaseContro
@custom_filter = current_user.custom_filters.create!(
permitted_payload.merge(account_id: Current.account.id)
)
render json: { error: @custom_filter.errors.messages }, status: :unprocessable_entity and return unless @custom_filter.valid?
end
def update
@@ -2,6 +2,11 @@ class Api::V1::Accounts::InboxMembersController < Api::V1::Accounts::BaseControl
before_action :fetch_inbox
before_action :current_agents_ids, only: [:create, :update]
def show
authorize @inbox, :show?
fetch_updated_agents
end
def create
authorize @inbox, :create?
ActiveRecord::Base.transaction do
@@ -10,11 +15,6 @@ class Api::V1::Accounts::InboxMembersController < Api::V1::Accounts::BaseControl
fetch_updated_agents
end
def show
authorize @inbox, :show?
fetch_updated_agents
end
def update
authorize @inbox, :update?
update_agents_list
@@ -14,7 +14,7 @@ class Api::V1::Accounts::InboxesController < Api::V1::Accounts::BaseController
# Deprecated: This API will be removed in 2.7.0
def assignable_agents
@assignable_agents = (Current.account.users.where(id: @inbox.members.select(:user_id)) + Current.account.administrators).uniq
@assignable_agents = @inbox.assignable_agents
end
def campaigns
@@ -44,26 +44,7 @@ class Api::V1::Accounts::InboxesController < Api::V1::Accounts::BaseController
def update
@inbox.update!(permitted_params.except(:channel))
update_inbox_working_hours
channel_attributes = get_channel_attributes(@inbox.channel_type)
# Inbox update doesn't necessarily need channel attributes
return if permitted_params(channel_attributes)[:channel].blank?
if @inbox.inbox_type == 'Email'
begin
validate_email_channel(channel_attributes)
rescue StandardError => e
render json: { message: e }, status: :unprocessable_entity and return
end
@inbox.channel.reauthorized!
end
@inbox.channel.update!(permitted_params(channel_attributes)[:channel])
update_channel_feature_flags
end
def update_inbox_working_hours
@inbox.update_working_hours(params.permit(working_hours: Inbox::OFFISABLE_ATTRS)[:working_hours]) if params[:working_hours]
update_channel if channel_update_required?
end
def agent_bot
@@ -82,8 +63,8 @@ class Api::V1::Accounts::InboxesController < Api::V1::Accounts::BaseController
end
def destroy
@inbox.destroy!
head :ok
::DeleteObjectJob.perform_later(@inbox, Current.user, request.ip) if @inbox.present?
render status: :ok, json: { message: I18n.t('messages.inbox_deletetion_response') }
end
private
@@ -103,6 +84,35 @@ class Api::V1::Accounts::InboxesController < Api::V1::Accounts::BaseController
account_channels_method.create!(permitted_params(channel_type_from_params::EDITABLE_ATTRS)[:channel].except(:type))
end
def update_inbox_working_hours
@inbox.update_working_hours(params.permit(working_hours: Inbox::OFFISABLE_ATTRS)[:working_hours]) if params[:working_hours]
end
def update_channel
channel_attributes = get_channel_attributes(@inbox.channel_type)
return if permitted_params(channel_attributes)[:channel].blank?
validate_and_update_email_channel(channel_attributes) if @inbox.inbox_type == 'Email'
reauthorize_and_update_channel(channel_attributes)
update_channel_feature_flags
end
def channel_update_required?
permitted_params(get_channel_attributes(@inbox.channel_type))[:channel].present?
end
def validate_and_update_email_channel(channel_attributes)
validate_email_channel(channel_attributes)
rescue StandardError => e
render json: { message: e }, status: :unprocessable_entity and return
end
def reauthorize_and_update_channel(channel_attributes)
@inbox.channel.reauthorized! if @inbox.channel.respond_to?(:reauthorized!)
@inbox.channel.update!(permitted_params(channel_attributes)[:channel])
end
def update_channel_feature_flags
return unless @inbox.web_widget?
return unless permitted_params(Channel::WebWidget::EDITABLE_ATTRS)[:channel].key? :selected_feature_flags
@@ -114,10 +124,13 @@ class Api::V1::Accounts::InboxesController < Api::V1::Accounts::BaseController
def inbox_attributes
[:name, :avatar, :greeting_enabled, :greeting_message, :enable_email_collect, :csat_survey_enabled,
:enable_auto_assignment, :working_hours_enabled, :out_of_office_message, :timezone, :allow_messages_after_resolved,
:lock_to_single_conversation]
:lock_to_single_conversation, :portal_id, :sender_name_type, :business_name]
end
def permitted_params(channel_attributes = [])
# We will remove this line after fixing https://linear.app/chatwoot/issue/CW-1567/null-value-passed-as-null-string-to-backend
params.each { |k, v| params[k] = params[k] == 'null' ? nil : v }
params.permit(
*inbox_attributes,
channel: [:type, *channel_attributes]
@@ -1,5 +1,5 @@
class Api::V1::Accounts::Integrations::AppsController < Api::V1::Accounts::BaseController
before_action :check_admin_authorization?
before_action :check_admin_authorization?, except: [:index, :show]
before_action :fetch_apps, only: [:index]
before_action :fetch_app, only: [:show]
@@ -1,5 +1,5 @@
class Api::V1::Accounts::Integrations::HooksController < Api::V1::Accounts::BaseController
before_action :fetch_hook, only: [:update, :destroy]
before_action :fetch_hook, except: [:create]
before_action :check_authorization
def create
@@ -10,6 +10,10 @@ class Api::V1::Accounts::Integrations::HooksController < Api::V1::Accounts::Base
@hook.update!(permitted_params.slice(:status, :settings))
end
def process_event
render json: { message: @hook.process_event(params[:event]) }
end
def destroy
@hook.destroy!
head :ok
@@ -1,27 +1,27 @@
class Api::V1::Accounts::Integrations::SlackController < Api::V1::Accounts::BaseController
before_action :check_admin_authorization?
before_action :fetch_hook, only: [:update, :destroy]
before_action :fetch_hook, only: [:update, :destroy, :list_all_channels]
def list_all_channels
@channels = channel_builder.fetch_channels
end
def create
ActiveRecord::Base.transaction do
builder = Integrations::Slack::HookBuilder.new(
account: Current.account,
code: params[:code],
inbox_id: params[:inbox_id]
)
@hook = builder.perform
create_chatwoot_slack_channel
end
hook_builder = Integrations::Slack::HookBuilder.new(
account: Current.account,
code: params[:code],
inbox_id: params[:inbox_id]
)
@hook = hook_builder.perform
end
def update
create_chatwoot_slack_channel
render json: @hook
@hook = channel_builder.update(permitted_params[:reference_id])
render json: { error: I18n.t('errors.slack.invalid_channel_id') }, status: :unprocessable_entity if @hook.blank?
end
def destroy
@hook.destroy!
head :ok
end
@@ -31,11 +31,11 @@ class Api::V1::Accounts::Integrations::SlackController < Api::V1::Accounts::Base
@hook = Integrations::Hook.where(account: Current.account).find_by(app_id: 'slack')
end
def create_chatwoot_slack_channel
channel = params[:channel] || 'customer-conversations'
builder = Integrations::Slack::ChannelBuilder.new(
hook: @hook, channel: channel
)
builder.perform
def channel_builder
Integrations::Slack::ChannelBuilder.new(hook: @hook)
end
def permitted_params
params.permit(:reference_id)
end
end
@@ -6,6 +6,10 @@ class Api::V1::Accounts::MacrosController < Api::V1::Accounts::BaseController
@macros = Macro.with_visibility(current_user, params)
end
def show
head :not_found if @macro.nil?
end
def create
@macro = Current.account.macros.new(macros_with_user.merge(created_by_id: current_user.id))
@macro.set_visibility(current_user, permitted_params)
@@ -18,25 +22,6 @@ class Api::V1::Accounts::MacrosController < Api::V1::Accounts::BaseController
@macro
end
def show
head :not_found if @macro.nil?
end
def destroy
@macro.destroy!
head :ok
end
def attach_file
file_blob = ActiveStorage::Blob.create_and_upload!(
key: nil,
io: params[:attachment].tempfile,
filename: params[:attachment].original_filename,
content_type: params[:attachment].content_type
)
render json: { blob_key: file_blob.key, blob_id: file_blob.id }
end
def update
ActiveRecord::Base.transaction do
@macro.update!(macros_with_user)
@@ -49,6 +34,11 @@ class Api::V1::Accounts::MacrosController < Api::V1::Accounts::BaseController
end
end
def destroy
@macro.destroy!
head :ok
end
def execute
::MacrosExecutionJob.perform_later(@macro, conversation_ids: params[:conversation_ids], user: Current.user)
@@ -7,11 +7,12 @@ class Api::V1::Accounts::Microsoft::AuthorizationsController < Api::V1::Accounts
redirect_url = microsoft_client.auth_code.authorize_url(
{
redirect_uri: "#{base_url}/microsoft/callback",
scope: 'offline_access https://outlook.office.com/IMAP.AccessAsUser.All https://outlook.office.com/SMTP.Send openid',
scope: 'offline_access https://outlook.office.com/IMAP.AccessAsUser.All https://outlook.office.com/SMTP.Send openid profile',
prompt: 'consent'
}
)
if redirect_url
email = email.downcase
::Redis::Alfred.setex(email, Current.account.id, 5.minutes)
render json: { success: true, url: redirect_url }
else
@@ -1,14 +1,15 @@
class Api::V1::Accounts::NotificationsController < Api::V1::Accounts::BaseController
RESULTS_PER_PAGE = 15
include DateRangeHelper
before_action :fetch_notification, only: [:update]
before_action :fetch_notification, only: [:update, :destroy, :snooze]
before_action :set_primary_actor, only: [:read_all]
before_action :set_current_page, only: [:index]
def index
@unread_count = current_user.notifications.where(account_id: current_account.id, read_at: nil).count
@count = notifications.count
@notifications = notifications.page(@current_page).per(RESULTS_PER_PAGE)
@unread_count = notification_finder.unread_count
@notifications = notification_finder.perform
@count = notification_finder.count
end
def read_all
@@ -28,11 +29,21 @@ class Api::V1::Accounts::NotificationsController < Api::V1::Accounts::BaseContro
render json: @notification
end
def destroy
@notification.destroy
head :ok
end
def unread_count
@unread_count = current_user.notifications.where(account_id: current_account.id, read_at: nil).count
@unread_count = notification_finder.unread_count
render json: @unread_count
end
def snooze
@notification.update(snoozed_until: parse_date_time(params[:snoozed_until].to_s)) if params[:snoozed_until]
render json: @notification
end
private
def set_primary_actor
@@ -50,7 +61,7 @@ class Api::V1::Accounts::NotificationsController < Api::V1::Accounts::BaseContro
@current_page = params[:page] || 1
end
def notifications
@notifications ||= current_user.notifications.where(account_id: current_account.id)
def notification_finder
@notification_finder ||= NotificationFinder.new(Current.user, Current.account, params)
end
end
@@ -30,7 +30,7 @@ class Api::V1::Accounts::PortalsController < Api::V1::Accounts::BaseController
ActiveRecord::Base.transaction do
@portal.update!(portal_params) if params[:portal].present?
# @portal.custom_domain = parsed_custom_domain
process_attached_logo
process_attached_logo if params[:blob_id].present?
rescue StandardError => e
Rails.logger.error e
render json: { error: @portal.errors.messages }.to_json, status: :unprocessable_entity
@@ -47,8 +47,15 @@ class Api::V1::Accounts::PortalsController < Api::V1::Accounts::BaseController
head :ok
end
def logo
@portal.logo.purge if @portal.logo.attached?
head :ok
end
def process_attached_logo
@portal.logo.attach(params[:logo])
blob_id = params[:blob_id]
blob = ActiveStorage::Blob.find_by(id: blob_id)
@portal.logo.attach(blob)
end
private
@@ -0,0 +1,28 @@
class Api::V1::Accounts::SearchController < Api::V1::Accounts::BaseController
def index
@result = search('all')
end
def conversations
@result = search('Conversation')
end
def contacts
@result = search('Contact')
end
def messages
@result = search('Message')
end
private
def search(search_type)
SearchService.new(
current_user: Current.user,
current_account: Current.account,
search_type: search_type,
params: params
).perform
end
end
@@ -0,0 +1,13 @@
class Api::V1::Accounts::UploadController < Api::V1::Accounts::BaseController
def create
file_blob = ActiveStorage::Blob.create_and_upload!(
key: nil,
io: params[:attachment].tempfile,
filename: params[:attachment].original_filename,
content_type: params[:attachment].content_type
)
file_blob.save!
render json: { file_url: url_for(file_blob), blob_key: file_blob.key, blob_id: file_blob.id }
end
end

Some files were not shown because too many files have changed in this diff Show More