Compare commits

...
1224 Commits
Author SHA1 Message Date
Shivam Mishra ce0388d9de test: remove conditions for value 2023-05-17 16:46:34 +05:30
Shivam Mishra 17052113f5 revert: priority conditions change 2023-05-17 16:37:25 +05:30
Shivam Mishra c4dd3df6ad revert: action query value change 2023-05-17 16:37:02 +05:30
Shivam Mishra ad278c5d60 refactor: update id 2023-05-17 16:14:10 +05:30
Shivam Mishra d66c95d0b6 test: actionQueryGenerator 2023-05-17 15:48:22 +05:30
Shivam Mishra 6adc1f31e9 refactor: allow checking value prop 2023-05-17 15:48:10 +05:30
Shivam Mishra 1db4850a5d feat: add value prop 2023-05-17 15:29:31 +05:30
Shivam Mishra d67c541943 feat: add better test 2023-05-17 15:28:47 +05:30
Shivam Mishra e89e213245 refactor: add js docs 2023-05-17 15:15:37 +05:30
Shivam Mishra c57a108f13 refactor: actionQueryGenerator
The previous implementation would heavily modify any parameters passed to it, this change fixes it
2023-05-17 15:11:20 +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 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 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
Sojan e054c2a32f Merge branch 'release/2.13.0'
Publish Chatwoot CE docker images / build (push) Waiting to run
2023-01-17 18:20:45 +05:30
Sojan dbe27e081e Bump version to 2.13.0 2023-01-17 18:19:12 +05:30
Pranav Raj SandGitHub f6a56edf86 feat: Add the UI flow for Microsoft Oauth (#6243) 2023-01-17 17:48:14 +05:30
Jordan BroughandGitHub 66cb0ee865 chore: Refactor code in ApplicationMailbox (#5857)
Refactor code in ApplicationMailbox

* short-circuiting as soon as we get a "true" value in some cases
* using ".exists?" instead of instantiating an ActiveRecord object
* using "match?" instead of "match"
2023-01-17 17:30:03 +05:30
Prithvi TharunandGitHub 74b9c79f49 Fixes #3670 (#6265)
Success toast content for copy action made generic that fits all the context and scenarios.
2023-01-17 15:45:59 +05:30
Jan MatuszewskiandGitHub d46f96e45c Fix performance of report builder spec (#6024) 2023-01-17 09:27:50 +05:30
Chatwoot BotandGitHub 032699930c chore: Update translations from Crowdin (#6240) 2023-01-16 16:07:00 -08:00
Pranav Raj SandGitHub 16085fdfbd fix: Add missing translations (#6263) 2023-01-16 15:43:18 -08:00
00cbdaa8ca Feat: Support for Microsoft Oauth in Email Channel (#6227)
- Adds the backend APIs required for Microsoft Email Channels

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
Co-authored-by: Sojan <sojan@pepalo.com>
2023-01-17 02:39:05 +05:30
Pranav Raj SandGitHub d0972a22b4 chore: Update styles for canned response (#6262) 2023-01-16 12:40:13 -08:00
e707778490 feat: Revamp editor for message and article (#6145)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-01-16 09:08:47 -08:00
0d894e0abc fix: Add animation to live chat trigger button (#6252)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-01-16 09:07:10 -08:00
Sojan JoseandGitHub 72f206025a chore: Fix connection pool (#6005)
We want to allocate as much database connection to the pool to match the sidekiq concurrency configuration.
ref: https://maxencemalbois.medium.com/the-ruby-on-rails-database-connections-pool-4ce1099a9e9f

fixes: #6004
2023-01-16 17:50:23 +05:30
70cb0a8ed9 fix: Use account locale as the default locale on widget (#6248)
* fix: Use account locale as the default locale on widget

* Refactors check for invalid locale

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-01-16 12:14:35 +05:30
d488a42664 feat: Allow disconnecting agent bots (#6245)
* Allow disconnecting the bot

* Code Climate fix

* Show error message if exists

* Codeclimate test - rename file

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-01-13 22:28:45 +05:30
ooooooo_qandGitHub 9e4a5d028c fix: Path traversal at SwaggerController (#6205) 2023-01-12 23:44:21 +05:30
Pranav Raj SandGitHub 9bbadc2388 chore: Create a resuable component for selecting a channel (#6241) 2023-01-11 21:13:51 -08:00
Sojan JoseandGitHub ad782e450e fix: Stop processing broken liquid tags (#6236) 2023-01-11 17:41:02 +05:30
Fayaz AhmedandGitHub 98eb20d600 Use the table-layout: fixed prop (#6232) 2023-01-11 11:37:30 +05:30
0ba5e47308 chore: Update the widescreen layout button icon and background (#6217)
* Update the button icon and background

* Use the woot-button

* Minor css cleanup

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Nithin David <1277421+nithindavid@users.noreply.github.com>
2023-01-11 00:40:48 +05:30
d041f5fc9f fix: Fixes inconsistent spacing in message bubble (#6219)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-01-10 20:51:21 +05:30
Sivin VargheseandGitHub 14382ad881 fix: Not able to create a portal if the custom domain is empty (#6224) 2023-01-10 20:50:35 +05:30
Sojan JoseandGitHub c16624dc5d fix: Duplicate messages in Whatsapp Channel (#6220)
fixes: #5433
2023-01-10 18:57:34 +05:30
Fayaz AhmedandGitHub 60f16e8954 Use woot-editor instead of native textarea (#6216) 2023-01-10 17:50:16 +05:30
078ff615ee feat: Add support for template variables in messages content (#6215)
Fixes: #6078

Co-authored-by: Sojan <sojan@pepalo.com>
2023-01-10 16:00:34 +05:30
Sivin VargheseandGitHub e7a52c3a46 fix: If desktop view is false then the view not getting updated (#6214)
* fix: Desktop view is false then the view not getting updated

* chore: Handle sidebar in small screen

* fix: Scroll issue in touch screens
2023-01-10 15:36:16 +05:30
add33d032c feat: Adds automation view for assigning an agent (#6131)
* feat: Adds automation view for assigning an agent

Co-authored-by: Tejaswini Chile <tejaswini@chatwoot.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-01-10 11:35:56 +05:30
Sojan JoseandGitHub 28c8023bad chore: Update translations (#6211) 2023-01-09 21:23:11 -08:00
817ec4c50f fix: Fix the default article sidebar state (#6191)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-01-09 20:16:53 -08:00
ffb4bd0109 feat: Add the support for video calls with Dyte in the live-chat widget (#6208)
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: iamsivin <iamsivin@gmail.com>
2023-01-09 11:52:31 -08:00
24cf7af30b feat: Add video call option with Dyte in the dashboard (#6207)
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-01-09 11:49:27 -08:00
0a65a233d7 fix: Invalid portal domain validation (#6166)
* fix: Invalid portal domain validation


Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-01-09 13:42:19 +05:30
4172cb4b23 feat: Uses expanded layout as default if the breakpoint is less than or equal to 992px (#6134)
* feat: Uses expanded layout as default if the breakpoint is below 992px

* fixes: ES lint issue

* chore: Review fixes

* chore: Hide toggle sidebar menu in profile settings

* chore: Fix login screen

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

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

* chore: Review fixes

* chore: Review fixes

Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
2023-01-09 13:26:31 +05:30
Pranav Raj SandGitHub cbfbe6dbad feat: Add backend APIs for Dyte integration (#6197)
- The backend changes required for Dyte Integration.
2023-01-09 12:37:18 +05:30
Shivam MishraandGitHub 50894fd591 fix: Add padding for an empty state (#6190) 2023-01-06 13:44:30 -08:00
Sojan JoseandGitHub fbdc921ee5 chore: Fix sentry errors for Instagram channel (#6189)
fixes: #6188
2023-01-06 17:18:31 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Pranav Raj S
3beafe31f8 chore(deps): bump express from 4.17.1 to 4.18.2 (#6030)
Bumps [express](https://github.com/expressjs/express) from 4.17.1 to 4.18.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.17.1...4.18.2)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-01-06 16:01:43 +05:30
74c6db37b3 fix: Fixes broken style in automation page (#6171)
* fix: Fixes broken style in automation page

* Fix the position of drag handle

Co-authored-by: fayazara <fayazara@gmail.com>
Co-authored-by: Fayaz Ahmed <15716057+fayazara@users.noreply.github.com>
2023-01-06 15:37:28 +05:30
Hricha ShandilyandGitHub 4bbd56f87d chore: Update error message in Custom Attributes (#6187) 2023-01-06 13:58:05 +05:30
Shivam MishraandGitHub b9ae664d47 fix: Update incorrect label for team selection (#6180) 2023-01-05 19:35:11 -08:00
Sojan JoseandGitHub 269ad8f697 Fix: Errors in Heroku deployments (#6182)
Due to 86ca7f4a8d the redis configuration in Heroku deployments was breaking, temporarily reverting the part until we identify a fix.

fixes: #5938
2023-01-05 18:36:21 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
9cb75b55f7 chore(deps): bump json5 from 1.0.1 to 1.0.2 (#6168)
Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-05 14:30:41 +05:30
Pranav Raj SandGitHub fc06ee7726 fix: Update the page size to 15, change default sort to last_activity (#6177) 2023-01-04 15:39:03 -08:00
Sojan JoseandGitHub 88053c60c7 chore: Update translations (#6160) 2023-01-04 11:03:02 -08:00
OMAR.AandGitHub 7b5f1e4876 feat: Support for telegram incoming location message (#6158)
Support for incoming location messages in the telegram channel.

ref: #3398
2023-01-04 16:11:54 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
c88ea257d5 chore(deps): bump httparty from 0.20.0 to 0.21.0 (#6164)
Bumps [httparty](https://github.com/jnunemaker/httparty) from 0.20.0 to 0.21.0.
- [Release notes](https://github.com/jnunemaker/httparty/releases)
- [Changelog](https://github.com/jnunemaker/httparty/blob/master/Changelog.md)
- [Commits](https://github.com/jnunemaker/httparty/compare/v0.20.0...v0.21.0)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-04 14:35:57 +05:30
Pranav Raj SandGitHub dd0d221cfc 2022 -> 2023 2023-01-01 22:12:22 -08:00
Sojan JoseandGitHub ab87f9d6c0 chore: Update translations (#6159) 2023-01-01 21:40:15 -08:00
e3f13dd455 choreButtons must have discernible text (#6132)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-01-01 21:39:38 -08:00
Pranav Raj S 4941c93cb0 Merge branch 'develop'
Publish Chatwoot CE docker images / build (push) Waiting to run
2022-12-30 13:58:18 -08:00
Pranav Raj S c11eebb83a Bump version to v2.12.1 2022-12-30 13:54:37 -08:00
Pranav Raj S 69bed3e08d fix: Update unread_messages count in WhatsApp inboxes (#6154)
* fix: Update unread_count from backend instead of computing on the frontend

* Fix spec

* Remove status indicator on private notifications

* CodeClimate fix

* CodeClimate
2022-12-30 13:54:37 -08:00
Sojan JoseandPranav Raj S cf48610f2f chore: Update translations (#6152) 2022-12-30 13:54:37 -08:00
Nithin David ThomasandPranav Raj S b179d1b563 chore: Refactor shortcuts modal to use modal component (#6151)
* chore: Refactor SHortcuts modal to use modal component

* Typography changes
2022-12-30 13:54:37 -08:00
Sivin VargheseandPranav Raj S 34e509b9b7 feat: Adds the ability to play audio alert every 30 sec (#6150)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-12-30 13:54:37 -08:00
Pranav Raj S 6ffb7fe34e chore: Refactor audio notification helper (#6148) 2022-12-30 13:54:37 -08:00
Pranav Raj S 297e144f33 fix: Update account limit selection logic (#6149) 2022-12-30 13:54:37 -08:00
Sivin VargheseandPranav Raj S 02a687b226 feat: Add new audio alert options (#6141)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-12-30 13:54:37 -08:00
Sojan JoseandPranav Raj S 10a03cae24 chore: Update translations (#6129) 2022-12-30 13:54:37 -08:00
Sivin VargheseandPranav Raj S e446a12ebb chore: Fixes issue showing the CSAT error message (#6136)
Approved by Muhsin
2022-12-30 13:54:37 -08:00
Nithin David ThomasandPranav Raj S 00eabe07a4 fix: Expand title height of textarea on load (#6103) 2022-12-30 13:54:37 -08:00
Sojan JoseandPranav Raj S 78251f54c9 chore: Update translations (#6113) 2022-12-30 13:54:37 -08:00
d55988a6e0 feat: Add the ability to toggle the secondary sidebar in all display breakpoints (#6118)
Co-authored-by: Nithin David <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-12-30 13:54:37 -08:00
Muhsin KelothandPranav Raj S 37aa602c61 chore: Increase the max concurrent number of devices (#6121) 2022-12-30 13:54:37 -08:00
Sivin VargheseandPranav Raj S aba5a1a131 chore: Helpcenter improvements (#6098) 2022-12-30 13:54:37 -08:00
94ca2fd229 feat: Send audio longer than 10 seconds and Add Prop audio-record-format (#6108)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2022-12-30 13:54:37 -08:00
Pranav Raj S a3e5aad753 fix: Update the logic to show read status for web (#6107) 2022-12-30 13:54:37 -08:00
Sivin VargheseandPranav Raj S 8e13a06833 fix: Use canned response menu from the editor in contact messages (#6109) 2022-12-30 13:54:37 -08:00
Sivin VargheseandPranav Raj S 38f9c3940b chore: Hide inbox name only has one inbox (#6115) 2022-12-30 13:54:37 -08:00
Pranav Raj S e026dc03e0 Merge branch 'release/2.12.1' 2022-12-30 13:49:57 -08:00
Pranav Raj S d911d38391 Bump version to v2.12.1 2022-12-30 13:49:09 -08:00
Pranav Raj SandGitHub 5d1be70e67 fix: Update unread_messages count in WhatsApp inboxes (#6154)
* fix: Update unread_count from backend instead of computing on the frontend

* Fix spec

* Remove status indicator on private notifications

* CodeClimate fix

* CodeClimate
2022-12-30 13:13:33 -08:00
Sojan JoseandGitHub 12b45f5c76 chore: Update translations (#6152) 2022-12-30 09:38:28 -08:00
Nithin David ThomasandGitHub 9f842bcd59 chore: Refactor shortcuts modal to use modal component (#6151)
* chore: Refactor SHortcuts modal to use modal component

* Typography changes
2022-12-30 22:26:16 +05:30
4fba9ef1fb feat: Adds the ability to play audio alert every 30 sec (#6150)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-12-29 22:16:58 -08:00
Pranav Raj SandGitHub cd3b6ebf28 chore: Refactor audio notification helper (#6148) 2022-12-29 20:01:14 -08:00
Pranav Raj SandGitHub 11f6e6bc61 fix: Update account limit selection logic (#6149) 2022-12-29 19:37:36 -08:00
e5fd866a7c feat: Add new audio alert options (#6141)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-12-29 10:21:23 -08:00
Sojan JoseandGitHub e5219df2b4 chore: Update translations (#6129) 2022-12-28 13:56:49 -08:00
Sivin VargheseandGitHub 98c289dc3e chore: Fixes issue showing the CSAT error message (#6136)
Approved by Muhsin
2022-12-28 12:49:11 +05:30
Nithin David ThomasandGitHub 3e91765472 fix: Expand title height of textarea on load (#6103) 2022-12-22 14:14:30 -08:00
Sojan JoseandGitHub 1bf23055df chore: Update translations (#6113) 2022-12-22 14:08:08 -08:00
2af337be10 feat: Add the ability to toggle the secondary sidebar in all display breakpoints (#6118)
Co-authored-by: Nithin David <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-12-22 14:07:11 -08:00
Muhsin KelothandGitHub dbb6c0a074 chore: Increase the max concurrent number of devices (#6121) 2022-12-22 19:13:54 +05:30
Sivin VargheseandGitHub 8c88344170 chore: Helpcenter improvements (#6098) 2022-12-22 18:51:24 +05:30
6a78254701 feat: Send audio longer than 10 seconds and Add Prop audio-record-format (#6108)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2022-12-22 13:36:03 +05:30
Pranav Raj SandGitHub 26ada8b342 fix: Update the logic to show read status for web (#6107) 2022-12-21 09:58:56 -08:00
Sivin VargheseandGitHub 3c6bd2c8fd fix: Use canned response menu from the editor in contact messages (#6109) 2022-12-21 16:01:50 +05:30
Sivin VargheseandGitHub 2c2c47d7fd chore: Hide inbox name only has one inbox (#6115) 2022-12-21 13:31:53 +05:30
Sojan 34f7405689 Merge branch 'release/2.12.0' into develop 2022-12-19 22:48:01 +05:30
Sojan 56b1388339 Merge branch 'release/2.12.0'
Publish Chatwoot CE docker images / build (push) Waiting to run
2022-12-19 22:47:50 +05:30
Sojan 3ebfb3a140 Bump version to 2.12.0 2022-12-19 22:44:43 +05:30
Pranav Raj SandGitHub 2dfe38ae4d chore: Cleanup feature flags (#6096)
- Add more feature flags for CRM, auto_resolution, and reports
- Add a SuperAdmin link in the sidebar if the user is a super-admin
- SuperAdmin could view all the features on an account irrespective of whether the feature is enabled.
2022-12-19 22:38:30 +05:30
Sojan JoseandGitHub ca88eb55f4 chore: Update translations from Crowdin 2022-12-19 22:34:49 +05:30
Nithin David ThomasandGitHub d1a26e80f4 fix: Hide show more labels button when there's no overflow (#6097) 2022-12-19 08:54:20 -08:00
022d0b0ea3 chore: Enable prototyping classes for foundation (#5945)
* chore: Enable prototyping classes for foundation

* Marcros css clean up

* Imports utilities separately

* Fix macro position

* Changes global margin

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2022-12-19 14:11:11 +05:30
Tejaswini ChileandGitHub 5541d9e00b Fix: automation email improvement (#6061) 2022-12-19 13:21:33 +05:30
Pranav Raj SandGitHub 38587b3aa1 fix: Update Slack integration to fix message delivery issues (#6093) 2022-12-17 16:41:11 -08:00
4d2b7c37a0 feat: Display labels in the conversation card (#6088)
Co-authored-by: Nithin David Thomas <webofnithin@gmail.com>
2022-12-17 13:11:28 -08:00
aaacf9d4d2 feat: Allow users to disable marking offline automatically (#6079)
Co-authored-by: Nithin David <1277421+nithindavid@users.noreply.github.com>
2022-12-16 11:59:27 -08:00
Sivin VargheseandGitHub 82d3398932 fix: Add improvements to the Help Center module (#6081) 2022-12-16 11:41:55 -08:00
9106f6278d fix: Allow editing label and placeholder for standard attributes in pre chat form (#6067)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2022-12-15 09:36:18 -08:00
f8e6308caf chore: [Snyk] Fix for 7 vulnerabilities (#6075)
* fix: Gemfile to reduce vulnerabilities

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-RUBY-LOOFAH-3168317
- https://snyk.io/vuln/SNYK-RUBY-LOOFAH-3168318
- https://snyk.io/vuln/SNYK-RUBY-LOOFAH-3168649
- https://snyk.io/vuln/SNYK-RUBY-RAILSHTMLSANITIZER-3168316
- https://snyk.io/vuln/SNYK-RUBY-RAILSHTMLSANITIZER-3168646
- https://snyk.io/vuln/SNYK-RUBY-RAILSHTMLSANITIZER-3168647
- https://snyk.io/vuln/SNYK-RUBY-RAILSHTMLSANITIZER-3168648

* chore: update gemlock

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2022-12-15 16:40:50 +05:30
Sojan JoseandGitHub 72fcaa739c chore: Update translations from Crowdin 2022-12-15 14:11:15 +05:30
9292653bf9 fix: Update enabled_features logic to fix superadmin edit action (#5959)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-12-14 18:24:02 -08:00
2a1a38f986 chore: Add feature flags for campaigns and website channel (#5778)
Co-authored-by: Tejaswini Chile <tejaswini@chatwoot.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-12-14 16:06:26 -08:00
2972319026 fix: Update colors in widget buttons to fix invalid colors (#6033)
Co-authored-by: nithindavid <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-12-14 15:21:20 -08:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
26e05de642 chore(deps): bump loofah from 2.18.0 to 2.19.1 (#6072)
Bumps [loofah](https://github.com/flavorjones/loofah) from 2.18.0 to 2.19.1.
- [Release notes](https://github.com/flavorjones/loofah/releases)
- [Changelog](https://github.com/flavorjones/loofah/blob/main/CHANGELOG.md)
- [Commits](https://github.com/flavorjones/loofah/compare/v2.18.0...v2.19.1)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-14 12:51:36 -08:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
8222a47154 chore(deps): bump rails-html-sanitizer from 1.4.3 to 1.4.4 (#6074)
Bumps [rails-html-sanitizer](https://github.com/rails/rails-html-sanitizer) from 1.4.3 to 1.4.4.
- [Release notes](https://github.com/rails/rails-html-sanitizer/releases)
- [Changelog](https://github.com/rails/rails-html-sanitizer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rails/rails-html-sanitizer/compare/v1.4.3...v1.4.4)

---
updated-dependencies:
- dependency-name: rails-html-sanitizer
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-14 12:51:12 -08:00
9d78f0d6c6 feat: Adds number validation for WhatsApp inbox at the creation step (#6043)
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
2022-12-12 19:52:37 -08:00
Sivin VargheseandGitHub 86958278cd fix: Unable to save automation "send email to team" (#6052)
* fix: Unable to save automation "send email to team"

* chore: Minor fixes
2022-12-12 20:10:33 +05:30
Pranav Raj SandGitHub 823c836906 feat: Allow wildcard URL in the campaigns (#6056) 2022-12-09 16:43:09 -08:00
Pranav Raj SandGitHub 6200559123 chore: Update analytics events (#6050) 2022-12-08 20:53:13 -08:00
Tejaswini ChileandGitHub 7dc790a7e0 fix: Automatically remove expired story mention (#5300)
When a user mentions the connected Instagram page in a story, the story's content is downloaded in Chatwoot, then if the user deletes the story, the content persists in the platform.

fixes: #5258
2022-12-08 15:55:24 +03:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
431e2931c4 chore(deps): bump nokogiri from 1.13.9 to 1.13.10 (#6040)
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.9 to 1.13.10.
- [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.13.9...v1.13.10)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-08 14:01:52 +03:00
Pranav Raj SandGitHub 52ea201070 fix: Remove duplicate submit action (#6039) 2022-12-07 16:28:45 -08:00
779bcf5e0d feat: Update Signup screen (#6002)
* feat: Update Signup page designs

* feat: Update the signup page with dynamic testimonials

* Remove the images

* chore: Minor UI fixes

* chore: Form aligned to centre

* Update app/javascript/dashboard/routes/auth/components/Signup/Form.vue

* Design improvements

* Update company name key

* Revert "chore: Minor UI fixes"

This reverts commit 1556f4ca835d9aa0d9620fd6a3d52d259f0d7d65.

* Revert "Design improvements

This reverts commit dfb2364cf2f0cc93123698fde92e5f9e00536cc2.

* Remove footer

* Fix spacing

* Update app/views/installation/onboarding/index.html.erb

Co-authored-by: iamsivin <iamsivin@gmail.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
2022-12-07 15:55:03 -08:00
Pranav Raj SandGitHub 6064aad38f chore: Add business email validation on signup (#6037) 2022-12-07 13:03:51 -08:00
caa45d1d92 feat: Pass logged in agent context to dashboard app (#6034)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-12-07 12:02:27 -08:00
f1d1bb84fd fix: Filters are not applied unless I'm on the All Conversations screen (#6006)
* fix: Filters are not applied unless I'm on the All Conversations screen

* chore: Review fixes

* chore: Minor sidebar fixes

* chore: Review fixes

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-12-07 12:00:51 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
01cc3d7c9c chore(deps): bump qs from 6.5.2 to 6.5.3 (#6028)
Bumps [qs](https://github.com/ljharb/qs) from 6.5.2 to 6.5.3.
- [Release notes](https://github.com/ljharb/qs/releases)
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ljharb/qs/compare/v6.5.2...v6.5.3)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-06 12:49:00 -08:00
Sivin VargheseandGitHub 89cfc5bbf3 fix: Send message with "enter" also do new line (#5961)
* fix: Send message with "enter" also do new line

* chore: Review fixes

* chore: Naming fixes

* chore: Minor fixes

* chore: Fix line break issue when cmd plus enter enabled
2022-12-06 11:25:49 +05:30
OMAR.AandGitHub a82b9991b3 fix: Update the link used for email address change in the confirmation mail (#5937) 2022-12-05 16:17:27 -08:00
Sojan JoseandGitHub 06434bc655 chore: Update translations from Crowdin (#5952) 2022-12-05 16:04:49 -08:00
Jordan BroughandGitHub b9fd1d88ea Escape search term before building regular expression (#5994)
When doing a conversation search, if the search term includes any regular
expression characters and the search returns results, then this function would
throw an exception.

For example, if a conversation includes the text "+15555550111" and you search
for "+15555550111" then you get an exception like:

> Invalid regular expression: /(+15555550111)/: Nothing to repeat

Because the "+" is not escaped.
2022-12-05 16:02:43 -08:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
8004f67efe chore(deps): bump decode-uri-component from 0.2.0 to 0.2.2 (#6016)
Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2.
- [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases)
- [Commits](https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.2)

---
updated-dependencies:
- dependency-name: decode-uri-component
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-05 16:01:27 -08:00
Sivin VargheseandGitHub 87ef39ad9c feat: Add the ability to search emojis (#5928) 2022-12-05 16:00:42 -08:00
Vishnu NarayananandGitHub c3b6e1a732 fix: update heroku app.json to use premium plans (#5349)
* fix: update heroku app.json to use premium plans

Use premium/paid dynos and addons as Heroku is set to deprecate free dynos/addons.

* fix: set default stack to heroku-20

* chore: update heroku app.json to use new dyno types

web and worker to use basic dynos
redis and postgres to use mini
2022-12-05 21:15:44 +05:30
Muhsin KelothandGitHub c9cae01cb4 fix: Support audio in safari browser (#5943) 2022-12-05 12:30:56 +05:30
Sivin VargheseandGitHub 613fb0b064 fix: Unable to add emoji exactly where the cursor is at (#5865)
* fix: Unable to add emoji exactly where the cursor is at

* chore: Minor fixes

* chore: Review fixes

* chore: Code clean up

* chore: Review fixes

* chore: Minor fixes

* chore: Review fixes
2022-12-05 11:16:00 +05:30
Tejaswini ChileandGitHub 0b5c82ad5f fix: Save hostname for the custom domain in the portal (#5984)
* fix: Save hostname for the custom domain in the portal
2022-12-03 20:37:56 +05:30
c8ec397c79 fix: Update missing features in unattended / mentions view (#6009)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-12-02 15:07:38 -08:00
Tejaswini ChileandGitHub a08099bbcc fix: Custom attr filter on conversations (#5978) 2022-12-02 10:37:32 +05:30
Pranav Raj SandGitHub e35638588a fix: Avoid conversationId getting undefined in unattended view (#6001) 2022-11-30 20:37:58 -08:00
3083f74d45 fix: Update inbox json, removing password (#5981)
- Filter restricted inbox attributes in APIs for agents 

Fixes chatwoot/product#668

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2022-11-30 13:04:46 +03:00
85b52a1d3f feat: Add a view for unattended conversations (#5890)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-11-29 08:18:00 -08:00
Nithin David ThomasandGitHub c94ba16565 fix: Updates logic to insert canned response into editor (#5880)
* fix: Updates logic to insert canned response into editor

* Removes commented code

* Parse incoming canned text as markdown
2022-11-29 19:46:55 +05:30
0cad3bed71 fix: Files in Whatsapp arrives with a different Name (#5907)
- Add file name parameter to the WhatsApp attachment payload

fixes: #4481

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2022-11-29 16:54:49 +03:00
edcbd53425 feat: Read/Delivery status for Whatsapp Cloud API (#5157)
Process field statuses received in webhook WhatsApp cloud API

ref: #1021

Co-authored-by: Sojan <sojan@pepalo.com>
Co-authored-by: Nithin David <1277421+nithindavid@users.noreply.github.com>
2022-11-29 15:51:37 +03:00
Tejaswini ChileandGitHub a397f01692 fix: unassign team activity message (#5969) 2022-11-29 13:35:08 +05:30
Vishnu NarayananandGitHub 4755031e1d feat: use sendmail for email as default (#5899)
* feat: use sendmail for the email if SMTP_ADDRESS is empty
2022-11-29 09:13:27 +05:30
Tejaswini ChileandGitHub fc9fc5a661 fix: destroy bulk service (#5921) 2022-11-25 22:46:50 +05:30
b05d06a28a feat: Ability to lock to single conversation (#5881)
Adds the ability to lock conversation to a single thread for Whatsapp and Sms Inboxes when using outbound messages.

demo: https://www.loom.com/share/c9e1e563c8914837a4139dfdd2503fef

fixes: #4975

Co-authored-by: Nithin David <1277421+nithindavid@users.noreply.github.com>
2022-11-25 13:01:04 +03:00
Vishnu NarayananandGitHub 8813c77907 chore: add ph-no-capture css class to messages (#5932)
This ensure posthog replaces the corresponding elements with an empty
block in recordings.

ref: https://posthog.com/manual/recordings#ignoring-sensitive-elements
2022-11-24 10:42:28 -08:00
Sojan JoseandGitHub 8ea0660862 chore: Add reauthorization prompt for Whatsapp Channel (#5929)
- Add reauthorization prompt for Whatsapp Channel

fixes: #5782
2022-11-24 14:50:32 +03:00
606fc9046a feat: Allow users to mark a conversation as unread (#5924)
Allow users to mark conversations as unread.
Loom video: https://www.loom.com/share/ab70552d3c9c48b685da7dfa64be8bb3

fixes: #5552

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-11-24 10:55:45 +03:00
Pranav Raj SandGitHub e593e516b8 chore: Enable Latvian (lv) language (#5920) 2022-11-22 12:54:13 -08:00
Sojan JoseandGitHub b5f8524167 chore: Update translations from Crowdin (#5883) 2022-11-22 11:42:29 -08:00
Sivin VargheseandGitHub b765e17457 fix: Sidebar missing at 1200px width (#5917) 2022-11-22 10:48:15 -08:00
Fayaz AhmedandGitHub db37bfea06 fix: Add word-break to canned response list table content 2022-11-22 23:53:15 +05:30
Pranav Raj SandGitHub 16bfd68d95 chore: Allow admins to choose the agent bot from the UI (#5895) 2022-11-18 08:54:32 -08:00
Fayaz AhmedandGitHub 33aacb3401 Add team option in bulk actions (#5885) 2022-11-18 14:44:36 +05:30
47676c3cce feat: Allow agent-bots to be created from the UI (#4153)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-11-17 22:15:58 -08:00
Tejaswini ChileandGitHub 9bfbd528ef feat: Assign team with teams none option (#5871) 2022-11-17 14:15:16 +05:30
Tejaswini ChileandGitHub e85f998a08 feat: Remove labels in macro (#5875) 2022-11-17 12:30:47 +05:30
Pranav Raj SandGitHub 66044a0dc3 feat: Show last non-activity messages in the chat list (#5864) 2022-11-16 15:43:55 -08:00
Pranav Raj SandGitHub 9b9c019de0 feat: Add support for after param in messages API (#5861) 2022-11-16 08:11:48 -08:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
86e0ff76c5 chore(deps): bump loader-utils from 1.4.1 to 1.4.2 (#5859)
Bumps [loader-utils](https://github.com/webpack/loader-utils) from 1.4.1 to 1.4.2.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.2/CHANGELOG.md)
- [Commits](https://github.com/webpack/loader-utils/compare/v1.4.1...v1.4.2)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-15 18:56:59 -08:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
abbb6ac676 chore(deps): bump minimatch from 3.0.4 to 3.1.2 (#5860)
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2.
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-15 18:56:50 -08:00
Pranav Raj SandGitHub 42b466bda2 chore: Cleanup the design in widget builder (#5852) 2022-11-15 18:56:24 -08:00
Sojan 956837ded5 Merge branch 'release/2.11.0' into develop 2022-11-16 00:45:43 +00:00
Sojan 8a0d6f6f50 Merge branch 'release/2.11.0'
Publish Chatwoot CE docker images / build (push) Waiting to run
2022-11-16 00:45:34 +00:00
Sojan f0ef497005 Bump version to 2.11.0 2022-11-16 00:40:38 +00:00
Sojan JoseandGitHub 8e2da837d4 chore: Update translations from Crowdin 2022-11-16 00:37:29 +00:00
Sojan JoseandGitHub e7f1a9ab4d chore: Enable Macros for all accounts (#5858)
- migrations to enable macros for all accounts
2022-11-16 00:33:09 +00:00
Tejaswini ChileandGitHub 826a735cdb fix: Assign agent action changes (#5827) 2022-11-15 13:15:27 +05:30
Tejaswini ChileandGitHub 38ab3c36db fix: send label list not object in event data presenter (#5853) 2022-11-15 12:20:06 +05:30
b5f7be0cd2 fix: Full name update when creating a conversation without an email id (#5832)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-11-14 19:39:46 -08:00
Tejaswini ChileandGitHub efceaec950 fix: Activity message generation for team assignemnt automation (#5846) 2022-11-11 19:07:24 +05:30
Fayaz AhmedandGitHub 6aba352e0d fix: Single select for agents and teams in Macros actions (#5837)
* Ignore settings.json

* Single select dropdown for teams and agents
2022-11-10 20:09:33 +05:30
9eb861a3b7 feat: Custom attributes in automations and refactor (#4548)
* Custom attributes

* Custom Attrs Manifest

* Fix dropdown values for custom attributes

* Handle edit mode for custom attributes

* Ported duplicate logic to a mixin

* fix Code climate issue

* Fix Codeclimate complexity warning

* Bug fix - Custom attributes getting duplicated

* Bug fixes and Code Climate issue fix

* Code Climate Issues Breakdown

* Fix test spec

* Add labels for Custom attributes in dropdown

* Refactor

* Refactor Automion mixin

* Refactor Mixin

* Refactor getOperator

* Fix getOperatorType

* File name method refactor

* Refactor appendNewCondition

* spec update

* Refactor methods

* Mixin Spec update

* Automation Mixins Test Specs

* Mixin Spec Rerun

* Automation validations mixin spec

* Automation helper test spec

* Send custom_attr key

* Fix spec fixtures

* fix: Changes for custom attribute type and lower case search

* fix: Specs

* fix: Specs

* fix: Ruby version change

* fix: Ruby version change

* Removes Lowercased values and fix label value in api payload

* Fix specs

* Fixed Query Spec

* Removed disabled labels if no attributes are present

* Code Climate Fixes

* fix: custom attribute with indifferent access

* fix: custom attribute with indifferent access

* Fix specs

* Minor label fix

* REtrigger circle ci build

* Update app/javascript/shared/mixins/specs/automationMixin.spec.js

* Update app/javascript/shared/mixins/specs/automationMixin.spec.js

* fix: Custom attribute case insensitivity search

* Add missing reset action method to input

* Set team_input to single select instead of multiple

* fix: remove value case check for date,boolean and number data type

* fix: cognitive complexity

* fix: cognitive complexity

* fix: Fixed activity message for automation system

* fix: Fixed activity message for automation system

* fix: Fixed activity message for automation system

* fix: codeclimate

* fix: codeclimate

* fix: action cable events for label update

* fix: codeclimate, conversation modela number of methods

* fix: codeclimate, conversation modela number of methods

* fix: codeclimate, conversation modela number of methods

* fix: codeclimate, conversation modela number of methods

* Fix margin bottom for attachment button

* Remove margin bottom to avoid conflict from macros

* Fix automation action query generator using the right key

* fix: not running message created event for activity message

* fix: not running message created event for activity message

* codeclimate fix

* codeclimate fix

* codeclimate fix

* Update app/javascript/dashboard/mixins/automations/methodsMixin.js

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

* Update app/javascript/shared/mixins/specs/automationHelper.spec.js

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

* Update app/javascript/dashboard/helper/automationHelper.js

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

* Update app/javascript/dashboard/mixins/automations/methodsMixin.js

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

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
Co-authored-by: Tejaswini <tejaswini@chatwoot.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Sojan Jose <sojan@pepalo.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2022-11-10 10:53:29 +05:30
Sojan JoseandGitHub 3184c8964d chore: Update translations from Crowdin (#5831) 2022-11-09 20:26:30 -08:00
865346223b fix: Add missing dropdown method (#5830)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-11-09 17:27:04 -08:00
Nithin David ThomasandGitHub 4f82859bba chore: Design improvements for thumbnail and dropdown (#5822) 2022-11-09 16:52:30 -08:00
47c90e2085 feat: Add a loader till the dashboard app is loaded (#5814)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2022-11-09 10:06:09 -08:00
7352b928da feat: Add assign agent option in macro (#5821)
Co-authored-by: fayazara <fayazara@gmail.com>
2022-11-09 09:52:48 -08:00
Muhsin KelothandGitHub 5febdde938 chore: Add feature flag for mobile v2 (#5797) 2022-11-08 21:56:02 -08:00
Nithin David ThomasandGitHub d39ace5a6b feat: Improve image loading for thumbnails (#5823) 2022-11-08 21:05:13 -08:00
Sojan JoseandGitHub e2059cfc5b fix: SocketError: getaddrinfo: for imap channels (#5824)
fixes: #5431
2022-11-08 20:23:46 -08:00
Sojan JoseandGitHub 2e42821c48 chore: Update translations from Crowdin (#5810) 2022-11-08 09:36:24 -08:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
16d59f4bb0 chore(deps): bump loader-utils from 1.4.0 to 1.4.1 (#5816)
Bumps [loader-utils](https://github.com/webpack/loader-utils) from 1.4.0 to 1.4.1.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.1/CHANGELOG.md)
- [Commits](https://github.com/webpack/loader-utils/compare/v1.4.0...v1.4.1)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-08 09:33:35 -08:00
0d9ed0674b feat: Add store for conversation watchers (#5808)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-11-08 09:33:14 -08:00
6ff0c93659 feat: Ability to receive location on whatsapp inbox (#5742)
- Ability to  receive location messages on WhatsApp Inbox

ref: https://github.com/chatwoot/chatwoot/issues/3398

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2022-11-07 21:36:47 -08:00
Nithin David ThomasandGitHub 20406dce01 feat: Adds component to show location based messages (#5809)
- Adds a component to show location-type messages in the dashboard
2022-11-07 20:50:07 -08:00
smartdev58andGitHub b50890d1b5 chore: Update data format for platform API feature management (#5718)
Updated JSON data format for Platform API for account creation update API endpoints features flags to accept false values on each feature. 

fixes: #5717
2022-11-07 17:49:45 -08:00
Tejaswini ChileandGitHub 48373628a1 fix: Macros authorizations (#5779)
Macros policy update.

ref: #5730
2022-11-07 17:46:00 -08:00
CristianDutaandGitHub 479d88a480 fix: Identifier not persisted on customer created via Inbox API Channel (#5804)
- Fixes the identifier not being used to identify the contact, this results in having a new contact created every time the email or phone is not supplied.

Fixes: #5704
2022-11-07 16:02:45 -08:00
Pranav Raj SandGitHub 526722dffa fix: Update invalid payload for template messages (#5802) 2022-11-07 15:21:47 -08:00
Tejaswini ChileandGitHub a23974d8b9 Feat/5733 Add private note action in macros (#5805) 2022-11-07 22:12:10 +05:30
matenautaandGitHub 894234e777 chore: Remove quotes from SMTP_USERNAME (#5800)
Removing quotes related to https://github.com/chatwoot/chatwoot/issues/4787
2022-11-06 16:06:18 -08:00
Nithin David ThomasandGitHub dc3ee3464b feat: Add component for grouped thumbnails (#5796) 2022-11-03 22:38:45 -07:00
Pranav Raj SandGitHub 4bb5e812ba fix: Allow ending the conversation if snoozed or pending (#5793) 2022-11-03 13:47:24 -07:00
Nithin David ThomasandGitHub 8bd5ba187a fix: Fix widget thumbnail not rendering background colors (#5791) 2022-11-02 22:13:12 -07:00
mjattiotandGitHub c121b44df4 fix: GCP Redis managed don't support redis client setname command (#4422)
If using Redis on GCP, actionable will attempt to use the Redis client setname command. However, the command is not supported.
So Introducing `REDIS_DISABLE_CLIENT_COMMAND` environment variable will let you solve this issue. 

ref: https://github.com/rails/rails/issues/38244#issuecomment-575454444
2022-11-02 19:14:51 -07:00
CristianDutaandGitHub 4c43330b15 feat: Add inbox details endpoint (#5549)
This change targets the public API and is related to the Inbox with channel type API.
Exposes public inbox details under /public/api/v1/inboxes/{inbox_identifier}. This allows access to feature flags and business hours configured for the inbox.

ref: #5514
2022-11-02 19:05:03 -07:00
Sojan JoseandGitHub 8b659de73d chore: Use connection_pool for redis (#5790)
fixes: #3199
2022-11-02 17:31:20 -07:00
Tejaswini ChileandGitHub 936c2ec7e2 fix: Ensure Automation rule executions are account scoped (#5768)
This is one possible fix to tackle with cached automation rules when automation gets called on two different accounts with the same event name.

Fixes: https://github.com/chatwoot/product/issues/605
2022-11-02 17:24:35 -07:00
smartdev58andGitHub 9c0cce0392 chore: Mark conversations as pending instead of reopen when bot is present (#5751)
With this change, conversations are marked as pending instead of reopening when a bot is connected to that Inbox. 

Fixes: #5668
2022-11-02 13:54:56 -07:00
Arkadiy AyvazyanandGitHub 86ca7f4a8d fix: Autoloading during initialization deprecation warning (#5628)
Autoloading during initialization deprecation warning fix
fixes: #4012
2022-11-01 20:19:42 -07:00
Sojan JoseandGitHub 6cfd594d85 fix: flaky test whatsapp_cloud_service_spec.rb:17 (#5786)
Fix flaky test: flaky /spec/services/whatsapp/providers/whatsapp_cloud_service_spec.rb:17

example build: https://app.circleci.com/pipelines/github/chatwoot/chatwoot/48955/workflows/a2959d25-19ea-4812-ba15-5aac69c43265/jobs/49523

Cause: factory bot can create phone numbers of length 15 digits, which is valid e164, while our regex only handled up to 14 digits
2022-11-01 19:51:42 -07:00
Sivin VargheseandGitHub e1190fd9bf fix: Text colour is getting merged with the light background colour (#5773) 2022-11-02 05:52:00 +05:30
Stephen Paul WeberandGitHub f2753df8df chore: Use multiple connections in Redis connection pool (#5574)
- The initializer set up a connection pool, but both pools created namespace wrappers around a single global connection. Splitting them up.
2022-11-01 16:49:26 -07:00
Tejaswini ChileandGitHub 00e06e5139 fix: Unsupported message type (#5783)
- fix handling unsupported message types
2022-11-01 15:21:45 -07:00
Fayaz AhmedandGitHub be516a5ea6 fix: Filename issue while editing a macro with attachment action (#5775) 2022-11-01 16:20:09 +05:30
givetimetolifeandGitHub f8d9a27d7a fix: db/seeds.rb field contact_inbox is undefined (#5743)
fixes rails db:chatwoot_prepare error: field contact_inbox is undefined
2022-11-01 00:52:07 -07:00
Muhsin KelothandGitHub 92724576af fix: Update conversation read status indicator logic (#5777) 2022-10-31 09:35:48 -07:00
Tejaswini ChileandGitHub a0606d36f6 fix: Set message sender to macros excution (#5769) 2022-10-31 19:33:12 +05:30
Muhsin KelothandGitHub 2073a23d5c chore: Fix Thumbnail component specs (#5776) 2022-10-28 14:19:12 +05:30
Sivin VargheseandGitHub b20f5e5cef feat: Adds URL validation for domain and home page links (#5761) 2022-10-28 06:21:38 +05:30
Nithin David ThomasandGitHub 3b09840d39 chore: Fix import paths in storybook (#5772) 2022-10-28 01:42:24 +05:30
2aa99ee137 fix: Fix timestamp auto-update in conversations chat list (#5640)
* fix: Fix timestamp auto-update

* fix: rewrite `setInterval` to `setTimeout`

* fix: change refresh time logic

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>
2022-10-28 01:05:39 +05:30
David KubešandGitHub 89d7e4ead6 chore: refactor thumbnail (#5682) 2022-10-28 01:02:23 +05:30
Sojan JoseandGitHub 12cd15b6ad chore: Disable email processing for suspended accounts (#5762)
- Disable email processing for suspended accounts
2022-10-26 03:40:47 -07:00
Sivin VargheseandGitHub 352558dd11 fix: Update color for the action button used in card messages (#5740) 2022-10-25 16:17:05 -07:00
Pranav Raj SandGitHub bedb2cab63 Use @page-change instead of on-page-change (#5749) 2022-10-26 03:46:09 +05:30
abe439594e fix: Add preference to choose browser lang for widget settings page (#5726)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-10-25 15:04:29 -07:00
bcde84b5b5 feat: Add ability to paste file/image from clipboard (#5627)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2022-10-25 13:35:11 +05:30
06e2219110 chore: Improve macros stability (#5700)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-10-24 23:49:19 -07:00
c3ec1d4f8a feat: Add the ability for the agents to execute a macro (#5698)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-10-24 20:33:59 -07:00
Nithin David ThomasandGitHub d54392cb53 fix: Update max-width to fix overflow for emoji selector (#5727) 2022-10-24 19:59:36 -07:00
Sojan JoseandGitHub 3a71fe3260 chore: Stop duplicate websocket updates for conversation updates (#5711)
- remove extra dispatch for label updates
2022-10-21 18:06:02 -07:00
af020f446e fix: check the content type for the file when uploading from cloud storage (#5378)
When sending the message with audio, only the signed id of the file is sent.
In the back end check only the UploadedFile type.
The attachment has the default file type image, now it gets the content type from the signed id

Fixes: #5375

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2022-10-21 18:05:36 -07:00
Pranav Raj SandGitHub 6823b04e5b fix: Update public partials to fix help center search (#5713) 2022-10-21 17:32:01 -07:00
Nithin David ThomasandGitHub 8d5a9a9daa fix: Show account switch modal from portal dashboard (#5712) 2022-10-21 17:24:52 -07:00
c3426929d7 chore: Refactor sidebar components used in help center (#5695)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-10-21 16:43:43 -07:00
4a299a9441 fix: Add an action cable events for label updates (#5694)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-10-21 16:12:35 -07:00
782165478b fix: Update article count in portal admin dashboard (#5647)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-10-21 13:43:15 -07:00
Pranav Raj SandGitHub 95cc55d043 fix: Update pagination logic in the help center (#5693) 2022-10-20 20:05:17 -07:00
Tejaswini ChileandGitHub a274a1702a chore: Macros enhancement (#5609)
- Fixed send_attachment and send_email_transcript
- Fixed duplicate activity messages
- Fixed Order of execution

Fixes: #5584
2022-10-20 19:41:48 -07:00
Chad BurggrafandGitHub 4d0b302802 Avoid crashing when AudioContext is not available. (#5641)
#4942. We've also had a number of crash reports show up in our logs related to this. Typically we see "undefined is not a constructor" because of the `window.AudioContext || window.webkitAudioContext` returns `undefined`.
2022-10-20 19:13:20 -07:00
Pranav Raj SandGitHub a8561cd798 fix: Add portal pack to tailwind config (#5686) 2022-10-19 21:49:34 -07:00
fa73b5290c chore: Allow feature flag parameters in platform API for account creation (#5589)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-10-19 21:16:36 -07:00
a3277b45af feat: Update conversation attributes in realtime when they changed (#5542)
Co-authored-by: daniel gannage <daniel@pxdel.com>
Co-authored-by: Tejaswini Chile <tejaswini@chatwoot.com>
2022-10-19 17:26:10 -07:00
10d86fbb35 chore: Ability to Remove password info from sentinel config (#4550)
Introduce the REDIS_SENTINEL_PASSWORD environment variable to customize the behaviour of sentinel passwords. 

Co-authored-by: EXT02D22861 <nusret.ozates@consultant.turkcell.com.tr>
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2022-10-19 17:25:16 -07:00
22d5703b92 feat: Macros listing and Editor (#5606)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-10-19 17:13:13 -07:00
1fb1be3ddc feat: Add search functionality for public portal (#5683)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-10-19 17:09:32 -07:00
bce0bb8acb chore: Improve pr and bug report templates (#5556)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-10-19 13:45:32 -07:00
Tejaswini ChileandGitHub ceaffe862a Fix: Handled IG unsupported file type (#5650)
We get 'unsupported_type' in the web-hook event only when Instagram faces issues processing the attachments. https://developers.facebook.com/docs/messenger-platform/instagram/features/webhook/ according to their document, we are handling the given types and are ignoring this one for now.

Fixes: #5428
2022-10-19 13:44:17 -07:00
Sojan JoseandGitHub 199f462af4 chore: Update translations from Crowdin (#5663) 2022-10-19 13:27:10 -07:00
David KubešandGitHub c542d2e0ff chore: Refactor urlParamsHelper.js (#5639) 2022-10-19 13:20:40 -07:00
6bc34db932 fix: Make links more accessible on helpcenter public views (#5681)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-10-19 13:07:44 -07:00
Tejaswini ChileandGitHub 0343acdb7e fix: ensure contact_inbox if contact exists(#5667)
- Fixing Instagram issue for existing contacts in the inbox
2022-10-19 12:56:39 -07:00
f740727177 Added testcases for AddReminder Component (#5538)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2022-10-20 00:54:08 +05:30
Fayaz AhmedandGitHub 3de8f256cb fix: Avoid overflowing submenus in conversation context menu (#5113)
* Scroll overflowing content inside submenus

* Disable submenus if options are not available
2022-10-19 12:23:53 -07:00
Muhsin KelothandGitHub 2e7ab484bd fix: Discard invalid contact attributes in widget conversation end point (#5664)
Fixes: chatwoot/product#601
2022-10-18 13:16:29 -07:00
smartdev58andGitHub e34e975776 chore: ability to delete user in super admin console
fixes: #4164
2022-10-18 01:05:28 -07:00
Sojan a1ce188dab Merge branch 'release/2.10.0' into develop 2022-10-17 19:38:42 -07:00
Sojan ce9c8645df Merge branch 'release/2.10.0'
Publish Chatwoot CE docker images / build (push) Waiting to run
2022-10-17 19:38:31 -07:00
Sojan 2f7a16ae16 Bump version to 2.10.0 2022-10-17 19:31:53 -07:00
Pranav Raj SandGitHub 71ca530292 fix: Fix typo in help center (#5661) 2022-10-17 18:59:22 -07:00
Pranav Raj SandGitHub e19c6d5671 chore: Add editor toggle for API inbox (#5660) 2022-10-17 18:52:51 -07:00
Sojan JoseandGitHub 2423def8e8 chore: Add attachments key to message_created webhook payload (#5659)
- Add attachments key to `message_created` webhook payload
2022-10-17 17:36:56 -07:00
1c44e43c43 fix: Fix overflow issue for category name in article list (#5658)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-10-17 15:59:18 -07:00
Sivin VargheseandGitHub 444809cc68 fix: Added validation for check box in the pre-chat form (#5648) 2022-10-17 15:00:02 -07:00
Pranav Raj SandGitHub 20b4a91122 chore: Add feature flags in the settings console (#5657) 2022-10-17 14:59:44 -07:00
Nithin David ThomasandGitHub 73f5595762 chore: Sync colors from dashboard to tailwind config (#5656) 2022-10-17 13:13:02 -07:00
Sojan JoseandGitHub 704554d453 chore: Update translations (#5644) 2022-10-17 11:14:29 -07:00
Muhsin KelothandGitHub 706ab872f3 fix: Disable name in pre-chat form if the name is already provided in setUser (#5466) 2022-10-17 20:59:17 +05:30
Nithin David ThomasandGitHub 252eda14c6 chore: Add woot button to message context menu (#5638) 2022-10-16 16:48:32 -07:00
ce3730d640 fix: Avoid email icon getting distorted (#5633)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-10-14 13:38:08 -07:00
Sojan JoseandGitHub db53af91e7 chore (#5636)
* New translations conversation.json (Latvian)

* New translations bulkActions.json (Portuguese, Brazilian)

* New translations agentMgmt.json (Latvian)

* New translations teamsSettings.json (Latvian)

* New translations contactFilters.json (Latvian)

* New translations automation.json (Latvian)

* New translations attributesMgmt.json (Latvian)

* New translations labelsMgmt.json (Latvian)

* New translations settings.json (Latvian)

* New translations integrations.json (Latvian)

* New translations inboxMgmt.json (Latvian)

* New translations generalSettings.json (Latvian)

* New translations contact.json (Latvian)

* New translations helpCenter.json (Latvian)
2022-10-14 12:46:41 -07:00
David KubešandGitHub a6960dc2d3 chore: Refactor widget (#5621) 2022-10-14 09:13:11 +05:30
Sojan JoseandGitHub e310230f62 chore: Refactor Contact Inbox Builders (#5617)
- Remove duplicate code and move everything to builders
- fixes: #4680
2022-10-13 15:12:04 -07:00
Nithin David ThomasandGitHub 1f271356ca feat: Update the design for dropdown buttons (#5625) 2022-10-13 13:36:42 -07:00
bf4338ef9e feat: Make category name in article table clickable (#5626)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-10-13 13:35:11 -07:00
Tejaswini ChileandGitHub a533f43fbf fix: Stop raising errors for unsupported Whatsapp messages (#5541)
- Handle unsupported Whatsapp messages
2022-10-13 13:31:49 -07:00
Vishnu NarayananandGitHub 8f4944fda0 chore: revert arm64 docker build in gh action (#5619)
ref: https://github.com/chatwoot/chatwoot/pull/5575

https://github.com/chatwoot/chatwoot/pull/5575#issuecomment-1277208625
2022-10-13 13:46:28 +05:30
Pranav Raj SandGitHub d2fd05ee4e fix: Show webhook url only on WhatsApp inbox (#5618) 2022-10-12 21:45:28 -07:00
Nithin David ThomasandGitHub ee520bdf98 feat: Show last active portal articles when sidebar portal icon is clicked (#5616) 2022-10-12 16:22:44 -07:00
6c048626d0 chore: Replace deprecated functions (#5611)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-10-12 14:55:59 -07:00
David KubešandGitHub 0c8f744c33 chore: Remove unnecessary methods and polyfills (#5614) 2022-10-12 14:42:06 -07:00
fca629a32a fix: Update timezone to get wday from working_hours (#5605)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-10-12 14:32:54 -07:00
David KubešandGitHub 1b5a335f93 fix: Update .editorconfig to fix spaces and indent_style (#5612) 2022-10-12 14:00:42 -07:00
Muhsin KelothandGitHub 242de0b3f9 chore: Vscode extension recommendations (#5607)
* Added vscode extension recommendations

* Revert the change

* Revert .gitignore

* Change `volar` to `vetur`
2022-10-12 23:32:24 +05:30
Jordan BroughandGitHub 1bdd59f025 Find by downcased email in SupportMailbox (#5211) 2022-10-12 13:38:18 +05:30
Fayaz AhmedandGitHub 32d885a19b feat: Add macros routes and views (#5604) 2022-10-11 23:20:20 -07:00
Fayaz AhmedandGitHub 6c160ccad5 feat: Add API module and Vuex store for Macros (#5603) 2022-10-11 22:54:17 -07:00
Pranav Raj SandGitHub 9b5c0de0ea chore: Add router views for agent_bots (#5600) 2022-10-11 17:58:52 -07:00
38776906ab chore: Generate webhook-verify-token automatically (#5593)
- Autogenerate webhook verification token in the WhatsAppCloud channel.

Co-authored-by: Sojan <sojan@pepalo.com>
2022-10-11 17:32:31 -07:00
Pranav Raj SandGitHub 5f4b6f2ce4 chore: Add AgentBot API module (#5599) 2022-10-11 17:23:57 -07:00
7419e413f4 fix: Added "None" option in bulk actions assignment menu (#5585)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-10-11 13:44:35 -07:00
0b5a956e05 chore: Update the design for emoji picker (#4244)
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-10-11 12:59:28 -07:00
Tejaswini ChileandGitHub 2c8ded98aa fix: Update format in password reset page (#5596) 2022-10-11 11:27:22 -07:00
Sojan JoseandGitHub d727093538 chore: Update translations from Crowdin (#5578) 2022-10-10 15:40:12 -07:00
Sojan JoseandGitHub 5bd5395d31 chore: Add missing indexes for attachments table (#5588)
- index for attachments table
- index for conversations table
2022-10-10 15:23:33 -07:00
Sojan JoseandGitHub 779f815f8e chore: Update translations (#5566) 2022-10-07 09:08:18 -07:00
Jordan BroughandGitHub ce7d9be633 Fix "presence" checks in Channel::TwilioSms (#5206) 2022-10-07 10:22:33 +05:30
Pranav Raj SandGitHub 788b766179 feat: Quickly create canned responses (#5563) 2022-10-05 22:00:15 -07:00
0a9ea6e272 chore(deps): bump google-protobuf from 3.21.2 to 3.21.7 (#5550)
Bumps [google-protobuf](https://github.com/protocolbuffers/protobuf) from 3.21.2 to 3.21.7.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/generate_changelog.py)
- [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.21.2...v3.21.7)

---
updated-dependencies:
- dependency-name: google-protobuf
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2022-10-05 17:32:00 -07:00
b668723313 chore: Ability to change default account (#5393)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Tejaswini Chile <tejaswini@chatwoot.com>
2022-10-05 17:31:12 -07:00
Geophilus DurairajandGitHub bd445216e9 fix: DEPRECATION WARNING: Rendering actions with '.' in the name is deprecated (#5560)
fixes the warning: Rendering actions with '.' in the name is deprecated
2022-10-05 17:24:34 -07:00
Pranav Raj SandGitHub cd4c1ef27e feat: Update the design of mentions with thumbnail (#5551) 2022-10-05 14:18:16 -07:00
Sojan JoseandGitHub 8b0e95ece8 fix: Flakiness in CI pipeline (#5562)
- Fixing the recent flakiness in CI pipelines
2022-10-05 10:59:31 -07:00
7b1630b468 feat: Enable Docker Buildx multi-arch builds with arm64 support(#5545)
Fixes #2575

multi-arch images with arm64 support CE edition images

Co-authored-by: Vishnu Narayanan <vishnu@chatwoot.com>
2022-10-05 17:07:49 +05:30
Sojan JoseandGitHub c76aed6d5e chore: Update translations from Crowdin (#5546) 2022-10-04 18:14:35 -07:00
8df7547043 feat: Add support for draft messages in reply box (#4440)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
Co-authored-by: Fayaz Ahmed <15716057+fayazara@users.noreply.github.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2022-10-03 21:29:02 -07:00
beedfc47bf feat: Allow users to select Cmd+Enter as a hotkey (#4401)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-10-03 15:27:34 -07:00
9ea43a2678 chore: Improve Nginx settings for speed and security (#5144)
* fix: Fixes #5138

* Move to helper function

* Improve Nginx settings

* chore: set ssl_prefer_server_ciphers to off
ssl_prefer_server_ciphers should be set to  `off` in a modern context.

ref: https://ssl-config.mozilla.org/#server=nginx&version=1.17.7&config=modern&openssl=1.1.1k&guideline=5.6

Co-authored-by: Vishnu Narayanan <vishnu@chatwoot.com>
2022-10-03 17:43:50 +05:30
Nithin David ThomasandGitHub 705d06ac3c fix: Avoid editor formatting issues when a canned response is edited (#5533) 2022-09-30 15:03:33 -07:00
Tejaswini ChileandGitHub 7b54990ae6 fix: Updated IMAP errors add method (#5520)
fixes: #5519
2022-09-30 11:33:00 -07:00
Jordan BroughandGitHub 4f0360c7a2 chore: Allow setting "users.display_name" in Platform API (#5532) 2022-09-30 11:28:18 -07:00
Tejaswini ChileandGitHub 57fcb79d71 fix: Article slug auto saves (#5524)
- Auto save article slug
2022-09-30 07:25:23 -07:00
1819041f5a fix: "wa_source_id" function return value (#5451)
- Fix contact inbox builder returning invalid WhatsApp source id
- Add specs to cover source id validations

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2022-09-29 10:34:55 -07:00
Sojan JoseandGitHub 74e03f9beb chore: Update translations from Crowdin (#5523) 2022-09-28 21:59:41 -07:00
Chamath K.B. AttanayakaandGitHub 6b47c7b43d fix: Attachment not sending to bots message creation (#5353) 2022-09-28 13:13:29 -07:00
Tejaswini ChileandGitHub fcb9a9ab0c fix: contact is not available for inaccessible sender (#5509)
Fixes: #5508

We can not read contact information because of this error, as the messages echo when the sender sends messages to contacts. We don't have the user's consent until and unless they send messages to us.

So after this result, information about the contact is empty, and we are trying to create a contact inbox for the same, and the error appears.

type: OAuthException, code: 230, message: (#230) User consent is required to access user profile, x-fb-trace-id: AaitxF/whwY [HTTP 403] (Koala::Facebook::ClientError)
2022-09-28 12:50:23 -07:00
Pranav Raj SandGitHub 83eee7df91 chore: Set locale in default_locale (#5515) 2022-09-28 08:29:00 -07:00
Tejaswini ChileandGitHub 543854eaa8 fix: Remove the notification subscription if present (#5510) 2022-09-27 12:36:57 -07:00
Tejaswini ChileandGitHub 336c09e072 fix: Add all articles count to article API (#5497) 2022-09-27 12:35:53 -07:00
Tejaswini ChileandGitHub c1c57fb2cd fix: Add slug to articles (#5500) 2022-09-27 12:27:18 -07:00
Sojan 8e5d8fcdaf Merge branch 'release/2.9.1' into develop 2022-09-22 14:22:40 -07:00
Sojan 7ad5ddaf8a Merge branch 'release/2.9.1'
Publish Chatwoot CE docker images / build (push) Waiting to run
2022-09-22 14:22:29 -07:00
Sojan d2d7355e2d Bump version to 2.9.1 2022-09-22 14:18:30 -07:00
Sojan JoseandGitHub 913224ad84 chore: Normalize portal slug to nil (#5487) 2022-09-22 14:08:48 -07:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
b463ce5b1a chore(deps): bump commonmarker from 0.23.5 to 0.23.6 (#5480)
Bumps [commonmarker](https://github.com/gjtorikian/commonmarker) from 0.23.5 to 0.23.6.
- [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.5...v0.23.6)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-21 20:43:08 -07:00
Tejaswini ChileandGitHub 111016fe4c fix: Add not found status if macro not found (#5473) 2022-09-21 14:10:35 +05:30
Pranav Raj SandGitHub cc4ef14faa chore: Fix link generation logic in help-center (#5470) 2022-09-20 18:23:28 -07:00
2d871a1ed5 fix: Hide conversation links in input_csat message in non-website channels (#5469)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2022-09-20 17:15:32 -07:00
Tejaswini ChileandGitHub c556e9c694 Fix: Redirect to portal with default locale (#5467)
- Redirect to default locale if URL does not provide the locale param
2022-09-20 10:31:39 -07:00
Nithin David ThomasandGitHub d28502b917 Bug: Adds support multiline text input on article edit page (#5465)
* Bug: Scroll issue with article list page

* Adds support multiline text input on article edit page
2022-09-20 22:42:09 +05:30
Pranav Raj SandGitHub 1761100c77 chore: Remove static URLs from the documentation (#5461) 2022-09-19 21:52:01 -07:00
Sojan 3a1e521b4c Merge branch 'release/2.9.0' into develop 2022-09-19 20:37:02 -07:00
Sojan 85d3f91dac Merge branch 'release/2.9.0'
Publish Chatwoot CE docker images / build (push) Waiting to run
2022-09-19 20:36:55 -07:00
Sojan 06c9aad7b3 Bump version to 2.9.0 2022-09-19 20:34:49 -07:00
Pranav Raj SandGitHub eb8e348ec1 chore: Update design of the help-center articles (#5459)
- Update designs
- Fixes meta tags
- Update typography
2022-09-19 20:31:38 -07:00
54d0055e86 chore: Helpcenter routing and UI fixes (#5460)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-09-19 19:40:32 -07:00
Sojan JoseandGitHub 3b7cae19e6 chore: Enable help center for self-hosted accounts (#5458) 2022-09-19 19:39:41 -07:00
Shivam ChaharandGitHub 6b80afaf50 fix: un-assign agent from conversation after removal (#5417)
Unassign agents from the conversation when they are removed from the account.

Fixes: #4555
2022-09-19 18:14:55 -07:00
Sojan JoseandGitHub 99de8f4500 chore: Improve Helpcenter custom domains (#5456)
- Support rendering articles over frontend URL
- Support rendering articles over help center URL
- Support rendering help center home page in the custom domain root
2022-09-19 17:36:01 -07:00
Sivin VargheseandGitHub a773ad7d08 fix: Read status not updated in widget popout mode (#5454) 2022-09-19 15:35:41 -07:00
Sojan JoseandGitHub 97583e410c feat: Ability to manage account features from super admin (#5455)
- This PR adds the ability to enable and disable features for an account from the super admin.
2022-09-19 14:57:21 -07:00
678a0af962 chore: Enable Help Center on Sidebar (#5435)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-09-18 13:08:30 -07:00
Vishnu NarayananandGitHub bc23c69605 chore: Fix gh nightly failure (#5442)
* chore: fix gh nightly failure
2022-09-15 23:16:45 +05:30
Fayaz AhmedandGitHub e585b227f1 chore: Check for empty strings in name formatter (#5434) 2022-09-14 07:15:04 -07:00
Nithin David ThomasandGitHub cb4dd7e633 fix: Fixes bug with locale switching from popover (#5426) 2022-09-13 18:49:55 +05:30
Pranav Raj SandGitHub 8af27d861b chore: Default to rich content editor in website and email channel (#5357) 2022-09-13 05:41:42 -07:00
Jordan BroughandGitHub 59b31615ed chore: Use "create!" and "save!" bang methods when not checking the result (#5358)
* Use "create!" when not checking for errors on the result
* Use "save!" when not checking the result
2022-09-13 17:40:06 +05:30
Sivin VargheseandGitHub 44f498be6d fix: Not able to create a new category through the sidebar (#5421)
* fix: Not able to create a new category through the sidebar

* chore: Minor spacing fixes
2022-09-13 00:15:24 +05:30
1ea289e8b7 feat: Sets up portal public views with rails ERB and tailwind (#5309)
* feat: Sets up portal public views with rails ERB and tailwind

* linter fixes

* Remove duplicate style file

* Shows articles and categories

* Specify layout for articles page

* Updates public portal styles

* Fixes blog content styles

* Portal style updates for article page

* Review fixes

* Adds breadcrumbs

* fix: rspec

* fix: public portal spec

* Code climate fixes

* Adds test cases for missing files

* Show only published articles

* Updates help center routes

* Review fixes

* Render markdown content for aticle body

* Update app/views/public/api/v1/portals/articles/index.html.erb

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

Co-authored-by: Sojan <sojan@pepalo.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: tejaswini chile <tejaswini@chatwoot.com>
2022-09-12 23:36:24 +05:30
Sivin VargheseandGitHub a680b08251 chore: Fixes height issues with seconday sidebar (#5407) 2022-09-12 19:36:49 +05:30
Tejaswini ChileandGitHub db73d033b7 feat: Fetching the portal data related to a specific custom domain (#5249) 2022-09-07 12:22:24 +05:30
Tejaswini ChileandGitHub 6574407636 fix: Track Imap exception in sentry (#5397) 2022-09-07 11:41:56 +05:30
afe31a3156 chore: parallel runs in circle (#2810)
- Enable parallel runs in circle

Co-authored-by: Tejaswini <tejaswini@chatwoot.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-09-06 19:17:33 +05:30
Pranav Raj SandGitHub cf7dac5bab chore: Add feature flag for conversation continuity in API (#5399)
- Add the ability to toggle conversation continuity in API channel
2022-09-06 18:14:36 +05:30
Sivin VargheseandGitHub 7a5ea89fd9 chore: Sidebar improvements in small screens (#5400)
* chore: Sidebar improvements in small screens

* chore: Minor fixes
2022-09-06 14:06:26 +05:30
Sivin VargheseandGitHub 79406c5775 fix: Emoji picker is not working on the expanded layout (#5398) 2022-09-06 10:41:39 +05:30
Sivin VargheseandGitHub f5e360fd4d fix: Adding a private note clears the CC field in an Email inbox (#5366) 2022-09-05 16:08:28 +05:30
8f873a34a2 feat: Adds the ability to update conversation timeframe automatically (#5253)
* feat: Adds the ability to update conversation timeframe automatically

* Update app/javascript/dashboard/components/ui/TimeAgo.vue

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

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2022-09-05 16:07:58 +05:30
Sivin VargheseandGitHub 952368948b fix: Alignment issue of edit article dropdown (#5390) 2022-09-05 15:35:52 +05:30
1c590160bb feat: Add locales under portal settings (#5386)
* Add locales under portal settings

* Fix path issue

* chore: Updated category route

* chore: Updated category route

Co-authored-by: iamsivin <iamsivin@gmail.com>
2022-09-05 15:32:14 +05:30
80180a60c5 chore: Final touches for portals (#5388)
* chore: Final touches for portals

* Review fixes

* Minor fixes

* Fixes styles for input and buttons

* Minor fixes

* Spacing fixes on header

* Minor fixes

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2022-09-05 12:46:27 +05:30
329e8c37c8 fix: Validations for updating team members (#5384)
fixes: chatwoot/product#539

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2022-09-02 23:09:29 +05:30
Sojan JoseandGitHub 9525d4f034 chore: Improve rack-attack configuration (#5389)
fixes: https://github.com/chatwoot/product/issues/540
2022-09-02 23:09:03 +05:30
Sivin VargheseandGitHub d47a0ae461 feat: Adds the ability to edit/delete category (#5385) 2022-09-02 22:34:07 +05:30
Nithin David ThomasandGitHub a9801a3c76 design: Fixes to make portal page design close to figma mockups (#5383) 2022-09-02 18:07:17 +05:30
Sojan JoseandGitHub 8bdd229adb chore: Update security guidelines (#5382)
- update security guidelines
2022-09-02 16:59:38 +05:30
03c8251cc3 feat: Adds the ability to publish an article (#5365)
* feat: Adds the ability to publish an article

* chore: Disabled publish button and dropdown when there is no article id

* chore: Review fixes

* chore: Review fixes

* Update app/javascript/dashboard/routes/dashboard/helpcenter/components/Header/EditArticleHeader.vue

* chore: Review fixes

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2022-09-02 12:53:18 +05:30
Muhsin KelothandGitHub b16c5de7ca Add fix for portal update issue (#5381) 2022-09-02 12:32:07 +05:30
Muhsin KelothandGitHub 403ff1a679 feat: Add the ability update/edit locale in portal (#5377) 2022-09-02 11:45:03 +05:30
a1663e4e49 feat: Adds pages to edit portals (#5373)
* feat: Adds pages to edit portals

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

* Update app/javascript/dashboard/routes/dashboard/helpcenter/helpcenter.routes.js

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

* Review fixes

* Adds translations

* Fixes broken tests

* Update app/javascript/dashboard/routes/dashboard/helpcenter/components/PortalPopover.vue

* Update app/javascript/dashboard/routes/dashboard/helpcenter/components/PortalPopover.vue

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2022-09-02 10:22:15 +05:30
Muhsin KelothandGitHub 504d339dd7 feat: Adds the ability to add new locale in portal (#5363) 2022-09-01 22:19:30 +05:30
Sojan JoseandGitHub 7f3f6f7129 fix: Account seeder error on staging (#5371)
- Fix for Account seeding error on staging environments
2022-09-01 21:23:57 +05:30
Sojan JoseandGitHub 4a74ab59d2 chore: Add a feature toggle for account seeding (#5369) 2022-09-01 17:19:15 +05:30
Sivin VargheseandGitHub c09b10a710 feat: Display identifier in the contacts info panel (#5318) 2022-09-01 17:12:47 +05:30
Pranav Raj SandGitHub 83fb46bc50 chore: Add feature flag for branding (#5370) 2022-09-01 17:12:26 +05:30
Tejaswini ChileandGitHub ee2189d98a fix: Set and Update portal's default locale (#5368) 2022-09-01 16:44:06 +05:30
Sivin VargheseandGitHub f4fc53b425 feat: Adds the ability to delete a portal (#5305) 2022-09-01 13:27:08 +05:30
Muhsin KelothandGitHub 6e945dd61e feat: Add the ability to delete/archive articles (#5319) 2022-09-01 10:55:59 +05:30
Sojan JoseandGitHub c8d01a84ce feat: Ability to seed Demo Accounts (#5352)
Introduces the ability to seed sample data into accounts in development and staging.

fixes: #3429
2022-09-01 00:31:43 +05:30
Nithin David ThomasandGitHub ebea5428bc chore: Moves portal slug as ID to query resources in vue store (#5359) 2022-08-31 19:59:05 +05:30
Sivin VargheseandGitHub d14beeb654 feat: Article settings sidebar in new article page (#5355) 2022-08-30 14:41:27 +05:30
Vishnu NarayananandGitHub d7cbeed13e fix: heorku deploy failure (#5338)
* fix: heorku deploy failure

* fix: set default stack to heroku-20
2022-08-30 11:39:28 +05:30
Sivin VargheseandGitHub a9d687565e chore: Displayed WhatsApp API provider name in inbox settings (#5346) 2022-08-29 12:40:15 +05:30
Jordan BroughandGitHub 9ddf4c205c chore: Add index on conversations.uuid (#5179)
- We search for conversations by this attribute (e.g. in ReplyMailbox and CsatSurveyController) so it seems like we should have an index on it.
2022-08-23 19:05:30 +05:30
Vishnu NarayananandGitHub 5957edc76b feat: abort cwctl upgrade if custom code changes detected (#5329)
* feat: abort cwctl upgrade if custom code changes detected

* fix: cwctl exit handler on upgrade

* chore: update cwctl version
2022-08-23 18:56:39 +05:30
Sivin VargheseandGitHub 8bc560752f fix: File validations for Twilio WhatsApp Channel (#5294)
Fixes: #5289 #2971

- Removed unsupported attachment file format from Twilio WhatsApp Channel. https://www.twilio.com/docs/whatsapp/guidance-whatsapp-media-messages

- Added 5 MB attachment file limit for Twilio SMS Channel.
2022-08-23 18:35:31 +05:30
Tejaswini ChileandGitHub 9c67814724 Fix: Instagram webhook test event (#5317) 2022-08-22 16:10:14 +05:30
Tejaswini ChileandGitHub 747ce9c80f fix: Update automation to use case-insensitive filter (#5302) 2022-08-22 10:16:50 +05:30
bef3f66501 feat: Allow Dashboard App Frames to query the information (#5313)
Co-authored-by: Fayaz Ahmed <15716057+fayazara@users.noreply.github.com>
2022-08-22 09:27:35 +05:30
Sojan JoseandGitHub f33ff351cf chore: New Translation updates (#5287) 2022-08-19 13:55:23 +05:30
Muhsin KelothandGitHub a788e7ac7a feat: Create portal UI improvements (#5261) 2022-08-18 17:11:19 +05:30
Tejaswini ChileandGitHub ea918d9c5a fix: send confirmation email on re-adding agent (#5279)
Send confirmation email after re-adding the agent.

Fixes: #4951
2022-08-18 13:12:43 +05:30
Muhsin KelothandGitHub 0cd08065d1 feat: Adds the ability to create a new article (#5255) 2022-08-18 11:45:08 +05:30
Sivin VargheseandGitHub 45d0d101b1 chore: Handled help center sidebar in small screen (#5293) 2022-08-18 11:14:06 +05:30
Sojan 8042810e42 Merge branch 'hotfix/2.8.1' into develop 2022-08-17 19:47:57 +05:30
Sojan 0cfe654b33 Merge branch 'hotfix/2.8.1'
Publish Chatwoot CE docker images / build (push) Waiting to run
2022-08-17 19:47:48 +05:30
Vishnu NarayananandGitHub 1db72dbe52 fix: linux installation failure due to empty db name (#5283) 2022-08-17 16:53:19 +05:30
Sojan 975eed65d7 Bump version to 2.8.1 2022-08-17 15:09:50 +05:30
Muhsin KelothandGitHub b71291619c feat: Adds the ability to edit article (#5232) 2022-08-16 17:55:34 +05:30
Sojan b5e497a6a2 Merge branch 'release/2.8.0' into develop 2022-08-16 17:33:38 +05:30
Sojan 3eee74cb1a Merge branch 'release/2.8.0'
Publish Chatwoot CE docker images / build (push) Waiting to run
2022-08-16 17:33:28 +05:30
Sojan cc8625ca75 Bump version to 2.8.0 2022-08-16 17:31:55 +05:30
Sojan JoseandGitHub fc8c7a7107 chore: New Translation updates (#5235) 2022-08-16 17:06:21 +05:30
Sojan JoseandGitHub 2ecb2ca0f0 feat: Enable Capacity Config UI (#5164)
- Enables Capacity Config in UI
- Rewrite auto assignment Logic to consider only online agents

fixes: #4990
2022-08-16 16:58:23 +05:30
287f0a6de0 Fix: Truncate overflowing dashboard apps text (#5221)
* Truncate overflowing text

* Update app/javascript/dashboard/routes/dashboard/settings/integrations/DashboardApps/DashboardAppsRow.vue

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

* Fix overflowing content

* Reviwe changes

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2022-08-16 16:37:52 +05:30
Vishnu NarayananandGitHub 3cb72242de feat: add gh action for linux nightly installer (#5191)
* feat: add gh action for nightly installer


Signed-off-by: Vishnu Narayanan <vishnu@chatwoot.com>
2022-08-16 11:04:09 +05:30
Sojan JoseandGitHub ecb1f57efe chore: Improve memory usage in RemoveStaleNotificationsJob (#5271)
The job we introduced recently for removing the stale migrations would time out in instances with a large amount of deleted data.
So improving it for better memory utilization.
2022-08-15 19:58:42 +05:30
Tejaswini ChileandGitHub 2397326324 fix: Auto populate team after assigned via API (#5250) 2022-08-12 13:40:28 +05:30
Sojan JoseandGitHub 831a3bcd50 chore: Fix RemoveStaleNotificationJob query (#5242)
Rubocop amended the query in #5236, which led to failure as the Message model already has a default scope.
This PR fixes it.
2022-08-10 15:08:37 +02:00
Sojan JoseandGitHub 74fdfffe08 fix: Notification page breakages (#5236)
- Remove the cascading foreign key indexes
- Add migration to clean up existing objects

fixes: #4285
2022-08-10 13:46:46 +02:00
Sivin VargheseandGitHub 12b6fb211a feat: Created article settings side panel (#5197) 2022-08-10 11:58:19 +05:30
9bc75225fe feat: Category store integration (#5218)
* Add more actions

* Complete sidebar store integration

* Complete portal list store integration

* Fixed the specs

* Added missing specs

* Add comment

* Code cleanup

* Fixed all the spec issues

* Add portal and article API specs

* Add category name in article list

* Add more locales

* Code beautification

* Exclude locale from codeclimate ci

* feat: Category store integration

* chore: Minor fixes

* chore: API call fixes

* chore: Minor fixes

* chore: Minor fixes

* chore: Adds the ability for get articles based on categories

* chore: minor fixes

* chore: Minor fixes

* chore: fixes specs and minor improvements

* chore: Review fixes

* chore: Minor fixes

* chore: Review fixes

* chore: Review fixes

* chore: Spacing fixes

* Code cleanup

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2022-08-10 10:48:41 +05:30
Muhsin KelothandGitHub 16ad263a3a feat: Add the ability add new portal (#5219) 2022-08-10 09:27:52 +05:30
Pranav Raj SandGitHub 657bd44418 fix: Update the relevant agent presence only (#5220) 2022-08-09 12:32:09 +05:30
Pranav Raj SandGitHub cbcee6414c fix: Update styles to fix the status filter dropdown (#5230) 2022-08-09 12:10:56 +05:30
Pranav Raj SandGitHub 27a9806817 chore: Add support for conversation_id in SSO params (#5228) 2022-08-09 00:13:06 +05:30
Pranav Raj SandGitHub 4b1bb65c92 chore: Add notification ID to tag to make it unique (#5227) 2022-08-09 00:09:11 +05:30
Sojan JoseandGitHub fe74a259be fix: assigned_conversation_new_message? NoMethod error (#5225) 2022-08-08 23:43:57 +05:30
Sojan JoseandGitHub a89a280a94 chore: Update translations from Crowdin (#5202) 2022-08-08 21:14:50 +05:30
Sojan JoseandGitHub e26c6a2de5 chore: Lock closed threads automatically (#5222) 2022-08-08 21:12:28 +05:30
Pranav Raj SandGitHub d8de16fd70 chore: Remove bourbon dependancy (#5215) 2022-08-08 21:02:29 +05:30
Muhsin KelothandGitHub 20f3568583 feat: Portals store integration (#5185) 2022-08-08 15:47:32 +05:30
Pranav Raj SandGitHub 052422ed03 chore(deps): Upgrade vuelidate to 0.7.7 (#5214) 2022-08-08 12:02:37 +05:30
Sojan JoseandGitHub 8e75b3fc2a chore: Remove stale contact presence records (#5205)
fixes: chatwoot/product#493
2022-08-05 12:51:39 +02:00
124390a019 chore: Cleanup update banner with localstorage updates (#5209)
Co-authored-by: Aswin Dev P.S <aswindevps@gmail.com>
2022-08-05 13:46:12 +05:30
fc9699d993 feat: Add assign team option to the context menu (#5153)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-08-05 10:57:58 +05:30
giquieuandGitHub 9bea84e2b5 fix: Sending Audio messages not working in Whatsapp Cloud
To send audio via Cloud API, it is unnecessary to send the caption.

fixes: #5078
2022-08-04 18:12:40 +02:00
Pranav Raj SandGitHub b38877300c chore: Update styles in cc/bcc input (#5201) 2022-08-04 17:45:12 +05:30
Sojan JoseandGitHub 044692e475 chore: Skip reprocessing invalid Stripe events (#5200) 2022-08-04 17:21:11 +05:30
Fayaz AhmedandGitHub 7c5ee55d3e feat: Add store to manage categories (#5127) 2022-08-04 15:11:29 +05:30
d55a8f7987 chore: Add POSTGRES_DATABASE details to the env file (#5180)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-08-04 10:28:50 +05:30
Sivin VargheseandGitHub 65ac78acec feat: Add a popup component for announcements (#4615) 2022-08-03 20:49:42 +05:30
Sojan JoseandGitHub 7659197d4d chore: Update translations from Crowdin (#5192) 2022-08-03 18:26:24 +05:30
David KubešandGitHub a18c0a97f3 chore: Replace packages with native functions (#5140) 2022-08-03 17:08:21 +05:30
Sivin VargheseandGitHub 262458f07d fix: Update broken styles in the editor (#5183) 2022-08-03 15:04:32 +05:30
Sivin VargheseandGitHub f7d4f39b5c fix: Avatar renders an incorrect symbol if it has emoji (#5184) 2022-08-03 14:11:33 +05:30
Pranav Raj SandGitHub e0cebfaa1a chore: Allow super admin to suspend an account (#5174) 2022-08-03 11:40:03 +05:30
Tejaswini ChileandGitHub 4152883f38 chore: Add missing locale info in portal API (#5177) 2022-08-03 10:33:48 +05:30
Sivin VargheseandGitHub 11fe3f071e feat: Component for listing the portal (#5146) 2022-08-02 20:03:51 +05:30
Muhsin KelothandGitHub 5735a8e377 feat: Articles store integration (#5133) 2022-08-02 17:14:10 +05:30
Pranav Raj SandGitHub 82207c0d3e fix: Convert limits to Integer (#5169) 2022-08-02 15:35:51 +05:30
Tejaswini ChileandGitHub 596b611fc0 fix: search with status and author (#5152) 2022-08-02 15:28:27 +05:30
Aswin Dev P.SandGitHub d9b102cff0 feat: Widget Builder (#5104)
* feat: Add widget builder
2022-08-02 00:34:20 -07:00
substrGitHubrichardokusumasali@gmail.com <chi>
945288ce15 fix: Trim search parameter value on contacts controller (#5114)
Co-authored-by: richardokusumasali@gmail.com <chi>
2022-08-01 19:59:27 +05:30
Sojan JoseandGitHub 8db5a528ef chore: Roundrobin should consider auto-offline false config (#5160)
Previously round-robin conversation assignment logic wasn't considering the case where the Agent who had auto-offline config set as false.

fixes: #4780
2022-08-01 15:32:34 +02:00
2c372fe315 feat: Improve email rendering, introduce a new layout for emails (#5039)
Co-authored-by: Fayaz Ahmed <15716057+fayazara@users.noreply.github.com>
2022-08-01 10:53:50 +05:30
Sivin VargheseandGitHub ef9ea99b91 feat: Opening and closing portal switch (#5126) 2022-07-28 14:52:05 +05:30
Tejaswini ChileandGitHub 41df70fb96 chore: Add articles metadata (#5125) 2022-07-28 13:59:16 +05:30
7f48cffeb3 feat: Support case insensitive tags for Slack note prefix (#5123)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-07-28 09:57:39 +05:30
Tejaswini ChileandGitHub 21912155f2 chore: adding env example for direct_upload (#5130) 2022-07-27 20:03:33 +05:30
Fayaz AhmedandGitHub 806e5efd7a Portals Popover component (#5052)
* Portal Switch component

* Review fixes

* Update storybook props

* Review changes

* Popover component

* Review changes and moved the files to helpcenter folder
2022-07-27 14:37:55 +05:30
Fayaz AhmedandGitHub ce66b31422 feat: Portal Switch component (#5008) 2022-07-27 13:56:49 +05:30
Muhsin KelothandGitHub 6368f9106a feat: Article list view page (#5122) 2022-07-27 13:08:27 +05:30
6295f5fd61 feat: Add store to manage Articles (#5048)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-07-27 12:29:11 +05:30
bfca4852c8 feat: Create store to manage Portals (#5020)
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>
2022-07-27 12:24:43 +05:30
1594d49a70 Chore: Add link to product docs on sidebar (#5119)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-07-27 10:49:06 +05:30
Tejaswini ChileandGitHub f6891aebbb fix: Set account default language in account API (#5086) 2022-07-26 22:42:20 +05:30
Sivin VargheseandGitHub 699b01c1d1 fix: Console warnings from help-center routes (#5117) 2022-07-26 19:59:46 +05:30
Tejaswini ChileandGitHub 6a4c0a1578 feat: Execute macro actions, for the conversation (#5066) 2022-07-26 12:41:22 +05:30
Muhsin KelothandGitHub bd7a56061e feat: Create category component (#5103) 2022-07-26 12:15:01 +05:30
92bb84127b feat: Creates view for edit/new article page (#5061)
* feat: Creates view for edit/new article page

* chore: Minor fixes

* chore: Minor fixes

* Update HelpCenterLayout.vue

* chore: Minor fixes

* chore: Review fixes

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-07-26 11:39:53 +05:30
2082409657 feat: Add support for right click context menu in conversations (#4923)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-07-26 10:47:28 +05:30
Pranav Raj SandGitHub d57dc41cee fix: Do not reset the scroll if there is no new message (#5108) 2022-07-26 10:40:21 +05:30
Sojan JoseandGitHub 885fcf667c chore: Enable Thai language (th), update translations (#5095) 2022-07-26 09:52:59 +05:30
Tejaswini ChileandGitHub ffec427513 fix: mention notification mail for empty contact name (#5091) 2022-07-22 15:37:24 +05:30
Sojan JoseandGitHub 8acba37baf chore: Add specs for stripe Webhooks endpoint (#5087) 2022-07-22 11:46:31 +02:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
a946c06fc4 chore(deps): bump terser from 4.8.0 to 4.8.1 (#5069)
Bumps [terser](https://github.com/terser/terser) from 4.8.0 to 4.8.1.
- [Release notes](https://github.com/terser/terser/releases)
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-22 11:41:14 +02:00
Kyle McLarenandGitHub bc3e7d2b5e chore: Support for Elastic APM (#5004)
This PR adds support for Elastic APM for APM and Tracing in self-hosted installations.
Configuration can be done via the ELASTIC_APM_SERVER_URL and ELASTIC_APM_SECRET_TOKEN env variables.

fixes: #4999
2022-07-22 11:39:37 +02:00
Tejaswini ChileandGitHub 5727928600 fix: help center clearing minor bugs (#5075) 2022-07-22 15:01:07 +05:30
Pranav Raj SandGitHub 32291f4f7d fix: Update browser_language logic to include all languages (#5090) 2022-07-22 13:14:17 +05:30
Sojan JoseandGitHub 6a6a37a67b chore: Ability to Disable Gravatars (#5027)
fixes: #3853

- Introduced DISABLE_GRAVATAR Global Config, which will stop chatwoot from making API requests to gravatar
- Cleaned up avatar-related logic and centralized it into the avatarable concern
- Added specs for the missing cases
- Added migration for existing installations to move the avatar to attachment, rather than making the API that results in 404.
2022-07-21 19:27:12 +02:00
Sivin VargheseandGitHub 6105567238 enhancement: Uses bold font-weight for unread notifications (#5073) 2022-07-20 14:41:03 +05:30
Pranav Raj SandGitHub cd5e0c548c fix: Do not enqueue job if it is already enqueued (#5068) 2022-07-19 21:12:31 +05:30
Pranav Raj SandGitHub 7fc0d166e8 feat: Allow SaaS users to manage subscription within the dashboard (#5059) 2022-07-19 19:04:17 +05:30
Tejaswini ChileandGitHub 0cee42a9f9 feat: Macros CRUD api (#5047) 2022-07-19 17:37:00 +05:30
c4b2005425 feat: Component for editing an article (#5032)
* feat: Component for editing an article

* chore: font fixes

* chore: Review fixes

* chore: fixes conflicts

* Update app/javascript/dashboard/components/helpCenter/EditArticle.vue

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

* chore: Review fixes

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
2022-07-19 09:28:19 +05:30
Chad BurggrafandGitHub 558e3c7499 fix: Catch audio context errors (#5051)
Prevent errors in decoding and playing sounds from propagating
by catching them in the promise chain.

Fixes #4281.
2022-07-19 08:59:50 +05:30
Pranav Raj SandGitHub 1dc7ce526e chore: Add ee helper, custom_attributes to account (#5058) 2022-07-19 00:33:06 +05:30
Sojan d8140db2e8 Merge branch 'release/2.7.0' into develop 2022-07-18 16:48:23 +02:00
Sojan 628f40c2ab Merge branch 'release/2.7.0'
Publish Chatwoot CE docker images / build (push) Waiting to run
2022-07-18 16:48:01 +02:00
Sojan 5d674dddfe Bump version to 2.7.0 2022-07-18 16:41:44 +02:00
Tejaswini ChileandGitHub 00dc65ef73 fix: Twilio validation over blank messaging_service_sid (#5055) 2022-07-18 20:02:37 +05:30
SimonandGitHub fd44f9f28a chore: add file size to response (#5054)
Add file_size to the attachment response to display the file size in chat.

Fixes: #4992
2022-07-18 15:21:24 +02:00
f004db3d26 feat: New sidebar component for help-center (#5017)
* feat: New sidebar component for help-center

* chore: Review fixes

* chore: Minor fixes

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2022-07-18 11:16:36 +05:30
Muhsin KelothandGitHub 21a8b79aa5 feat: Article table component (#5018) 2022-07-18 10:47:15 +05:30
Sojan JoseandGitHub bba3475083 chore: Update Crowdin translations (#5022) 2022-07-15 18:35:03 +07:00
Vishnu NarayananandGitHub 18d9bd8359 feat: add -I option to cwctl and modify -i option (#5045)
* feat: add -I option to cwctl and modify -i option

Modify -i option to drop support for installing specified branch
-i will always default to installing the latest stable branch(master)

Add -I option to support installing Chatwoot with a custom branch

* chore: minor fixes
2022-07-15 16:17:52 +05:30
Sivin VargheseandGitHub a4e21f2c47 fix: Avoid text overflow with notification content (#5035) 2022-07-15 16:27:27 +07:00
Sojan JoseandGitHub 4187428729 chore: Update dependencies to the latest versions (#5033) 2022-07-15 09:51:59 +07:00
Sojan JoseandGitHub ea1a27c7d4 fix: Twilio channel selection when MessagingServiceSid is empty (#5040)
- Fixes channel selection logic in incoming_message_service for Twilio messages

ref: #4242
2022-07-14 15:16:07 +02:00
Vishnu NarayananandGitHub b7c2159274 chore: Improve output of cwctl -w option (#5037) 2022-07-14 14:13:33 +05:30
Pranav Raj SandGitHub 8dd0d514fd feat: Init HelpCenter Routes (#5034) 2022-07-14 10:31:36 +07:00
Tejaswini ChileandGitHub d7be0ea08e fix: Conversation filter on dates (#5024) 2022-07-13 10:08:24 +05:30
Sojan JoseandGitHub 8f8a1813bf chore: Fix puma configuration (#5023)
Fixes the console warning: 

`` `
WARNING: Detected running cluster mode with 1 worker.
Running Puma in cluster mode with a single worker is often a misconfiguration.
! Consider running Puma in single-mode (workers = 0) in order to reduce memory overhead.
```
2022-07-12 12:27:33 +02:00
giquieuandGitHub 827f977a37 feat: Update API for contact avatar (#4719)
Added the ability to update the contact's avatar via API and Dashboard.

- Contact create and update APIs can now accept avatar attachment parameters [form data].
- Contact create and update endpoints can now accept the avatar_url parameter.[json]
- API endpoint to remove a contact avatar.
- Updated Contact create/edit UI components with avatar support

Fixes: #3428
2022-07-12 10:03:16 +02:00
Fayaz AhmedandGitHub 68fcd28751 chore: Add key for referrer link (#5021) 2022-07-12 09:46:39 +02:00
Pranav Raj SandGitHub d1bd829bc0 fix: Update yarn.lock file to fix deployment issue (#5019) 2022-07-12 13:58:57 +07:00
Sojan JoseandGitHub 05db053f60 chore: fix schema error from PR merges (#5016) 2022-07-11 20:12:48 +02:00
Sojan JoseandGitHub da12a39321 chore: New translation updates (#5001)
New translation updates
2022-07-11 19:14:37 +02:00
Muhsin KelothandGitHub ce1f69b2bc feat: Article item component (#5007) 2022-07-11 13:46:42 +05:30
Tejaswini ChileandGitHub 23ac1c0334 feat: Added portal logo and the updated the JSON (#4996) 2022-07-11 12:43:24 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
9d4b77533e chore(deps): bump moment from 2.29.2 to 2.29.4 (#5005)
Bumps [moment](https://github.com/moment/moment) from 2.29.2 to 2.29.4.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/moment/moment/compare/2.29.2...2.29.4)

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

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-10 14:01:19 +07:00
Fayaz AhmedandGitHub b9eb9a5e48 feat: Support square variants of thumbnail and avatar components (#5003) 2022-07-09 14:03:55 +05:30
Sivin VargheseandGitHub 43f46e96d4 feat: Header for help-center pages (#4987) 2022-07-08 21:19:19 +05:30
Vishnu NarayananandGitHub 1bb9556c86 fix: non-zero exit on --logs and handle no opts (#5006)
* fix: non-zero exit on --logs and handle no opts

* chore: update cwctl version + add utm_source
2022-07-08 18:49:27 +05:30
Jordan BroughandGitHub 49d08a6773 feat: Support Twilio Messaging Services (#4242)
This allows sending and receiving from multiple phone numbers using Twilio messaging services

Fixes: #4204
2022-07-08 18:20:07 +05:30
Tejaswini ChileandGitHub fdf449dc87 Feat: Article public apis (#4955) 2022-07-08 17:24:38 +05:30
Aswin Dev P.SandGitHub 13a4e0e6d9 chore: Email improvements. (#4901)
* Update email processing logic.
* Fix sentry issues
2022-07-08 04:13:24 -07:00
Aswin Dev P.SandGitHub 19c637eb33 chore: Fix sentry issues (#4940)
Fixes: #4810
2022-07-08 15:09:06 +05:30
ef1d117717 feat: Add the ability to create dashboard apps from the UI (#4924)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-07-08 15:55:32 +07:00
Sojan JoseandGitHub e4b159dd54 chore: Fix contact model silently discarding invalid attributes (#4994)
fixes: #4775
2022-07-08 13:58:09 +05:30
Pranav Raj SandGitHub bca347149a feat: Add responsive tab styles (#4997) 2022-07-08 13:53:01 +07:00
Sojan JoseandGitHub 181d7797a2 chore: New translation updates (#4980)
New translation updates
2022-07-07 21:07:19 +05:30
Sojan JoseandGitHub f014d9d13b chore: Ability to Disable Sentry Transactions (#4989)
fixes: #4866
2022-07-07 20:37:05 +05:30
Tejaswini ChileandGitHub 2f3bdbdea2 fix: Handling facebook client error for deleted story (#4984) 2022-07-07 18:02:18 +05:30
SimonandGitHub 91d9584fcb feat: show HMAC and enforcement for identity validation for API inbox (#4807)
Display HMAC token in Settings of Inbox API and enable enforcement option. I have also adjusted the copy so that it can apply to all inbox types.

Fixes: #4804
2022-07-06 21:47:39 +02:00
3145492a26 chore: Copy change for inbox management page (#4868)
Copy change for inbox management page

Co-authored-by: Hricha Shandily <103104754+Hricha-Shandily@users.noreply.github.com>
2022-07-06 21:46:23 +02:00
Sojan JoseandGitHub a6c609f43d feat: Support for Whatsapp Cloud API (#4938)
Ability to configure Whatsapp Cloud API Inboxes

fixes: #4712
2022-07-06 21:45:03 +02:00
Tejaswini ChileandGitHub 4375a7646e fix: Fixing message create issue for deleted instagram story (#4979) 2022-07-06 17:18:36 +05:30
Pranav Raj SandGitHub 2a899a633a chore: Remove confirm password field from the account signup step (#4976) 2022-07-06 12:26:26 +07:00
Tejaswini ChileandGitHub b86638faac fix: last incoming message sort (#4972) 2022-07-06 00:37:43 +05:30
Sojan JoseandGitHub ac2adfbd57 chore: Append incoming SMS to last conversation (#4906)
- Append incoming SMS to the last conversation created for a contact
2022-07-05 21:19:41 +05:30
Jordan BroughandGitHub 4b405dc052 chore: Remove no-op condition in Api::V1::InboxesHelper (#4966)
-  `smtp` cannot be nil in this context
- `anything&.nil?` will never be truthy, even if `anything` is nil
2022-07-05 17:12:53 +02:00
Sojan JoseandGitHub 5d2cdb40f5 chore: Disable CORS on public API endpoints (#4970)
fixes: #3070
2022-07-05 15:00:17 +02:00
Tejaswini ChileandGitHub 029209a634 feat: Portal and Category public APIs (#4946) 2022-07-05 17:15:38 +05:30
Tejaswini ChileandGitHub ae59d0a343 feat: CRUD operation for associated articles to current article (#4912) 2022-07-04 20:29:44 +05:30
Tejaswini ChileandGitHub 62ed9fe1b4 fix: update gemfile (#4968) 2022-07-04 12:38:45 +05:30
Tejaswini ChileandGitHub 97bf5d0c6a fix: Fetch email address to create contact (#4952)
Get the email address from the email content in the correct format.

Fixes: chatwoot/product#454
2022-07-02 17:40:28 +05:30
Tejaswini ChileandGitHub ac7ebe516a fix: Add validation for the inbox name to avoid special characters (#4920) 2022-06-30 10:59:37 +05:30
Pranav Raj SandGitHub 3f6862e04d chore: Display API key in the configuration for WhatsApp Channel (#4944) 2022-06-29 11:52:55 +05:30
Tejaswini ChileandGitHub df1bf112ea feat: Category API to handle linked categories and parent-sub categories (#4879) 2022-06-28 11:23:20 +05:30
Pranav Raj SandGitHub c0249a1b5b chore: Fix loading state in the inbox settings page (#4926) 2022-06-24 23:15:46 +05:30
Fayaz AhmedandGitHub 263b8240d3 fix: Add a fix for minor UI / a11y issues (#4905) 2022-06-24 23:12:53 +05:30
Pranav Raj SandGitHub dcbca173ac chore: Revert the migration for inbox name changes (#4919) 2022-06-23 20:36:46 +05:30
Sivin VargheseandGitHub f39c10395a fix: Add email validation in the email field of the new contact form (#4909) 2022-06-23 19:22:31 +05:30
Pranav Raj SandGitHub b7606e4dd2 feat: Add native support for CSML in agent_bot API (#4913) 2022-06-23 19:17:46 +05:30
f71980bd95 chore: Enhance contact merge action for identified users (#4886)
- Discard conflicting keys 
- Do not merge if there is already an identified contact

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-06-23 15:48:56 +05:30
Aswin Dev P.SandGitHub d5ddc9d76c chore: Fix SMTP sentry issue (#4883)
* Fix SMTP sentry issue
2022-06-22 14:09:04 -07:00
Vishnu NarayananandGitHub f2dd88223f feat: add chatwoot ctl(cwctl) cli tool (#4836)
* chore: Add log messages for stages skipped during installation

* feat: allow chatwoot user to start/stop/restart chatwoot service

* feat: init options support

* feat: add option support to linux install script [c|h|i|l|s|u|wi]

Install/Update/Configure/Manage your Chatwoot installation
Example: cwctl -i master
Example: cwctl -l web
Example: cwctl --logs worker
Example: cwctl --upgrade
Example: cwctl -c

Installation/Upgrade:
  -i, --install             install Chatwoot with the git branch
specified
  -u, --upgrade             upgrade Chatwoot to latest version
  -s, --ssl                 fetch and install ssl certificates using
LetsEncrypt
  -w, --webserver           install and configure Nginx webserver

Management:
  -c, --console             open ruby console
  -l, --logs                tail logs from Chatwoot. Supported values
include web/worker.

Miscellaneous:
  -h, --help                display this help text and exit

* feat: add cwctl to PATH

* feat: add -v to cwctl

* chore: switch db migration to db:chatwoot_prepare

* fix: reload systemd files after update

* fix: improve -s -w cwctl options

* chore: throw error if run without options

Signed-off-by: Vishnu Narayanan <vishnu@chatwoot.com>

* feat: add -d/--debug option to cwctl

* fix: remove hardcoded ruby version in cwctl --upgrade

* chore: improve cwctl -v function

* fix: disable cwctl selfupdate

* chore: cleanup

* feat: allow chatwoot user to run cwctl

* chore: cwctl improve formatting for log messages

* fix: variable expansion inside heredoc

* feat: save pg_pass to file to support idempotency

One of the things preventing idempotency was the postgres
password generated at run-time to setup postgres initally.

This commit saves the password to the file if postgres setup function
is executed and reloads on future re-runs if needed.

* chore: formatting

* chore: add cwctl promotion message at the end of installation

* feat: add comments

* chore: add chatwoot and cwctl version files

* feat: add func to get latest chatwoot version

* chore: formatting

* feat: add --restart option to cwctl

* chore: update --help with restart option details

* chore: minor improvements to --restart
2022-06-22 23:39:01 +05:30
Tejaswini ChileandGitHub ffd102cdfe Feat: custom sort (#4864) 2022-06-22 11:04:42 +05:30
Vishnu NarayananandGitHub a2204cf269 chore: add artifact hub shield to README (#4904)
https://artifacthub.io/packages/helm/chatwoot/chatwoot
2022-06-21 20:02:35 +05:30
Fayaz AhmedandGitHub 9c721d279e fix: Truncate overflowing labels in bulk actions selector (#4898) 2022-06-20 22:32:52 +05:30
Tejaswini ChileandGitHub 9cf6d18e4c fix: Update the documentation for automation rules API endpoint (#4896) 2022-06-20 19:57:52 +05:30
Fayaz AhmedandGitHub 3fa34991d0 fix: Display missing agent avatar in bulk actions and reports (#4893) 2022-06-20 16:04:26 +05:30
f31c6d5de2 feat: Update the design of labels to use a smooth theme (#4325)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-06-20 15:09:22 +05:30
Muhsin KelothandGitHub a8c6cd729b chore: Sync pre-chat fields after custom attribute update (#4692) 2022-06-20 14:16:49 +05:30
Sojan JoseandGitHub 6c6df8661b chore: Codespace webpacker fix (#4887)
- fixes the webpacker error when running overmind start -f Procfile.dev
2022-06-17 19:12:56 +05:30
Sojan JoseandGitHub db86263353 chore: Codespace Improvements (#4867)
- switch to ubuntu base image
- use rbenv to manage ruby 
- add gh to base image
2022-06-17 03:07:07 +05:30
Fayaz AhmedandGitHub 205d42e978 fix: Bulk actions agent loading (#4874) 2022-06-16 11:02:32 +05:30
Prithvi TharunandGitHub 644f07a23d chore: Copy change for automatic greeting message (#4727)
fixes: #4726
2022-06-15 18:34:24 +05:30
Sojan JoseandGitHub 881feb1274 Merge tag 'v2.6.0' into develop
v2.6.0
2022-06-15 12:09:39 +00:00
Sojan JoseandGitHub 374b367115 Merge branch 'release/2.6.0'
Publish Chatwoot CE docker images / build (push) Waiting to run
2022-06-15 12:09:13 +00:00
Sojan JoseandGitHub c2114e468e Bump version to 2.6.0 2022-06-15 12:06:15 +00:00
Aswin Dev P.SandGitHub 9015d83679 chore: Fix sentry issues (#4863)
Fix sentry issues.

Fixes #4815, #4814, #4811, #4809
2022-06-15 16:20:19 +05:30
067c905329 feat: Allow agents to bulk assign labels to conversations (#4854)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-06-15 14:18:05 +05:30
Sojan JoseandGitHub fdcaed75f6 chore: Move Whatsapp template sync to cron (#4858)
syncing WhatsApp templates job is moved to a cron job for a better user experience. The Templates are synced at 15-minute intervals now.
2022-06-14 23:46:36 +05:30
Pranav Raj SandGitHub 1bb0371c1d feat: Add agent_reply_time_window in API channels (#4857) 2022-06-14 18:05:37 +05:30
Pranav Raj SandGitHub f0db8545cb fix: Update profile settings header title (#4856) 2022-06-14 10:55:16 +05:30
Tejaswini ChileandGitHub 37cb46238a chore: Add documentation for automation rule, fix conversation/inbox_members (#4852) 2022-06-14 10:35:56 +05:30
713fdb44ee feat (ee): APIs to configure an auto assignment limit for inboxes (#4672)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-06-13 20:18:38 +05:30
Tejaswini ChileandGitHub ae72757d23 feat: APIs for Articles (#4777)
Fixes: #4802
2022-06-13 15:56:49 +05:30
2198930185 feat: Add snooze, reopen option to bulk actions (#4831)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-06-13 12:14:27 +05:30
Tejaswini ChileandGitHub aa903a5da9 Fix: backend changes for custom attribute (#4830) 2022-06-13 11:58:54 +05:30
Pranav Raj SandGitHub 98f2160462 chore: Remove partner signup link (#4843) 2022-06-13 11:27:22 +05:30
Sojan JoseandGitHub bc8e08f126 chore: Update translations from Crowdin (#4838) 2022-06-12 11:08:06 +05:30
7bb8186e43 chore: Update self-closing tag eslint config (#4826)
* chore: Fix self-closing tag issues

* Fix merge conflicts

Co-authored-by: Fayaz Ahmed <15716057+fayazara@users.noreply.github.com>
2022-06-10 19:29:52 +05:30
Pranav Raj SandGitHub 3f3ee6c34a chore: Add support for message_templates in API inbox (#4835) 2022-06-10 18:40:29 +05:30
Tejaswini ChileandGitHub 9bac5873ef chore: upgrade FB api version (#4834) 2022-06-10 12:26:21 +05:30
Fayaz AhmedandGitHub c5c89449dd fix: Remove validation for WhatsApp templates with no params (#4820) 2022-06-09 21:34:59 +05:30
Sojan JoseandGitHub 6385e42d9b chore: Update translations from Crowdin (#4833) 2022-06-09 21:30:03 +05:30
Sojan JoseandGitHub 74fa907010 chore: Update translations from Crowdin (#4822) 2022-06-08 21:36:47 +05:30
a9e84ec182 chore: Update translations from Crowdin (#4772)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-06-08 18:07:45 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
5d1729c7dd chore(deps): bump jmespath from 1.6.0 to 1.6.1 (#4808)
Bumps [jmespath](https://github.com/trevorrowe/jmespath.rb) from 1.6.0 to 1.6.1.
- [Release notes](https://github.com/trevorrowe/jmespath.rb/releases)
- [Changelog](https://github.com/jmespath/jmespath.rb/blob/main/CHANGELOG.md)
- [Commits](https://github.com/trevorrowe/jmespath.rb/compare/v1.6.0...v1.6.1)

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

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-08 10:08:27 +05:30
Jordan BroughandGitHub 635e544124 chore: Make "apk" commands consistent in Dockerfile (#4790)
* Make "apk" commands consistent in Dockerfile

1. Add "--no-cache" to some "apk" command that are missing it

* Remove "--update-cache" in Dockerfile

> As of Alpine Linux 3.3 there exists a new --no-cache option for apk. It allows
> users to install packages with an index that is updated and used on-the-fly and
> not cached locally
>
> This avoids the need to use --update-cache and remove /var/cache/apk/* when
> done installing packages.

https://github.com/gliderlabs/docker-alpine/blob/master/docs/usage.md
2022-06-07 19:49:32 +05:30
Tejaswini ChileandGitHub 772d92a4d3 fix: Facebook reauthorization mailer (#4695) 2022-06-07 17:50:51 +05:30
bad24f97ab feat: Add support for Whatsapp template messages in the UI (#4711)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-06-07 17:33:33 +05:30
Tejaswini ChileandGitHub 56f668db6b feat: Attribute changed filter for automations (#4621) 2022-06-07 13:01:01 +05:30
Pranav Raj SandGitHub 267252d13a chore: Remove flay, rspec from development/test group (#4795) 2022-06-06 12:43:19 +05:30
79a525aa62 feat: Add Bulk actions to conversations (#4647)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-06-03 11:12:22 +05:30
Vishnu NarayananandGitHub 43a0b4c039 fix: command execution in heredoc comment (#4783) 2022-06-02 19:51:50 +05:30
Pranav Raj SandGitHub 6b9f4d08ca fix: Disable marking IMAP connection as invalid for Standard Errors (#4764) 2022-06-02 11:38:58 +05:30
c7c46463ae fix: Update text used in personal message signature (#4776)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-06-01 18:41:18 +05:30
Pranav Raj SandGitHub b9aa4444b3 feat: Allow users to create dashboard apps to give agents more context (#4761) 2022-06-01 11:13:10 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
55f7be4ffc chore(deps): bump eventsource from 1.1.0 to 1.1.1 (#4774)
Bumps [eventsource](https://github.com/EventSource/eventsource) from 1.1.0 to 1.1.1.
- [Release notes](https://github.com/EventSource/eventsource/releases)
- [Changelog](https://github.com/EventSource/eventsource/blob/master/HISTORY.md)
- [Commits](https://github.com/EventSource/eventsource/compare/v1.1.0...v1.1.1)

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

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-01 10:57:18 +05:30
Fayaz AhmedandGitHub 3f382e5979 Handle falsy values for filename (#4766) 2022-05-31 16:38:24 +05:30
Sojan JoseandGitHub afc7c1ac64 chore: Update translations (#4755) 2022-05-30 18:39:20 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
e924ce8b4e chore(deps): bump rack from 2.2.3 to 2.2.3.1 (#4756)
Bumps [rack](https://github.com/rack/rack) from 2.2.3 to 2.2.3.1.
- [Release notes](https://github.com/rack/rack/releases)
- [Changelog](https://github.com/rack/rack/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rack/rack/compare/2.2.3...2.2.3.1)

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

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-30 17:18:18 +05:30
568c30e93e chore: Update ruby and docker base image to 3.0.4 (#4693)
* chore: Update ruby version to 3.0.4

* chore: update ruby version in docker workflow

* chore: update ruby version to 3.1.2

* Upgrade vue-jest to remove deasync

* Revert to 3.0.4 to see if deasync issue is fixed

* fix: script failure if pg/redis not opted in

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-05-27 17:33:24 +05:30
Devin EllisandGitHub 50d2dbd462 chore: Fix the exception while destructuring data in chatwoot:error listener (#4702) 2022-05-27 12:23:29 +05:30
52fad886b8 feat: Add business hours in downloadable reports (#4674)
Co-authored-by: Aswin Dev P.S <aswindevps@gmail.com>
2022-05-27 09:26:59 +05:30
Sojan JoseandGitHub dceeb57a1d chore: Update translations from Crowdin (#4751) 2022-05-26 20:23:36 +05:30
Sojan JoseandGitHub ab05dd9b9b chore: Improve the reauthorization requirement for Email Channel (#4753) 2022-05-26 20:23:00 +05:30
Tejaswini ChileandGitHub 47a6d9681a feat: send instagram message after 24 hours (#4698)
Added MESSAGE_TAG: HUMAN_AGENT for Instagram messages if the user wants to send it after the standard message window.

Fixes #4689
2022-05-26 19:05:30 +05:30
Pranav Raj SandGitHub 1215f37dda fix: Remove translated keys from locale files (#4748) 2022-05-25 17:06:31 +05:30
Pranav Raj SandGitHub 7434b60f71 fix: Revert changes to fix name updation from pre-chat form (#4741) 2022-05-25 12:38:23 +05:30
22d22cf4c3 feat: Improve Linux installation experience (#4713)
* feat: improve linux install script

* feat: setup logging and reduce verboseness

- redirect output/error to logfile
- reduce verboseness in main script exection
- trap non-zero exit

* chore: remove debug logging

* feat: fix exit handler

* improve legibility

* Apply suggestions from code review

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

* chore: improve formatting

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-05-25 12:30:00 +05:30
baa3efaf0e chore: Update cache name in Circle CI builds (#4738)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-05-24 22:15:57 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
d20eafbda4 chore(deps): bump nokogiri from 1.13.5 to 1.13.6 (#4734)
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.5 to 1.13.6.
- [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.13.5...v1.13.6)

---
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>
2022-05-24 11:12:19 +05:30
Pranav Raj SandGitHub 56cd9bc0b8 chore: Add Assignable Agents API (#4722) 2022-05-23 19:24:07 +05:30
Pranav Raj SandGitHub 79280ae372 chore: Enable Ukrainian language (uk) (#4720) 2022-05-23 12:46:17 +05:30
Sojan JoseandGitHub f74a1f7d5a chore: Update translations (#4691) 2022-05-23 11:33:54 +05:30
Aswin Dev P.SandGitHub 59969cc553 chore: Update conversations API to include unattended conversations. (#4708)
* Update conversations API to include unattended conversations.
2022-05-22 00:38:41 -07:00
Pranav Raj SandGitHub 11ea8a3032 chore: Update the documentation for configuring webhooks in the account (#4703) 2022-05-19 21:43:23 +05:30
Aswin Dev P.SandGitHub 8538660bbd Add first_reply_created event in conversation (#4576) 2022-05-18 21:16:33 -07:00
Pranav Raj SandGitHub 20565d09c0 fix: Update report method to fix issues with special characters (#4697) 2022-05-18 12:15:30 +05:30
Pranav Raj SandGitHub 47f04ee3fe chore: Add an option to download CSAT Reports (#4694) 2022-05-17 21:01:45 +05:30
Sojan 361ffbab82 Merge branch 'release/2.5.0' into develop 2022-05-16 16:55:34 +05:30
Sojan 63b1013b45 Merge branch 'release/2.5.0'
Publish Chatwoot CE docker images / build (push) Waiting to run
2022-05-16 16:55:24 +05:30
Pranav Raj SandGitHub b8f25d77bf chore: Enable New Message Button on Contact Panel (#4681)
Fixes: #4653
2022-05-16 16:41:40 +05:30
Tejaswini ChileandGitHub 938fb887c4 feat: Portal endpoint (#4633) 2022-05-16 13:59:59 +05:30
Sojan JoseandGitHub f620bdec54 chore: Update translations (#4682) 2022-05-16 12:45:45 +05:30
Pranav Raj SandGitHub 45e2cd4903 fix: Render links with target attribute (#4685) 2022-05-16 11:29:05 +05:30
Sojan 2060f270d3 Bump version to 2.5.0 2022-05-13 17:26:26 +05:30
Sojan JoseandGitHub 6535624cd6 chore: Update translations from Crowdin (#4665) 2022-05-13 11:38:49 +05:30
Vishnu NarayananandGitHub 8fbe470bdd feat: Control sidekiq log level via rails LOG_LEVEL env variable (#4675) 2022-05-13 11:34:43 +05:30
Hricha ShandilyandGitHub ab3ee74a86 chore: Update the note of Personal message signature (#4679) 2022-05-13 11:34:09 +05:30
Aswin Dev P.SandGitHub 41b8901432 Fix: Agent Reports counts when they have access to multiple accounts (#4663)
This change restricts the agent report API to fetch agent metrics from the current account.

Fixes: #4660
2022-05-11 14:31:57 +05:30
Tejaswini ChileandGitHub 329d305e92 Fix: Creating contacts for already outgoing/echo messages (#4668)
Check if the Instagram contact is already present in the system before throwing the exception.

Fixes: #4666
2022-05-11 14:29:38 +05:30
Sojan JoseandGitHub 5c161e0fef chore: Split Inbox Settings Page Component (#4664)
Clean up the Inbox settings page component as the logic was growing complex.

- Moved subpages like collaborators and configuration to new components
- Moved Assignment settings to the collaborators tab
- Introduced a new inbox seeder to quickly preview setting pages of all inbox types when in development
2022-05-11 13:33:24 +05:30
Pranav Raj SandGitHub 9cec091716 chore: Remove unused method scriptGenerator (#4671) 2022-05-11 12:05:42 +05:30
Tejaswini ChileandGitHub 9ed1f5d96b Fix: Make version changeable from the environment vars (#4654) 2022-05-10 19:20:55 +05:30
Sojan JoseandGitHub 81d0405473 chore: Ability to update user email via Platform APIs (#4659)
When the platform update API is called with a new user email, Chatwoot will still follow the same behaviour as in the dashboard where the user will have to confirm the new email activation link until the email gets updated on the user record.

In the case of platform APIs, this might not be the ideal behaviour since the original app will already have a flow to update the user emails. Hence we need to confirm the emails without the extra step in this case

fixes: #4510
2022-05-10 00:28:46 +05:30
Tejaswini ChileandGitHub f64cf85ab2 Fix: sentry issue for slack incoming files check (#4656)
Interpreter error for nil. any? added nil. present?

Fixes: https://sentry.io/share/issue/48c10d26490f4bdaab78c82244fcea98/
2022-05-09 23:54:45 +05:30
Tejaswini ChileandGitHub 0eeab8c56c Fix: slack repeated callback event message for attached files (#4610) 2022-05-09 19:18:30 +05:30
Sojan JoseandGitHub 5ce29a7beb chore: Update translations from Crowdin (#4652) 2022-05-09 18:57:05 +05:30
Sojan JoseandGitHub 04dfb034cc chore: Upgrade Exception tracking (#4638)
- Upgrade Sentry Libraries
- Enable provision for account and user info in error tracking
- Add ChatwootExceptionTracker

fixes: #4375
2022-05-09 14:23:19 +05:30
Aswin Dev P.SandGitHub 360b438a55 Fix: Campaign triggers first_response reporting event (#4607)
* Fix: Campaign triggers first_response reporting event

* fix spec failure
2022-05-09 01:34:52 -07:00
5b5a6d89c0 chore: "Channel::TwilioSms" to be unique on account_sid+phone_number (#4188)
"Twilio::IncomingMessageService" searches for the correct "Channel::TwilioSms"
by account_sid+phone_number.  If these values are duplicated then which record it
finds is indeterminate and may alternate between queries.

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2022-05-07 17:57:16 +05:30
Pranav Raj SandGitHub 2e0d43c093 chore: Use different files for widget and dashboard audio alert (#4637) 2022-05-06 20:19:36 +05:30
ef850eda0f feat: Add the SDK method to programatically toggle live chat bubble (#4223)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-05-06 19:30:48 +05:30
Sojan JoseandGitHub 80b8f5f915 chore: Update puma config as per recommendations (#3640)
Ability to configure workers for puma

ref:
https://devcenter.heroku.com/articles/concurrency-and-database-connections#threaded-servers
https://www.speedshop.co/2017/10/12/appserver.html
2022-05-06 16:38:44 +05:30
77a6893203 feat: Open "Switch Account" modal when clicking account name on dashboard (#4613)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-05-06 14:55:38 +05:30
Sojan JoseandGitHub 8d2b719dc1 chore: Sentry issues (#4623)
Fixes various issues reported on sentry

- Twilio channel creation validation errors
- Room Channel error with nil class
- Webhook Uri exception
2022-05-06 14:50:55 +05:30
Muhsin KelothandGitHub 4f9d41962a fix: Pre chat custom fields drag and drop (#4530) 2022-05-06 12:01:34 +05:30
Vishnu NarayananandGitHub 66d366f0ff chore: update newrelic gem to support log forwarding (#4626)
Newrelic gem 8.7 has application log forwarding support and
this is enabled by default. Update the gem to make use of this
feature. Chatwoot have turned this off by default though.

Set `NEW_RELIC_APPLICATION_LOGGING_ENABLED` to enable this feature. Make
sure to disable another log forwarding services you have to prevent
duplicated logs.

ref: https://docs.newrelic.com/docs/release-notes/agent-release-notes/ruby-release-notes/ruby-agent-870
Fixes: #4625
2022-05-05 23:57:55 +05:30
Pranav Raj SandGitHub 832a0f24a0 chore: Update missing packages in yarn.lock (#4627) 2022-05-05 19:29:51 +05:30
Sojan JoseandGitHub c9a8796a36 chore: Sentry Issue fixes (#4618)
Address the following sentry issues

fixes: #4616, #4617
2022-05-05 00:31:11 +05:30
giquieuandGitHub b3c8c83830 fix: unable to send audio messages on Telegram (#4493)
- Changed the lib used to record the audio (videojs-record). 
- Changed the audio recording format to .ogg, this will keep compatibility with sending to channels, Telegram, Whatsapp, Web Widget and API.
- Changed the visualization of recording waves, it is now using bars, the same format used by applications (Whatsapp and Telegram)


Fixes: #4115
2022-05-02 13:14:04 +05:30
Shivam ChaharandGitHub c1cc94e37c Fix: Accept phone number in public contact api (#4580)
This PR makes it possible to pass a phone number to the public contacts API.

Fixes #4023
2022-04-29 20:54:12 +05:30
Vishnu NarayananandGitHub 45099f40f1 fix: ce spec action for PRs from forks (#4587)
CE spec action was failing for PRs from external forks at the checkout stage. This PR modifies the checkout action to use the full repo name and branch.

#4586
2022-04-29 14:38:10 +05:30
Shivam ChaharandGitHub b5e0921d0d fix: sidekiq cron deprecation warnings (#4581)
Updates sidekiq-cron to fix the deprecation warnings

Fixes #4090
2022-04-29 00:43:10 +05:30
Tejaswini ChileandGitHub e5136c2691 Fix: File upload from slack (#4494)
When you upload a file from slack chat it's not appearing in the chatwoot inbox.
This is because Slack updated the webhook event format
2022-04-28 21:09:39 +05:30
Shivam ChaharandGitHub 04194e7247 Fix: attachment name for incoming messages
Use original_filename to get the name of the file attached to the message.

Had to add the message_type method to the WhatsApp/incoming_message_service due to the Assignment Branch Condition linter error for the attach_files method.

Fixes #4183
2022-04-28 21:02:17 +05:30
Aswin Dev P.SandGitHub 8d04894744 fix: Add index in conversation and reporting event (#4577)
Fixes chatwoot/product#422
2022-04-28 16:58:06 +05:30
Tejaswini ChileandGitHub cb38ec3267 chore: Allow Facebook channel to receive standby messages (#4511) 2022-04-28 01:14:03 +05:30
Pranav Raj SandGitHub 8348392d43 fix: Disable automation on tweets (#4571)
Fixes #4565
2022-04-27 20:10:40 +05:30
Aswin Dev P.SandGitHub 95c7a24dd1 fix: Unattendeed conversation count in agent metrics (#4568) 2022-04-27 06:26:35 -07:00
Pranav Raj SandGitHub 4250c40d1d chore: Upgrade rails to 6.1.5.1 (#4570) 2022-04-27 18:33:22 +05:30
3d824855f0 Fix positioning of read ticks on attachment message bubbles (#4545)
* Fix positioning of read ticks

* Review fixes

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: iamsivin <iamsivin@gmail.com>
2022-04-27 08:12:30 +05:30
Aswin Dev P.SandGitHub 1bf2da180b fix: Update agent metrics query to show data from current account (#4557)
* Update agent metrics query to fetch data from current account
2022-04-26 05:52:13 -07:00
Muhsin KelothandGitHub 3a5e34fccb fix: Check phone_number and email changes are exist before validation (#4551) 2022-04-26 15:13:28 +05:30
Sivin VargheseandGitHub fa031a0e2d feat: Adds support for canned responses in contact messages (#4453) 2022-04-26 09:04:34 +05:30
Aswin Dev P.SandGitHub 676796ddc7 feat: Add reports about live agent load (#4537)
* feat: Add reports about live agent load
2022-04-25 07:34:41 -07:00
899176a793 feat: Add event subscription option to webhooks (#4540)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2022-04-25 17:44:42 +05:30
Muhsin KelothandGitHub fa51fd1d73 fix: Bypass invalid values in contact patch end point (#4519) 2022-04-25 12:25:38 +05:30
1b3011b27b fix: Add Attachment endpoint to save file against automation rule (#4480)
Co-authored-by: fayazara <fayazara@gmail.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-04-24 12:02:40 +05:30
2acb48bbe0 feat: Add support for conversation attribute automation conditions in message event (#4518)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-04-21 20:52:23 +05:30
Muhsin KelothandGitHub b082b0e58c fix: Dig params in widget contact end point (#4516) 2022-04-21 20:39:45 +05:30
Sojan bd0ed322cc Merge branch 'hotfix/2.4.1' into develop 2022-04-21 14:19:18 +05:30
Sojan 3584bbb3af Merge branch 'hotfix/2.4.1'
Publish Chatwoot CE docker images / build (push) Waiting to run
2022-04-21 14:19:09 +05:30
Pranav Raj SandGitHub f769471439 fix: Issue with closed all hours (#4521)
fixing the accidentally merged conditions for open all day and closed all day.
2022-04-21 14:14:56 +05:30
Sojan f2815a2c00 Bump version to 2.4.1 2022-04-21 14:10:54 +05:30
Muhsin KelothandGitHub 27ddd77a1b chore: Sanitize html content (#4498) 2022-04-21 11:27:28 +05:30
Sojan JoseandGitHub 2c73df4292 Chore: Provide fixed attachment URLs for Channels (#4507)
Prior to this change, The attachment URL sent from Chatwoot to 3rd party integrations like Whatsapp and Facebook
involved a 301 redirect before the original content is served. This causes intermittent breakages for the sent attachments.

fixes: #3632
ref: https://blog.saeloun.com/2021/09/14/rails-7-adds-expiring-urls-to-active-storage.html
2022-04-20 22:42:13 +05:30
2b2252b66e feat: Add a read indicator for web-widget channel (#4224)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-04-20 16:03:12 +05:30
Pranav Raj SandGitHub f2f0d466f2 chore: Update Help Center APIs to accomodate locale (#4515) 2022-04-20 16:00:37 +05:30
Muhsin KelothandGitHub 4f3a271355 chore: Add custom attributes in campaign.triggered event (#4463) 2022-04-20 10:49:52 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
5b9c4bf7f1 chore(deps): bump async from 2.6.3 to 2.6.4 (#4497)
Bumps [async](https://github.com/caolan/async) from 2.6.3 to 2.6.4.
- [Release notes](https://github.com/caolan/async/releases)
- [Changelog](https://github.com/caolan/async/blob/v2.6.4/CHANGELOG.md)
- [Commits](https://github.com/caolan/async/compare/v2.6.3...v2.6.4)

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

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-19 17:13:17 +05:30
Muhsin KelothandGitHub 26f23a6e21 feat: Custom fields in pre-chat form (#4189) 2022-04-19 12:47:29 +05:30
Tejaswini ChileandGitHub 1ccd29140d Feat: send fb message outside of standard messaging window (#4439) 2022-04-19 12:21:20 +05:30
Sojan d2d838afd1 Merge branch 'release/2.4.0' into develop 2022-04-18 23:25:59 +05:30
Sojan 480eb3043c Merge branch 'release/2.4.0'
Publish Chatwoot CE docker images / build (push) Waiting to run
2022-04-18 23:25:37 +05:30
Sojan 569ae24d8a Bump version to 2.4.0 2022-04-18 23:23:17 +05:30
Sojan JoseandGitHub 615a575bdd fix: Agent typing indicator for website widget (#4495)
When we migrated the pubsub tokens from contact to contact inboxes, we missed out on doing this update for the typing indicator events. Hence the agent typing events weren't visible on the widget side. This change fixes that and removes the necessary column contact pubsub token from the model.

fixes: #4476
2022-04-18 19:05:45 +05:30
Pranav Raj SandGitHub 17fb6b8d55 fix: Update business hour calculation (#4496) 2022-04-18 18:15:20 +05:30
Muhsin KelothandGitHub e010f0c6f0 chore: Sync pre-chat fields after custom attribute destroy (#4456) 2022-04-18 14:06:27 +05:30
Shivam ChaharandGitHub 04e890070d fix: Change report_type to type in report API docs (#4492) 2022-04-18 11:38:22 +05:30
Pranav Raj SandGitHub 0319b78eac fix: Allow users to login even if they have access to more than 15 accounts (#4475) 2022-04-14 20:54:26 +05:30
Vishnu NarayananandGitHub 80e5d6d7a0 feat: add chatwoot_edition variable for CE docker images (#4462)
* chore: add chatwoot_edition variable for CE docker images

* fix cw_edition variable

* chore: update comment

* feat: include cw_edition data in payload to hub

* refactor cw_edition to edition
2022-04-14 17:15:57 +05:30
337a74a10c feat: Add send message, fix issues with message conditions (#4423)
Co-authored-by: Tejaswini <tejaswini@chatwoot.com>
2022-04-14 13:36:55 +05:30
d4be268cc3 enhancement: Remove clickaway for expanded reply box (#4414)
* enhancement: Remove clickaway for expanded reply box

* Removes unused imports

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2022-04-13 12:04:34 +05:30
Tejaswini ChileandGitHub a6b119d187 Feat: twitter image support (#4429) 2022-04-13 01:29:51 +05:30
Tejaswini ChileandGitHub 923b4637db chore: Automation bug fix (#4442) 2022-04-12 20:23:34 +05:30
b6ad468eb4 fix: Nokogiri bundle update (#4448)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2022-04-12 11:30:54 +05:30
14503b5fe0 feat: Add missing password validation at signup (#4441)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-04-12 11:08:12 +05:30
c64e2e3bc5 chore: Report improvements (#4392)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-04-11 20:57:22 +05:30
Aswin Dev P.SandGitHub 31cdc63e18 fix: Remove IMAP and SMTP email validation (#4435)
* Remove IMAP and SMTP email validation
* Rename imap_email & smtp_email columns to imap_login & smtp_login respectively.
* Use channel email domain if inbound email domain not present
2022-04-11 07:07:20 -07:00
Nithin David ThomasandGitHub 3d164271a8 fix: Yellow color shades are inconsistent (#4391) 2022-04-11 17:27:28 +05:30
Sojan JoseandGitHub 1194188f13 chore: Swagger doc for Conversation meta API (#4394)
fixes: https://github.com/chatwoot/chatwoot/issues/4327
2022-04-11 16:43:09 +05:30
Aswin Dev P.SandGitHub 9b5eb98c59 feat: Support additional authentication mechanisms for SMTP (#4431)
* Support additional authentication mechanisms for SMTP
2022-04-11 03:13:05 -07:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
8622740161 chore(deps): bump moment from 2.29.1 to 2.29.2 (#4434)
Bumps [moment](https://github.com/moment/moment) from 2.29.1 to 2.29.2.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/moment/moment/compare/2.29.1...2.29.2)

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

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-11 15:10:37 +05:30
Muhsin KelothandGitHub fb3ed29c90 chore: Add missing test cases in conversations_controller_spec (#4438) 2022-04-11 14:06:44 +05:30
Aswin Dev P.SandGitHub f1ae09d21b fix: SMTP shouldn't be configurable without IMAP enabled (#4428)
* fix: Configure SMTP only if IMAP is enabled
2022-04-11 00:05:03 -07:00
Pranav Raj SandGitHub b1efcde495 feat: Remove duplicate Switch Component (#4427) 2022-04-08 18:25:08 +05:30
Pranav Raj SandGitHub bc7bcc20b8 Revert "feat: Adds support for draft in conversation reply box (#4205)" (#4425)
This reverts commit 5ea0436051.
2022-04-08 15:52:39 +05:30
Muhsin KelothandGitHub 7e5ec7925c feat: Add phone_number & custom_attributes in create conversation end point (#4421) 2022-04-08 14:53:37 +05:30
727993aa19 feat: Add toggle button component(#4419)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2022-04-08 14:02:26 +05:30
Aswin Dev P.SandGitHub d5536d65f7 feat: Consider business hours while generating the reports (#4330)
* feat: Consider business hours while generating the reports
2022-04-08 00:18:18 -07:00
Tejaswini ChileandGitHub 57359be37e Fix: Find mailbox with cc email (#4372) 2022-04-08 11:20:19 +05:30
Sivin VargheseandGitHub 14e6a5d6b0 fix: Background dark mode colour issue in campaign view (#4416) 2022-04-08 10:54:51 +05:30
5ea0436051 feat: Adds support for draft in conversation reply box (#4205)
* Add draft support

* Fixes issue with draft loading

* Adds draft for private notes

* Use localstorage helper

* .remove instead of .clear

* Remove timestamp

* clearLocalStorageOnLogout

* Fix draft save on refresh

* Remove usage of delete operator

* Adds autosave for draft messages

* Remove setinterval and add debounce

* Removes draft redundancy check

* Adds test cases for debouncer

* Update app/javascript/shared/helpers/specs/TimeHelpers.spec.js

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

* Update app/javascript/shared/helpers/specs/TimeHelpers.spec.js

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

* Review fixes

* Fixes issue with debouncer

* FIxes debouncer issue

* Fixes issue with draft empty message

* Removes empty keys from local storage drafts

* Fixes error with empty draft

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
Co-authored-by: Fayaz Ahmed <15716057+fayazara@users.noreply.github.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: iamsivin <iamsivin@gmail.com>
2022-04-07 22:16:45 +05:30
Muhsin KelothandGitHub dfb56f6bb8 doc: Swagger for custom attribute APIs (#4382) 2022-04-07 19:01:31 +05:30
d4a046a21e fix: Audio notification would not work without action on the dashboard (#4303)
* fixes: Audio notification would not work without an action on dashboard

* fixes spec

* Minor fixes

* Minor fixes

* Review fixes

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2022-04-07 10:23:18 +05:30
Fayaz AhmedandGitHub 8482ecc1b1 Feat - Sort inboxes alphabetically (#4383) 2022-04-07 10:01:08 +05:30
Sivin VargheseandGitHub 5b490bc8cc chore: fix scroll bar color in the dark mode (#4404) 2022-04-07 07:14:40 +05:30
Muhsin KelothandGitHub c2afdd5c93 chore: Remove unnecessary fields from notification payload (#4403) 2022-04-07 00:07:53 +05:30
Vishnu NarayananandGitHub 75ce5345a9 feat: add gh action to build Chatwoot CE/foss docker image (#4406)
Github action to build and push chatwoot-ce(foss) edition images. This action will run on merges to master, develop and when tags are created. Corresponding docker tags are as follows.

GitHub branch/tag  -->	docker tag
----
master 	--> latest-ce
develop 	---> develop-ce
v2.3.2 	---> v2.3.2-ce
v* 	---> v*-ce

Fixes #4388
2022-04-06 21:14:04 +05:30
9329f08e14 chore: Fix typo in en localisation file (#4405)
Fix

Co-authored-by: Vishnu Narayanan <vishnu@chatwoot.com>
2022-04-06 20:21:19 +05:30
Pranav Raj SandGitHub 0b03e4b296 feat: Add an option to disable endConversation button (#4352) 2022-04-06 13:54:55 +05:30
Tejaswini ChileandGitHub 821b953ee9 Fix: handling UTF encoded mail (#4384) 2022-04-06 12:36:32 +05:30
Sojan JoseandGitHub 7a8aa4ca2e chore: Add Swagger Doc for Team Members (#4390)
Add swagger documentation for Team Members APIs
2022-04-05 16:05:49 +05:30
2595e774e5 fix: Update validations in automation edit actions (#4370)
Co-authored-by: fayazara <fayazara@gmail.com>
2022-04-05 15:22:56 +05:30
Sojan JoseandGitHub 9a8a0bd865 feat: Ability to customize the online presence duration (#4385) 2022-04-05 15:20:34 +05:30
cd5646b4b9 fix: Skip contact_last_seen_at in empty conversation payload (#4387)
* Fix undefined `last_seen_at` empty conversation

* chore: remove the comment

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2022-04-05 14:00:07 +05:30
Vishnu NarayananandGitHub 76f53d9a11 feat: add gh action to run CE edition tests (#4342)
* feat: add gh action to run CE spec

* setup ruby
* add pg,redis services
* fix failing tests
2022-04-04 19:27:01 +05:30
Muhsin KelothandGitHub 591d186d66 chore: Add agent_last_seen_at in conversation API (#4377) 2022-04-04 18:23:38 +05:30
Jordan BroughandGitHub 73d8073530 chore: Fix test failure in action_cable_listener_spec.rb due to ordering (#4357) 2022-04-04 15:15:45 +05:30
Muhsin KelothandGitHub 1dd0c7249c fix: Unread notification count in multiple accounts (#4373)
Fixes: #4367
2022-04-04 14:34:01 +05:30
Pranav Raj SandGitHub 3509692055 chore: Fix brand name in survey translations (#4360) 2022-04-03 19:22:56 +05:30
Sivin VargheseandGitHub 5d85a21287 fix: Fix login button is missing in Safari (#4332)
Fixes #4328
2022-04-01 21:03:53 +05:30
caee9535f1 feat: Support Dark mode for the widget (#4137)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-04-01 20:59:03 +05:30
Vishnu NarayananandGitHub 3813b3b372 feat: make linux script installation non-interactive (#4355)
This PR changes the LetsEncrypt behaviour to be non-interactive. Earlier, the installation flow was waiting for user input at the SSL cert generation stage. With this change, once the user confirms completes the initial selection, the installation can be completed unattended.
2022-04-01 00:34:50 +05:30
Pranav Raj SandGitHub c397fe1964 fix: Update the URL for POST inbox_members (#4354) 2022-03-31 21:21:25 +05:30
cb23ff53bf fix: Reset Captcha if account signup is an error (#4279)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-03-31 21:20:37 +05:30
Sivin VargheseandGitHub 3cd1616df6 fix: Fix agent name in Twitter channel private note acting as a link (#4326) 2022-03-31 20:22:52 +05:30
Muhsin KelothandGitHub eff3a50316 fix: Disable showing read messages in unread view (#4324) 2022-03-31 17:35:39 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
0477123f92 chore(deps): bump minimist from 1.2.5 to 1.2.6 (#4351)
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

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

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-31 16:33:14 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
c9f821cc5b chore(deps): bump puma from 5.6.2 to 5.6.4 (#4348)
Bumps [puma](https://github.com/puma/puma) from 5.6.2 to 5.6.4.
- [Release notes](https://github.com/puma/puma/releases)
- [Changelog](https://github.com/puma/puma/blob/master/History.md)
- [Commits](https://github.com/puma/puma/compare/v5.6.2...v5.6.4)

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

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-31 16:02:53 +05:30
baf697f064 design: Changes yellow color palette for better contrast ratio (#4334)
Co-authored-by: Fayaz Ahmed <15716057+fayazara@users.noreply.github.com>
2022-03-30 18:53:24 +05:30
Tejaswini ChileandGitHub 5be9380547 Fix: html mail fix with html_body content (#4011) 2022-03-30 18:04:30 +05:30
Muhsin KelothandGitHub 24b20c10ce fix: Referer URL validation (#4309)
Fixes #354
2022-03-30 14:36:22 +05:30
Tejaswini ChileandGitHub bfe6324d9a chore: Webhook event data improvements (#4317) 2022-03-30 11:37:36 +05:30
Tejaswini ChileandGitHub 15fd37b124 Feat: attachments automation (#4266) 2022-03-30 08:08:58 +05:30
3f2ac2042f fix: Fetch conversation attributes after contact reset (#4319)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2022-03-29 19:51:51 +05:30
Tejaswini ChileandGitHub 3158966241 Feat: automation rule based on contact conditions (#4230) 2022-03-29 17:29:34 +05:30
Fayaz AhmedandGitHub c674393c02 feat: New automation actions (#4033) 2022-03-29 13:27:16 +05:30
Kyle KillionandGitHub cffc984ef6 chore: Add active_storage_purge queue to Sidekiq (#4322)
I found that these jobs were just enqueuing without processing until I added this queue after switching to S3 storage. This fixed that issue.
2022-03-29 11:43:07 +05:30
Aswin Dev P.SandGitHub 5e8fd689c9 feat: Add live agent load report api (#4297)
This change allows the admin user to fetch conversation metrics for an account, agents, and filter conversation metrics for a specific agent.

Fixes #4305
2022-03-29 10:31:52 +05:30
Muhsin KelothandGitHub ccf52a620b feat: Update notifications and unread count in real time (#4261) 2022-03-28 20:01:23 +05:30
Vishnu NarayananandGitHub ec0ea0b1dc chore: Upgrade to next gen docker convenience image (#4310)
* chore: Upgrade to next gen docker convenience image

https://discuss.circleci.com/t/legacy-convenience-image-deprecation/41034/16

* switch to postgres:14.1 and redis:6.2 images
2022-03-28 18:15:38 +05:30
Vishnu NarayananandGitHub 8155024b6a feat: fix logging levels (#4314)
https://ruby-doc.org/stdlib-2.7.0/libdoc/logger/rdoc/Logger.html

Fixes https://github.com/chatwoot/chatwoot/issues/4313
2022-03-28 18:14:30 +05:30
823c0ab6a7 chore: Use Round Robin service for team assignment (#4237)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-03-28 14:38:07 +05:30
e8bc30e3c6 feat: Add a confirmation note before deleting a note about a contact (#4294)
Co-authored-by: Richardo <richardokusuma.sali@medirecords.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-03-28 14:19:12 +05:30
Fayaz AhmedandGitHub 30ac8054ba feat: Add an SDK method for opening conversation in popout window (#4232) 2022-03-28 13:31:51 +05:30
Aswin Dev P.SandGitHub 0ba6e772a4 feat: Display how many conversations are considered for the metric calculation (#4273)
* feat: Display how many conversations are considered for the metric calculation
2022-03-28 00:38:23 -07:00
Aswin Dev P.SandGitHub ba0188aefc fix: Report spec failure (#4304) 2022-03-28 12:31:09 +05:30
Sojan JoseandGitHub e0f29b9d81 chore: Add swagger docs for Canned Responses (#4295)
fixes: #3962
2022-03-26 00:43:44 +05:30
Pranav Raj SandGitHub 971755b845 fix: Remove unnecessary dispatchWindowEvent (#4288) 2022-03-25 20:25:07 +05:30
0667d9f016 fix: Avatars get cropped on the widget (#4238)
Co-authored-by: Fayaz Ahmed <15716057+fayazara@users.noreply.github.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2022-03-25 19:20:53 +05:30
Sivin VargheseandGitHub 48389d69d8 feat: New notification panel for unread notifications (#4061)
Fixes: #4052
2022-03-25 19:02:45 +05:30
Sojan JoseandGitHub ff881fcad9 chore: Support Email should give priority to environment variable (#4270)
Account.support_email should give priority to environment variables over installation config

Fixes: #3304
2022-03-25 16:13:45 +05:30
SagarandGitHub 5da0b0667f Fix: SMTP IMAP configuration from email
This fix should allow emails from the "Email" inbox to show from as "Name <email@example.com>". if SMTP within Inbox is disabled.
2022-03-25 16:05:26 +05:30
Jordan BroughandGitHub a8cfcbc168 chore: Timezone fixes for ReportBuilder and for ReportController spec (#4246)
- ReportBuilder wasn't using the specified time zone for the timestamp in the
"build" method
- The ReportController spec was calling `Time.zone.today.to_time`, but
`Date#to_time` disregards the zone from `Time.zone` and reverts to the system
time zone.
2022-03-25 14:00:27 +05:30
6bfe0f2fc1 feat: Add support for rich editor and allow CCs in email for a new conversation. (#4194)
* feat: Add support for rich editor and allow CCs in email for a new conversation.

* Minor fixes

Co-authored-by: Fayaz Ahmed <15716057+fayazara@users.noreply.github.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2022-03-25 11:27:45 +05:30
Jordan BroughandGitHub 131c0a8668 chore: Don't send confirmation email when creating User via platform api (#4272)
The platform api automatically confirms users so we don't need to send this
email.
2022-03-25 00:36:59 +05:30
Sojan JoseandGitHub 8e153d6350 fix: Redis 6 on Heroku breaks ActionCable config (#4269)
Heroku made some SSL/TLS changes with Redis 6, which is breaking the ActionCable configuration.
Hence providing an environment variable configuration `REDIS_OPENSSL_VERIFY_MODE` to fix that.

set the value `none` for this environment variable in your Heroku installations where breakage occurs.

fixes: #2420
2022-03-24 19:25:07 +05:30
Tejaswini ChileandGitHub 60a0709de6 Fix: added validation for custom and additional attribute (#4260) 2022-03-24 15:38:28 +05:30
Jordan BroughandGitHub 14c53b8b54 chore: Use "contain_exactly" in some tests (#4243) 2022-03-24 13:50:04 +05:30
Vishnu NarayananandGitHub 7577c9c888 fix: drop conv and campaign seq on account delete (#4256)
Conversation and campaign sequences persist in the database even after the related account is deleted. This PR adds an after_desttory callback on the account model that will delete the associated sequences.

Fixes: #4252
2022-03-24 13:33:15 +05:30
Jordan BroughandGitHub 0cf970dafd chore: Eliminate deprecation warning in "app_config_controller_spec.rb" (#4258)
Fix the warning:

Using `should` from rspec-expectations' old `:should` syntax without
explicitly enabling the syntax is deprecated. Use the new `:expect` syntax
or explicitly enable `:should` with `config.expect_with(:rspec) { |c| c.syntax = :should }` instead.
2022-03-24 13:31:19 +05:30
Jordan BroughandGitHub c2647a1f27 chore: Use "destroy!" instead of "destroy" when not checking the return value (#4259) 2022-03-24 13:28:25 +05:30
giquieuandGitHub 8b9aea231c feat: support audio player on widget (#4250) 2022-03-24 12:44:34 +05:30
Jordan BroughandGitHub b735135431 chore: Fix "action_mailer.delivery_method" in the test env (#4257)
Fixes: #4247
2022-03-23 20:46:28 +05:30
Sojan 160e8a8ab4 Merge branch 'release/2.3.2' into develop 2022-03-23 19:06:52 +05:30
Sojan 2605f24539 Merge branch 'release/2.3.2' 2022-03-23 19:06:45 +05:30
Sojan dd76dd4204 Bump version to 2.3.2 2022-03-23 19:05:34 +05:30
86b4183bde fix: Add multiple file paste support and fix for bugs (#4066)
- Add multiple files paste support.
- Fixes showing file name in the editor field when we paste the file from finder.
- Fixes showing the image in the advance editor when we paste the image as an attachment from the clipboard.

Fixes: #4036

Co-authored-by: Nithin David <1277421+nithindavid@users.noreply.github.com>
2022-03-23 18:25:57 +05:30
Jordan BroughandGitHub 4a21633a2b chore: Use bang version of "find_or_create_by!" in Platform UsersController (#4248) 2022-03-23 16:09:10 +05:30
Sojan JoseandGitHub f8c46341f6 chore: Disable invalid contact resolved activity messages (#4253)
Fixes the bug which triggered "Contact resolved conversation" activity messages when snoozed conversations where reopened
2022-03-23 16:08:42 +05:30
Pranav Raj SandGitHub 771cb5b9fc fix: Update scroll event name to fix auto-scroll (#4251)
Fixes #3622
2022-03-23 13:27:50 +05:30
Sojan JoseandGitHub f43018e017 chore: New translations automation.json (Italian) (#4231) 2022-03-22 12:42:10 +05:30
Sojan JoseandGitHub 467f3b9191 chore: Disable fetching new emails after mailbox error (#4176)
- Disabled email fetch job if credentials for the channel isn't working
- notify customers when the email channel isn't working

fixes: https://github.com/chatwoot/chatwoot/issues/4174
2022-03-22 12:14:17 +05:30
Muhsin KelothandGitHub 715400f7ab fix: Disable pre-chat fields for identified users (#4234) 2022-03-22 01:28:22 +05:30
Tejaswini ChileandGitHub 7b4cac746a feat: enhancement to un-send instagram message (#4120) 2022-03-21 17:10:15 +05:30
Sojan JoseandGitHub 6169d172d8 chore: Update translations from Crowdin (#4217) 2022-03-21 13:15:33 +05:30
Tejaswini ChileandGitHub e06a6a7c55 Automation enhancement (#4087) 2022-03-21 13:12:27 +05:30
c608ca37e0 fix: Contact conversations are showing in the chat list (#4078)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-03-21 11:46:43 +05:30
Pranav Raj SandGitHub 6097f4c122 fix: Update survey locale based on the account (#4207) 2022-03-20 13:07:36 +05:30
Fayaz AhmedandGitHub 8372ae418e System default monospace fonts for code elem (#4222) 2022-03-19 20:56:29 +05:30
Sojan JoseandGitHub 71391d982b chore: filter .xml files for Bandwidth SMS (#4206)
MMS sent from an ATT or Verizon phone number seems to be appending a SMIL file in .xml format for MMS.
2022-03-18 19:00:36 +05:30
b77fad52fb fix: Add missing contact information to fix invalid activity messages (#4195)
Co-authored-by: Tejaswini <tejaswini@chatwoot.com>
2022-03-18 13:43:02 +05:30
Sojan JoseandGitHub 40f31cb0a3 chore: Update translations (#4208) 2022-03-18 11:24:22 +05:30
7f8a199b29 chore: Update translations (#4099)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-03-17 20:02:32 +05:30
Muhsin KelothandGitHub 23fe8847d8 feat: Notification action cable event (#4154) 2022-03-17 18:56:36 +05:30
Sojan 430547e026 Merge branch 'hotfix/2.3.1' into develop 2022-03-17 16:55:00 +05:30
Sojan d0702363f4 Merge branch 'hotfix/2.3.1' 2022-03-17 16:54:49 +05:30
Sojan d6d0c79618 Bump version to 2.3.1 2022-03-17 16:53:36 +05:30
Sojan JoseandGitHub 9f8e442333 chore: Improve n+1 queries (#4202)
Fixes the n+1 queries that get triggered while accessing agents endpoint
2022-03-17 15:57:32 +05:30
Pranav Raj SandGitHub 4a3ddad02f fix: Reduce the height of the unread container while campaign is active (#4185) 2022-03-16 14:45:57 +05:30
Tejaswini ChileandGitHub 207a03155e Feat: authenticate direct upload (#4160) 2022-03-16 13:54:18 +05:30
Sojan 796a7805db Merge branch 'release/2.3.0' into develop 2022-03-15 23:04:09 +05:30
Sojan a50ea9c88a Merge branch 'release/2.3.0' 2022-03-15 23:03:59 +05:30
Sojan 711251560b Bump version to 2.3.0 2022-03-15 22:59:54 +05:30
c4837cd7ac feat: End conversation from widget (#3660)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Fayaz Ahmed <15716057+fayazara@users.noreply.github.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-03-15 22:07:30 +05:30
Pranav Raj SandGitHub 4b748e2c8c fix: Delete content_attributes in message destroy API (#4184) 2022-03-15 22:01:16 +05:30
8c8c5a77c8 feat: Show banner message if Chatwoot update available (#3999)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Fayaz Ahmed <15716057+fayazara@users.noreply.github.com>
Co-authored-by: Pranav <pranav@chatwoot.com>
2022-03-15 21:09:14 +05:30
Sojan JoseandGitHub 02dd5ecfab chore: 360Dialog attachments fix (#4173)
fixes: #3701
2022-03-15 17:42:21 +05:30
Muhsin KelothandGitHub f405572e5c Revert "feat: Custom fields in pre-chat form (#4135)" (#4182)
This reverts commit e730804b48.
2022-03-15 16:54:33 +05:30
Sojan JoseandGitHub 25876993ff fix: NoMethodError: undefined method `id' for nil:NilClass (#4172)
fixes: #4171
2022-03-15 14:30:33 +05:30
b3ba8b9513 fix: Could not able to create label (#4161)
* fixes: Could not able to create label

* review fixes

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2022-03-14 20:43:56 +05:30
Fayaz AhmedandGitHub 4a2452173e feat: Added support for Created At, Last Activity At filters in the UI (#4031) 2022-03-14 20:24:53 +05:30
Aswin Dev P.SandGitHub c62d74a01d feat: Display trends in report metrics (#4144) 2022-03-14 18:15:27 +05:30
Sivin VargheseandGitHub 5edf0f2bbe fix: Fix modal responsiveness (#4149) 2022-03-14 18:14:16 +05:30
Fayaz AhmedandGitHub dd1fe4f93a fix: Handle unsanitized markup in DOM (#4110) 2022-03-14 18:13:21 +05:30
Muhsin KelothandGitHub e730804b48 feat: Custom fields in pre-chat form (#4135)
Fixes: #2744
2022-03-14 15:06:56 +05:30
Sivin VargheseandGitHub 578414d788 feat: Adds ability to delete contact without having to type name (#4155) 2022-03-11 17:00:55 +05:30
Sivin VargheseandGitHub 619441ce1c fixes: Showing vue warning in the console (#4152)
* fixes: Showing vue warn with PR#4100

* Minor fixes
2022-03-10 22:06:59 +05:30
Nithin David ThomasandGitHub 3c3b6f90c7 fix: Add base_url to the audio notification file (#4116) 2022-03-10 20:40:47 +05:30
Tejaswini ChileandGitHub 647efa12e7 fix: Attach instagram images with file type story_mentions (#4100) 2022-03-10 20:27:30 +05:30
b3545f42f1 fixes: Contact search is skipping the '+' sign for email. (#4142)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-03-10 11:15:41 +05:30
Pranav Raj SandGitHub fb03b6f434 chore: Upgrade rails to 6.1.4.7 to fix (#4143)
Fixes CVE-2022-21831
2022-03-10 11:01:40 +05:30
Pranav Raj SandGitHub 1aa7d6f7d8 fix: Update brand name in mailers (#4123) 2022-03-08 09:22:57 +05:30
giquieuandGitHub 96b719017b feat: Ability to send voice message to channel (#4064)
Created the possibility to send audio as an attachment via the dashboard.
The channels that can send audio are the same channels that can send any type of attachment.
Used RecordRTC (https://github.com/muaz-khan/RecordRTC) to capture the audio and Wavesurfer (https://github.com/katspaugh/wavesurfer.js) to display the audio waves.
RecordRTC can be used to record videos if necessary.

Fixes #1973
2022-03-04 19:43:07 +05:30
Aswin Dev P.SandGitHub b94e67f5d7 feat: Add agents filter in CSAT reports (#4106)
* add agents filter in csat reports
2022-03-04 03:49:26 -08:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Pranav Raj S
c76b588850 chore(deps): bump marked from 2.0.3 to 4.0.10 (#3771)
* chore(deps): bump marked from 2.0.3 to 4.0.10

Bumps [marked](https://github.com/markedjs/marked) from 2.0.3 to 4.0.10.
- [Release notes](https://github.com/markedjs/marked/releases)
- [Changelog](https://github.com/markedjs/marked/blob/master/.releaserc.json)
- [Commits](https://github.com/markedjs/marked/compare/v2.0.3...v4.0.10)

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

Signed-off-by: dependabot[bot] <support@github.com>

* use {marked}

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-03-04 14:53:40 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Muhsin KelothNithin David Thomas
a28b911132 chore(deps): bump url-parse from 1.5.7 to 1.5.10 (#4076)
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.7 to 1.5.10.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](https://github.com/unshiftio/url-parse/compare/1.5.7...1.5.10)

---
updated-dependencies:
- dependency-name: url-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
2022-03-04 10:58:05 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
6e4ae1a1bc chore(deps): bump commonmarker from 0.23.2 to 0.23.4 (#4108)
Bumps [commonmarker](https://github.com/gjtorikian/commonmarker) from 0.23.2 to 0.23.4.
- [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.2...v0.23.4)

---
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>
2022-03-04 10:57:22 +05:30
Pranav Raj SandGitHub 9583a2dbad chore: Pass sso_account_id to select the account during SSO Login (#4103) 2022-03-03 20:49:51 +05:30
Sojan JoseandGitHub 11adfd2384 chore: remove unnecessary dependent destroy (#4104) 2022-03-03 13:02:02 +05:30
Pranav Raj SandGitHub 28d102f526 fix: Show new message screen instead of input field (#4102) 2022-03-03 12:36:31 +05:30
3d7ca61481 Show email signature with maximum height 8vh, fixes #4021 (#4063)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Fayaz Ahmed <15716057+fayazara@users.noreply.github.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
2022-03-02 15:28:56 +05:30
Sojan JoseandGitHub 7b9e4982cf Feat: Support MMS in SMS Channel ( Bandwidth ) (#4046)
Ability to send and receive MMS to bandwidth channel

fixes: #3961
2022-03-02 15:09:56 +05:30
4d458c2184 feat: Support respective input types in custom attributes - filters (#4032)
* Support differnt input types in custom attributes

* Handle list type custom attributes

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Vishnu Narayanan <vishnu@chatwoot.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2022-03-02 14:16:42 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
0582d15eb5 chore(deps): bump image_processing from 1.12.1 to 1.12.2 (#4095)
Bumps [image_processing](https://github.com/janko/image_processing) from 1.12.1 to 1.12.2.
- [Release notes](https://github.com/janko/image_processing/releases)
- [Changelog](https://github.com/janko/image_processing/blob/master/CHANGELOG.md)
- [Commits](https://github.com/janko/image_processing/compare/v1.12.1...v1.12.2)

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

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-02 10:31:37 +05:30
915fe3897c chore: Add Github in contact social profiles (#4086)
* Add github in social links

* Code cleanup

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2022-03-01 14:33:26 +05:30
Muhsin KelothandGitHub f08d1b35d0 feat: Toggle automation status (#3991) 2022-03-01 14:14:23 +05:30
a3cb26a317 fix: AudioContext warning when loading widget on Chrome (#3956)
* fix: AudioContext warning when loading widget on Chrome

* minor fixes

* Minor fixes

* adds event on document

* Play audio from parent window through SDK

* Adds notification to dashboard

Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Vishnu Narayanan <vishnu@chatwoot.com>
2022-02-28 21:43:24 +05:30
eee89bf0d8 feat: Show cc from last email on reply editor (#3983)
* Adds last emails to reply editor

* Fixes bug in reply box

* Adds test cases

* Prevents private notes having cc bcc data

* Prevents private notes having cc bcc data

* Init reply head with values

* fix broken tests

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Fayaz Ahmed <15716057+fayazara@users.noreply.github.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2022-02-28 21:42:50 +05:30
Muhsin KelothandGitHub 1de18391b4 fix: Handle invalid country code in contact details (#4081) 2022-02-28 19:48:13 +05:30
Muhsin KelothandGitHub bb16780278 chore: Upgrade utils to 0.0.5 (#4082) 2022-02-28 18:50:29 +05:30
4260441f8c Chore: clean up Reporting Events (#4044)
Tech debt clean up

Fixes #4057

Co-authored-by: Aswin Dev P S <aswin@chatwoot.com>
2022-02-28 18:16:12 +05:30
12c0be002e feat: Format time in reports (#4072)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-02-28 16:54:43 +05:30
Muhsin KelothandGitHub aff14b697f chore: Add webhook URL validation (#4080) 2022-02-28 15:44:02 +05:30
Pranav Raj SandGitHub 87a6266ddc fix: Add resetTriggered flag to fix reset loop (#4079) 2022-02-28 14:53:11 +05:30
Sojan cebb1bf871 Merge branch 'release/2.2.1' into develop 2022-02-28 14:12:36 +05:30
Muhsin KelothandGitHub 46c1734ba1 feat: Add additional attributes in setUser method (#3958) 2022-02-28 12:10:55 +05:30
3641 changed files with 227654 additions and 29003 deletions
+88 -24
View File
@@ -7,16 +7,20 @@ defaults: &defaults
working_directory: ~/build
docker:
# specify the version you desire here
- image: cimg/ruby:3.0.2-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: circleci/postgres:alpine
- image: circleci/redis:alpine
- image: cimg/postgres:14.1
- image: cimg/redis:6.2.6
environment:
- CC_TEST_REPORTER_ID: b1b5c4447bf93f6f0b06a64756e35afd0810ea83649f03971cbf303b4449456f
- RAILS_LOG_TO_STDOUT: false
- COVERAGE: true
- LOG_LEVEL: warn
parallelism: 4
resource_class: large
jobs:
build:
<<: *defaults
@@ -34,20 +38,31 @@ 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 v16
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
- restore_cache:
keys:
- chatwoot-bundle-{{ .Environment.CACHE_VERSION }}-{{ checksum "Gemfile.lock" }}
- chatwoot-bundle
- chatwoot-bundle-{{ .Environment.CACHE_VERSION }}-v20220524-{{ checksum "Gemfile.lock" }}
- run: bundle install --frozen --path ~/.bundle
- save_cache:
paths:
- ~/.bundle
key: chatwoot-bundle-{{ .Environment.CACHE_VERSION }}-{{ checksum "Gemfile.lock" }}
key: chatwoot-bundle-{{ .Environment.CACHE_VERSION }}-v20220524-{{ checksum "Gemfile.lock" }}
# Only necessary if app uses webpacker or yarn in some other way
@@ -87,8 +102,9 @@ 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
@@ -101,6 +117,10 @@ jobs:
- run:
name: Rubocop
command: bundle exec rubocop
# - run:
# name: Brakeman
# command: bundle exec brakeman
- run:
name: eslint
@@ -110,34 +130,78 @@ jobs:
- run:
name: Run backend tests
command: |
bundle exec rspec $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings) --profile=10
~/tmp/cc-test-reporter format-coverage -t simplecov -o ~/tmp/codeclimate.backend.json coverage/backend/.resultset.json
- persist_to_workspace:
root: ~/tmp
paths:
- codeclimate.backend.json
mkdir -p ~/tmp/test-results/rspec
mkdir -p ~/tmp/test-artifacts
mkdir -p coverage
~/tmp/cc-test-reporter before-build
TESTFILES=$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
bundle exec rspec --format progress \
--format RspecJunitFormatter \
--out ~/tmp/test-results/rspec.xml \
-- ${TESTFILES}
no_output_timeout: 30m
- run:
name: Code Climate Test Coverage
command: |
~/tmp/cc-test-reporter format-coverage -t simplecov -o "coverage/codeclimate.$CIRCLE_NODE_INDEX.json"
- run:
name: Run frontend tests
command: |
yarn test:coverage
~/tmp/cc-test-reporter format-coverage -t lcov -o ~/tmp/codeclimate.frontend.json buildreports/lcov.info
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: ~/tmp
root: coverage
paths:
- codeclimate.frontend.json
- codeclimate.*.json
# collect reports
- store_test_results:
path: ~/tmp/test-results
- store_artifacts:
path: ~/tmp/test-results
destination: test-results
path: ~/tmp/test-artifacts
- store_artifacts:
path: log
upload-coverage:
working_directory: ~/build
docker:
# specify the version you desire here
- image: circleci/ruby:3.0.2-node-browsers
environment:
- CC_TEST_REPORTER_ID: caf26a895e937974a90860cfadfded20891cfd1373a5aaafb3f67406ab9d433f
steps:
- attach_workspace:
at: ~/build
- run:
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
chmod +x ~/tmp/cc-test-reporter
- persist_to_workspace:
root: ~/tmp
paths:
- cc-test-reporter
- run:
name: Upload coverage results to Code Climate
command: |
~/tmp/cc-test-reporter sum-coverage ~/tmp/codeclimate.*.json -p 2 -o ~/tmp/codeclimate.total.json
~/tmp/cc-test-reporter upload-coverage -i ~/tmp/codeclimate.total.json
~/tmp/cc-test-reporter sum-coverage --output - codeclimate.*.json | ~/tmp/cc-test-reporter upload-coverage --debug --input -
workflows:
version: 2
commit:
jobs:
- build
- upload-coverage:
requires:
- build
+6
View File
@@ -50,3 +50,9 @@ exclude_patterns:
- 'app/javascript/dashboard/routes/dashboard/settings/automation/constants.js'
- 'app/javascript/dashboard/components/widgets/FilterInput/FilterOperatorTypes.js'
- 'app/javascript/dashboard/routes/dashboard/settings/reports/constants.js'
- 'app/javascript/dashboard/i18n/index.js'
- 'app/javascript/widget/i18n/index.js'
- 'app/javascript/survey/i18n/index.js'
- 'app/javascript/shared/constants/locales.js'
- 'app/javascript/dashboard/helper/specs/macrosFixtures.js'
- 'app/javascript/dashboard/routes/dashboard/settings/macros/constants.js'
+1 -1
View File
@@ -5,4 +5,4 @@ FROM ghcr.io/chatwoot/chatwoot_codespace:latest
# Do the set up required for chatwoot app
WORKDIR /workspace
COPY . /workspace
RUN yarn && gem install bundler && bundle install
RUN yarn && gem install bundler && bundle install
+37 -10
View File
@@ -1,6 +1,6 @@
# pre-build stage
ARG VARIANT=3
FROM mcr.microsoft.com/vscode/devcontainers/ruby:${VARIANT}
ARG VARIANT=ubuntu-20.04
FROM mcr.microsoft.com/vscode/devcontainers/base:${VARIANT}
# Update args in docker-compose.yaml to set the UID/GID of the "vscode" user.
ARG USER_UID=1000
@@ -11,23 +11,36 @@ RUN if [ "$USER_GID" != "1000" ] || [ "$USER_UID" != "1000" ]; then \
&& chmod -R $USER_UID:$USER_GID /home/vscode; \
fi
# [Option] Install Node.js
ARG INSTALL_NODE="true"
ARG NODE_VERSION="lts/*"
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends \
build-essential \
libssl-dev \
zlib1g-dev \
gnupg2 \
tar \
tzdata \
postgresql-client \
libpq-dev \
yarn \
git \
imagemagick \
tmux \
zsh
zsh \
git-flow \
npm
# Install rbenv and ruby
ARG RUBY_VERSION="3.2.2"
RUN git clone https://github.com/rbenv/rbenv.git ~/.rbenv \
&& echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc \
&& echo 'eval "$(rbenv init -)"' >> ~/.bashrc
ENV PATH "/root/.rbenv/bin/:/root/.rbenv/shims/:$PATH"
RUN git clone https://github.com/rbenv/ruby-build.git && \
PREFIX=/usr/local ./ruby-build/install.sh
RUN rbenv install $RUBY_VERSION && \
rbenv global $RUBY_VERSION && \
rbenv versions
# Install overmind
RUN curl -L https://github.com/DarthSim/overmind/releases/download/v2.1.0/overmind-v2.1.0-linux-amd64.gz > overmind.gz \
@@ -35,11 +48,25 @@ RUN curl -L https://github.com/DarthSim/overmind/releases/download/v2.1.0/overmi
&& sudo mv overmind /usr/local/bin \
&& chmod +x /usr/local/bin/overmind
# Install gh
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh
# Do the set up required for chatwoot app
WORKDIR /workspace
COPY . /workspace
RUN yarn
# set up ruby
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 --global yarn
RUN yarn
+6 -5
View File
@@ -23,17 +23,18 @@
// 5432 postgres
// 6379 redis
// 1025,8025 mailhog
"forwardPorts": [8025],
//your application may need to listen on all interfaces (0.0.0.0) not just localhost for it to be available externally. Defaults to []
"appPort": [3000, 3035],
"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"
},
"3035": {
"label": "Webpack Dev Server"
},
"8025": {
"label": "Mailhog UI"
}
},
}
}
+5
View File
@@ -6,3 +6,8 @@ sed -i -e "/FRONTEND_URL/ s/=.*/=https:\/\/$CODESPACE_NAME-3000.githubpreview.de
sed -i -e "/WEBPACKER_DEV_SERVER_PUBLIC/ s/=.*/=https:\/\/$CODESPACE_NAME-3035.githubpreview.dev/" .env
# uncomment the webpacker env variable
sed -i -e '/WEBPACKER_DEV_SERVER_PUBLIC/s/^# //' .env
# fix the error with webpacker
echo 'export NODE_OPTIONS=--openssl-legacy-provider' >> ~/.zshrc
# codespaces make the ports public
gh codespace ports visibility 3000:public 3035:public 8025:public -c $CODESPACE_NAME
-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
+2 -2
View File
@@ -7,8 +7,8 @@ end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = spaces
indent_style = space
tab_width = 2
[{*.{rb,erb,js,coffee,json,yml,css,scss,sh,markdown,md,html}]
[*.{rb,erb,js,coffee,json,yml,css,scss,sh,markdown,md,html}]
indent_size = 2
+57 -18
View File
@@ -3,6 +3,8 @@ SECRET_KEY_BASE=replace_with_lengthy_secure_hex
# Replace with the URL you are planning to use for your app
FRONTEND_URL=http://0.0.0.0:3000
# To use a dedicated URL for help center pages
# HELPCENTER_URL=http://0.0.0.0:3000
# If the variable is set, all non-authenticated pages would fallback to the default locale.
# Whenever a new account is created, the default language will be DEFAULT_LOCALE instead of en
@@ -32,23 +34,38 @@ REDIS_SENTINELS=
# You can find list of master using "SENTINEL masters" command
REDIS_SENTINEL_MASTER_NAME=
# By default Chatwoot will pass REDIS_PASSWORD as the password value for sentinels
# Use the following environment variable to customize passwords for sentinels.
# Use empty string if sentinels are configured with out passwords
# REDIS_SENTINEL_PASSWORD=
# Redis premium breakage in heroku fix
# enable the following configuration
# ref: https://github.com/chatwoot/chatwoot/issues/2420
# REDIS_OPENSSL_VERIFY_MODE=none
# Postgres Database config variables
# You can leave POSTGRES_DATABASE blank. The default name of
# the database in the production environment is chatwoot_production
# POSTGRES_DATABASE=
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
# could user either `email@yourdomain.com` or `BrandName <email@yourdomain.com>`
MAILER_SENDER_EMAIL="Chatwoot <accounts@chatwoot.com>"
MAILER_SENDER_EMAIL=Chatwoot <accounts@chatwoot.com>
#SMTP domain key is set up for HELO checking
SMTP_DOMAIN=chatwoot.com
# the default value is set "mailhog" and is used by docker-compose for development environments,
# Set the value to "mailhog" if using docker-compose for development environments,
# Set the value as "localhost" or your SMTP address in other environments
SMTP_ADDRESS=mailhog
# If SMTP_ADDRESS is empty, Chatwoot would try to use sendmail(postfix)
SMTP_ADDRESS=
SMTP_PORT=1025
SMTP_USERNAME=
SMTP_PASSWORD=
@@ -88,12 +105,13 @@ AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION=
# Log settings
# Disable if you want to write logs to a file
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
@@ -117,6 +135,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
@@ -125,7 +148,6 @@ ANDROID_BUNDLE_ID=com.chatwoot.app
# https://developers.google.com/android/guides/client-auth (use keytool to print the fingerprint in the first section)
ANDROID_SHA256_CERT_FINGERPRINT=AC:73:8E:DE:EB:56:EA:CC:10:87:02:A7:65:37:7B:38:D4:5D:D4:53:F8:3B:FB:D3:C6:28:64:1D:AA:08:1E:D8
### Smart App Banner
# https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html
# You can find your app-id in https://itunesconnect.apple.com
@@ -139,14 +161,18 @@ 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
# ELASTIC_APM_SERVER_URL=
# ELASTIC_APM_SECRET_TOKEN=
## Sentry
# SENTRY_DSN=
## LogRocket
# LOG_ROCKET_PROJECT_ID=xxxxx/some-project
## Scout
## https://scoutapm.com/docs/ruby/configuration
# SCOUT_KEY=YOURKEY
@@ -156,25 +182,21 @@ USE_INBOX_AVATAR_FOR_BOT=true
## NewRelic
# https://docs.newrelic.com/docs/agents/ruby-agent/configuration/ruby-agent-configuration/
# NEW_RELIC_LICENSE_KEY=
# Set this to true to allow newrelic apm to send logs.
# This is turned off by default.
# NEW_RELIC_APPLICATION_LOGGING_ENABLED=
## Datadog
## 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
## Running chatwoot as an API only server
## setting this value to true will disable the frontend dashboard endpoints
# CW_API_ONLY_SERVER=false
@@ -188,3 +210,20 @@ USE_INBOX_AVATAR_FOR_BOT=true
# If you want to use official mobile app,
# the notifications would be relayed via a Chatwoot server
ENABLE_PUSH_RELAY_SERVER=true
# Stripe API key
STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET=
# Set to true if you want to upload files to cloud storage using the signed url
# Make sure to follow https://edgeguides.rubyonrails.org/active_storage_overview.html#cross-origin-resource-sharing-cors-configuration on the cloud storage after setting this to true.
DIRECT_UPLOADS_ENABLED=
#MS OAUTH creds
AZURE_APP_ID=
AZURE_APP_SECRET=
## Advanced configurations
## Change these values to fine tune performance
# control the concurrency setting of sidekiq
# SIDEKIQ_CONCURRENCY=10
+31 -14
View File
@@ -1,5 +1,10 @@
module.exports = {
extends: ['airbnb-base/legacy', 'prettier', 'plugin:vue/recommended'],
extends: [
'airbnb-base/legacy',
'prettier',
'plugin:vue/recommended',
'plugin:storybook/recommended',
],
parserOptions: {
parser: 'babel-eslint',
ecmaVersion: 2020,
@@ -19,18 +24,32 @@ module.exports = {
'jsx-a11y/label-has-for': 'off',
'jsx-a11y/anchor-is-valid': 'off',
'import/no-unresolved': 'off',
'vue/max-attributes-per-line': ['error', {
'singleline': 20,
'multiline': {
'max': 1,
'allowFirstLine': false
'vue/max-attributes-per-line': [
'error',
{
singleline: 20,
multiline: {
max: 1,
allowFirstLine: false,
},
},
}],
'vue/html-self-closing': 'off',
"vue/no-v-html": 'off',
],
'vue/html-self-closing': [
'error',
{
html: {
void: 'always',
normal: 'always',
component: 'always',
},
svg: 'always',
math: 'always',
},
],
'vue/no-v-html': 'off',
'vue/singleline-html-element-content-newline': 'off',
'import/extensions': ['off']
'import/extensions': ['off'],
'no-console': 'error',
},
settings: {
'import/resolver': {
@@ -41,12 +60,10 @@ module.exports = {
},
env: {
browser: true,
node: true,
jest: true,
jasmine: true
node: true,
},
globals: {
__WEBPACK_ENV__: true,
bus: true,
},
};
-54
View File
@@ -1,54 +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 error
**Expected behavior**
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)
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**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
+4 -5
View File
@@ -2,8 +2,7 @@
## Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Please include a summary of the change and issue(s) fixed. Also, mention relevant motivation, context, and any dependencies that this change requires.
Fixes # (issue)
## Type of change
@@ -12,18 +11,18 @@ Please delete options that are not relevant.
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Breaking change (fix or feature that would cause existing functionality not to work as expected)
- [ ] This change requires a documentation update
## How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.
## Checklist:
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have performed a self-review of my code
- [ ] I have commented on my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
+37
View File
@@ -0,0 +1,37 @@
# We often have cases where users would comment over stale closed Github Issues.
# This creates unnecessary noise for the original reporter and makes it harder for triaging.
# This action locks the closed threads once it is inactive for over a month.
name: 'Lock Threads'
on:
schedule:
- cron: '0 * * * *'
workflow_dispatch:
permissions:
issues: write
pull-requests: write
concurrency:
group: lock
jobs:
action:
runs-on: ubuntu-latest
if: ${{ github.repository == 'chatwoot/chatwoot' }}
steps:
- uses: dessant/lock-threads@v3
with:
issue-inactive-days: '30'
issue-lock-reason: 'resolved'
issue-comment: >
This issue has been automatically locked since there
has not been any recent activity after it was closed.
Please open a new issue for related bugs.
pr-inactive-days: '30'
pr-lock-reason: 'resolved'
pr-comment: >
This pull request has been automatically locked since there
has not been any recent activity after it was closed.
Please open a new issue for related bugs.
+52
View File
@@ -0,0 +1,52 @@
# #
# #
# # Linux nightly installer action
# # This action will try to install and setup
# # chatwoot on an Ubuntu 20.04 machine using
# # the linux installer script.
# #
# # This is set to run daily at midnight.
# #
name: Run Linux nightly installer
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
nightly:
runs-on: ubuntu-20.04
steps:
- name: get installer
run: |
wget https://get.chatwoot.app/linux/install.sh
chmod +x install.sh
#fix for postgtres not starting automatically in gh action env
sed -i '/function configure_db() {/a sudo service postgresql start' install.sh
- name: create input file
run: |
echo "no" > input
echo "yes" >> input
- name: Run the installer
run: |
sudo ./install.sh --install < input
# disabling http verify for now as http
# access to port 3000 fails in gh action env
# - name: Verify
# if: always()
# run: |
# sudo netstat -ntlp | grep 3000
# 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
+63
View File
@@ -0,0 +1,63 @@
# #
# # This action will publish Chatwoot CE docker image.
# # This is set to run against merges to develop, master
# # and when tags are created.
# #
name: Publish Chatwoot CE docker images
on:
push:
branches:
- develop
- master
tags:
- v*
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
GIT_REF: ${{ github.head_ref || github.ref_name }} # ref_name to get tags/branches
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Strip enterprise code
run: |
rm -rf enterprise
rm -rf spec/enterprise
- name: Set Chatwoot edition
run: |
echo -en '\nENV CW_EDITION="ce"' >> docker/Dockerfile
- name: set docker tag
run: |
echo "DOCKER_TAG=chatwoot/chatwoot:$GIT_REF-ce" >> $GITHUB_ENV
- name: replace docker tag if master
if: github.ref_name == 'master'
run: |
echo "DOCKER_TAG=chatwoot/chatwoot:latest-ce" >> $GITHUB_ENV
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: docker/Dockerfile
platforms: linux/amd64
push: true
tags: ${{ env.DOCKER_TAG }}
+83
View File
@@ -0,0 +1,83 @@
# #
# # This action will strip the enterprise folder
# # and run the spec.
# # This is set to run against every PR.
# #
name: Run Chatwoot CE spec
on:
push:
branches:
- develop
- master
pull_request:
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-20.04
services:
postgres:
image: postgres:10.8
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ""
POSTGRES_DB: postgres
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: 16
- name: yarn
run: yarn install
- name: Strip enterprise code
run: |
rm -rf enterprise
rm -rf spec/enterprise
- name: Create database
run: bundle exec rake db:create
- name: Seed database
run: bundle exec rake db:schema:load
- name: yarn check-files
run: yarn install --check-files
# Run rails tests
- name: Run backend tests
run: |
bundle exec rspec --profile=10 --format documentation
- name: Upload rails log folder
uses: actions/upload-artifact@v3
if: always()
with:
name: rails-log-folder
path: log
+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 -4
View File
@@ -39,9 +39,6 @@ public/packs*
*.un~
.jest-cache
#VS Code files
.vscode
# ignore jetbrains IDE files
.idea
@@ -62,4 +59,18 @@ package-lock.json
test/cypress/videos/*
/config/master.key
/config/*.enc
/config/*.enc
#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
+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
+44 -1
View File
@@ -16,6 +16,7 @@ Metrics/ClassLength:
- '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'
RSpec/ExampleLength:
Max: 25
Style/Documentation:
@@ -70,6 +71,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,6 +89,10 @@ Style/ClassAndModuleChildren:
- 'config/application.rb'
Style/MapToHash:
Enabled: false
Style/HashSyntax:
Enabled: true
EnforcedStyle: no_mixed_keys
EnforcedShorthandSyntax: never
RSpec/NestedGroups:
Enabled: true
Max: 4
@@ -155,9 +164,42 @@ Performance/CollectionLiteralInLoop:
- 'db/migrate/20210315101919_enable_email_channel.rb'
RSpec/NamedSubject:
Enabled: false
Style/RedundantConstantBase:
Enabled: false
Rails/RootPathnameMethods:
Enabled: false
RSpec/Rails/MinitestAssertions:
Enabled: false
RSpec/Rails/InferredSpecType:
Enabled: false
RSpec/IndexedLet:
Enabled: false
RSpec/MatchArray:
Enabled: false
Rails/ResponseParsedBody:
Enabled: false
RSpec/FactoryBot/ConsistentParenthesesStyle:
Enabled: false
Rails/ThreeStateBooleanColumn:
Enabled: false
Rails/Pluck:
Enabled: false
Rails/TopLevelHashWithIndifferentAccess:
Enabled: false
Rails/ActionOrder:
Enabled: false
Style/ArrayIntersect:
Enabled: false
RSpec/NoExpectationExample:
Enabled: false
Style/RedundantReturn:
Enabled: false
Rails/I18nLocaleTexts:
Enabled: false
# we should bring this down
RSpec/MultipleMemoizedHelpers:
Max: 12
Max: 14
AllCops:
NewCops: enable
@@ -181,3 +223,4 @@ AllCops:
- db/migrate/20200503151130_add_account_feature_flag.rb
- 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.2
3.2.2
+1
View File
@@ -0,0 +1 @@
/spec
+2
View File
@@ -4,6 +4,7 @@ import Vuex from 'vuex';
import VueI18n from 'vue-i18n';
import Vuelidate from 'vuelidate';
import Multiselect from 'vue-multiselect';
import FluentIcon from 'shared/components/FluentIcon/DashboardIcon';
import WootUiKit from '../app/javascript/dashboard/components';
import i18n from '../app/javascript/dashboard/i18n';
@@ -15,6 +16,7 @@ Vue.use(Vuelidate);
Vue.use(WootUiKit);
Vue.use(Vuex);
Vue.component('multiselect', Multiselect);
Vue.component('fluent-icon', FluentIcon);
const store = new Vuex.Store({});
const i18nConfig = new VueI18n({
+32
View File
@@ -0,0 +1,32 @@
{
"recommendations": [
// Spell check
"streetsidesoftware.code-spell-checker",
// Better Comments
"aaron-bond.better-comments",
// Rails Test Runner
"davidpallinder.rails-test-runner",
// Eslint
"dbaeumer.vscode-eslint",
// Auto Close Tag
"formulahendry.auto-close-tag",
// Auto Rename Tag
"formulahendry.auto-rename-tag",
// Hight light colors
"naumovs.color-highlight",
// GitLens
"eamodio.gitlens",
// Ruby
"rebornix.ruby",
// Vue
"octref.vetur",
// Prettier
"esbenp.prettier-vscode",
// Dot Env
"mikestead.dotenv",
// HTML CSS Support
"ecmel.vscode-html-css",
// Tailwind CSS Intellisense
"bradlc.vscode-tailwindcss",
]
}
+6
View File
@@ -0,0 +1,6 @@
{
"cSpell.words": [
"chatwoot",
"dompurify"
]
}
+80 -33
View File
@@ -1,10 +1,10 @@
source 'https://rubygems.org'
ruby '3.0.2'
ruby '3.2.2'
##-- base gems for rails --##
gem 'rack-cors', require: 'rack/cors'
gem 'rails'
gem 'rails', '~> 7'
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', require: false
@@ -36,11 +36,17 @@ gem 'json_schemer'
# Rack middleware for blocking & throttling abusive requests
gem 'rack-attack'
# 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'
@@ -56,13 +62,13 @@ gem 'activerecord-import'
gem 'dotenv-rails'
gem 'foreman'
gem 'puma'
gem 'webpacker', '~> 5.x'
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-secure_password', git: 'https://github.com/chatwoot/devise-secure_password', branch: 'chatwoot'
gem 'devise_token_auth'
# authorization
gem 'jwt'
@@ -75,40 +81,44 @@ gem 'administrate'
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.32.0'
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.0.0'
# for dialogflow integrations
gem 'google-cloud-dialogflow'
##--- gems for debugging and error reporting ---##
# static analysis
gem 'brakeman'
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 'newrelic_rpm'
gem 'scout_apm'
gem 'sentry-rails'
gem 'sentry-ruby'
gem 'sentry-sidekiq'
# 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', require: false
gem 'scout_apm', require: false
gem 'sentry-rails', require: false
gem 'sentry-ruby', require: false
gem 'sentry-sidekiq', require: false
##-- background job processing --##
gem 'sidekiq', '~> 6.4.0'
gem 'sidekiq'
# We want cron jobs
gem 'sidekiq-cron'
##-- Push notification service --##
gem 'fcm'
gem 'webpush'
gem 'web-push'
##-- geocoding / parse location from ip --##
# http://www.rubygeocoder.com/
@@ -123,9 +133,41 @@ gem 'procore-sift'
# parse email
gem 'email_reply_trimmer'
gem 'html2text'
group :production, :staging do
# 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'
# full text search for articles
gem 'pg_search'
# Subscriptions, Billing
gem 'stripe'
## - helper gems --##
## to populate db with sample data
gem 'faker'
# Include logrange conditionally in intializer using env variable
gem 'lograge', '~> 0.12.0', require: false
# worked with microsoft refresh token
gem 'omniauth-oauth2'
gem 'audited', '~> 5.3'
# need for google auth
gem 'omniauth'
gem 'omniauth-google-oauth2'
gem 'omniauth-rails_csrf_protection', '~> 1.0'
### 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
@@ -134,6 +176,7 @@ group :development do
gem 'annotate'
gem 'bullet'
gem 'letter_opener'
gem 'scss_lint', require: false
gem 'web-console'
# used in swagger build
@@ -141,33 +184,37 @@ group :development do
# When we want to squash migrations
gem 'squasher'
# profiling
gem 'rack-mini-profiler', require: false
gem 'stackprof'
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
gem 'webmock'
# test profiling
gem 'test-prof'
end
group :development, :test do
# TODO: is this needed ?
# errors thrown by devise password gem
gem 'flay'
gem 'rspec'
# for error thrown by devise password gem
gem 'active_record_query_trace'
##--- gems for debugging and error reporting ---##
# static analysis
gem 'brakeman'
gem 'bundle-audit', require: false
gem 'byebug', platform: :mri
gem 'climate_control'
gem 'factory_bot_rails'
gem 'faker'
gem 'listen'
gem 'mock_redis'
gem 'pry-rails'
gem 'rspec-rails', '~> 5.0.0'
gem 'rspec_junit_formatter'
gem 'rspec-rails'
gem 'rubocop', require: false
gem 'rubocop-performance', require: false
gem 'rubocop-rails', require: false
+504 -340
View File
File diff suppressed because it is too large Load Diff
+38
View File
@@ -0,0 +1,38 @@
# 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:
overmind start -f Procfile.dev
docker:
docker build -t $(APP_NAME) -f ./docker/Dockerfile .
.PHONY: setup db_create db_migrate db_seed db console server burn docker run
+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
+2 -1
View File
@@ -1,3 +1,4 @@
backend: bin/rails s -p 3000
frontend: bin/webpack-dev-server
worker: bundle exec sidekiq -C config/sidekiq.yml
# https://github.com/mperham/sidekiq/issues/3090#issuecomment-389748695
worker: dotenv bundle exec sidekiq -C config/sidekiq.yml
+1 -1
View File
@@ -1,3 +1,3 @@
backend: RAILS_ENV=test bin/rails s -p 5050
frontend: bin/webpack-dev-server
worker: RAILS_ENV=test bundle exec sidekiq -C config/sidekiq.yml
worker: dotenv RAILS_ENV=test bundle exec sidekiq -C config/sidekiq.yml
+3 -2
View File
@@ -16,7 +16,7 @@
___
<p align="center">
<a href="https://codeclimate.com/github/chatwoot/chatwoot/maintainability"><img src="https://api.codeclimate.com/v1/badges/80f9e1a7c72d186289ad/maintainability" alt="Maintainability"></a>
<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>
<a href="https://hub.docker.com/r/chatwoot/chatwoot/"><img src="https://img.shields.io/docker/cloud/build/chatwoot/chatwoot" alt="Docker Build Badge"></a>
@@ -26,6 +26,7 @@ ___
<a href="https://huntr.dev/bounties/disclose"><img src="https://cdn.huntr.dev/huntr_security_badge_mono.svg" alt="Huntr"></a>
<a href="https://status.chatwoot.com"><img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fchatwoot%2Fstatus%2Fmaster%2Fapi%2Fchatwoot%2Fuptime.json" alt="uptime"></a>
<a href="https://status.chatwoot.com"><img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fchatwoot%2Fstatus%2Fmaster%2Fapi%2Fchatwoot%2Fresponse-time.json" alt="response time"></a>
<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"/>
@@ -118,4 +119,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-2022, Chatwoot Inc - Released under the MIT License.
*Chatwoot* &copy; 2017-2023, Chatwoot Inc - Released under the MIT License.
+37 -12
View File
@@ -1,30 +1,55 @@
# Security Policy
Chatwoot is looking forward to working with security researchers across the world to keep Chatwoot and our users safe. If you have found an issue in our systems/applications, please reach out to us.
Chatwoot is looking forward to working with security researchers worldwide to keep Chatwoot and our users safe. If you have found an issue in our systems/applications, please reach out to us.
## Reporting a Vulnerability
We use [huntr.dev](https://huntr.dev/) for security issues that affect our project. If you believe you have found a vulnerability, please disclose it via this [form](https://huntr.dev/bounties/disclose).
We use [huntr.dev](https://huntr.dev/) for security issues that affect our project. If you believe you have found a vulnerability, please disclose it via this [form](https://huntr.dev/bounties/disclose). This will enable us to review the vulnerability, fix it promptly, and reward you for your efforts.
This will enable us to review the vulnerability, fix it promptly, and reward you for your efforts.
If you have any questions about the process, contact security@chatwoot.com.
If you have any questions about the process, feel free to reach out to security@chatwoot.com.
Please try your best to describe a clear and realistic impact for your report, and please don't open any public issues on GitHub or social media; we're doing our best to respond through Huntr as quickly as possible.
> Note: Please use the email for questions related to the process. Disclosures should be done via [huntr.dev](https://huntr.dev/)
## Supported versions
| Version | Supported |
| ------- | -------------- |
| latest | ️✅ |
| <latest | ❌ |
## Out of scope
## Vulnerabilities we care about 🫣
> Note: Please do not perform testing against Chatwoot production services. Use a `self-hosted instance` to perform tests.
- Remote command execution
- SQL Injection
- Authentication bypass
- Privilege Escalation
- Cross-site scripting (XSS)
- Performing limited admin actions without authorization
- CSRF
Please do not perform testing against Chatwoot production services. Use a self hosted instance to perform tests.
You can learn more about our triaging process [here](https://www.chatwoot.com/docs/contributing-guide/security-reports).
We consider the following to be out of scope, though there may be exceptions.
## Non-Qualifying Vulnerabilities
We consider the following out of scope, though there may be exceptions.
- Missing HTTP security headers
- Self XSS
- HTTP Host Header XSS without working proof-of-concept
- Incomplete/Missing SPF/DKIM
- Reports from automated tools or scanners
- Theoretical attacks without proof of exploitability
- Social engineering
- Reflected file download
- Physical attacks
- Weak SSL/TLS/SSH algorithms or protocols
- Attacks involving physical access to a user's device or a device or network that's already seriously compromised (e.g., man-in-the-middle).
- The user attacks themselves
- Incomplete/Missing SPF/DKIM
- Denial of Service attacks
- Brute force attacks
- DNSSEC
- Social Engineering attacks
If you are not sure about the scope, please create a report.
If you are unsure about the scope, please create a [report](https://huntr.dev/repos/chatwoot/chatwoot/).
## Thanks
+1
View File
@@ -0,0 +1 @@
2.2.0
+1
View File
@@ -0,0 +1 @@
2.1.0
+16 -3
View File
@@ -32,20 +32,33 @@
"INSTALLATION_ENV": {
"description": "Installation method used for Chatwoot.",
"value": "heroku"
},
"REDIS_OPENSSL_VERIFY_MODE":{
"description": "OpenSSL verification mode for Redis connections. ref https://help.heroku.com/HC0F8CUS/redis-connection-issues",
"value": "none"
}
},
"formation": {
"web": {
"quantity": 1,
"size": "FREE"
"size": "basic"
},
"worker": {
"quantity": 1,
"size": "FREE"
"size": "basic"
}
},
"stack": "heroku-20",
"image": "heroku/ruby",
"addons": [ "heroku-redis", "heroku-postgresql"],
"addons": [
{
"plan": "heroku-redis:mini"
},
{
"plan": "heroku-postgresql:mini"
}
],
"stack": "heroku-20",
"buildpacks": [
{
"url": "heroku/ruby"
+74 -14
View File
@@ -1,7 +1,16 @@
# retain_original_contact_name: false / true
# In case of setUser we want to update the name of the identified contact,
# which is the default behaviour
#
# But, In case of contact merge during prechat form contact update.
# We don't want to update the name of the identified original contact.
class ContactIdentifyAction
pattr_initialize [:contact!, :params!]
pattr_initialize [:contact!, :params!, { retain_original_contact_name: false, discard_invalid_attrs: false }]
def perform
@attributes_to_update = [:identifier, :name, :email, :phone_number]
ActiveRecord::Base.transaction do
merge_if_existing_identified_contact
merge_if_existing_email_contact
@@ -18,54 +27,105 @@ class ContactIdentifyAction
end
def merge_if_existing_identified_contact
@contact = merge_contact(existing_identified_contact, @contact) if merge_contacts?(existing_identified_contact, @contact)
return unless merge_contacts?(existing_identified_contact, :identifier)
process_contact_merge(existing_identified_contact)
end
def merge_if_existing_email_contact
@contact = merge_contact(existing_email_contact, @contact) if merge_contacts?(existing_email_contact, @contact)
return unless merge_contacts?(existing_email_contact, :email)
process_contact_merge(existing_email_contact)
end
def merge_if_existing_phone_number_contact
@contact = merge_contact(existing_phone_number_contact, @contact) if merge_contacts?(existing_phone_number_contact, @contact)
return unless merge_contacts?(existing_phone_number_contact, :phone_number)
return unless mergable_phone_contact?
process_contact_merge(existing_phone_number_contact)
end
def process_contact_merge(mergee_contact)
@contact = merge_contact(mergee_contact, @contact)
@attributes_to_update.delete(:name) if retain_original_contact_name
end
def existing_identified_contact
return if params[:identifier].blank?
@existing_identified_contact ||= Contact.where(account_id: account.id).find_by(identifier: params[:identifier])
@existing_identified_contact ||= account.contacts.find_by(identifier: params[:identifier])
end
def existing_email_contact
return if params[:email].blank?
@existing_email_contact ||= Contact.where(account_id: account.id).find_by(email: params[:email])
@existing_email_contact ||= account.contacts.find_by(email: params[:email])
end
def existing_phone_number_contact
return if params[:phone_number].blank?
@existing_phone_number_contact ||= Contact.where(account_id: account.id).find_by(phone_number: params[:phone_number])
@existing_phone_number_contact ||= account.contacts.find_by(phone_number: params[:phone_number])
end
def merge_contacts?(existing_contact, _contact)
existing_contact && existing_contact.id != @contact.id
def merge_contacts?(existing_contact, key)
return if existing_contact.blank?
return true if params[:identifier].blank?
# we want to prevent merging contacts with different identifiers
if existing_contact.identifier.present? && existing_contact.identifier != params[:identifier]
# we will remove attribute from update list
@attributes_to_update.delete(key)
return false
end
true
end
# case: contact 1: email: 1@test.com, phone: 123456789
# params: email: 2@test.com, phone: 123456789
# we don't want to overwrite 1@test.com since email parameter takes higer priority
def mergable_phone_contact?
return true if params[:email].blank?
if existing_phone_number_contact.email.present? && existing_phone_number_contact.email != params[:email]
@attributes_to_update.delete(:phone_number)
return false
end
true
end
def update_contact
custom_attributes = params[:custom_attributes] ? @contact.custom_attributes.merge(params[:custom_attributes]) : @contact.custom_attributes
@contact.attributes = params.slice(*@attributes_to_update).reject do |_k, v|
v.blank?
end.merge({ custom_attributes: custom_attributes, additional_attributes: additional_attributes })
# blank identifier or email will throw unique index error
# TODO: replace reject { |_k, v| v.blank? } with compact_blank when rails is upgraded
@contact.update!(params.slice(:name, :email, :identifier, :phone_number).reject do |_k, v|
v.blank?
end.merge({ custom_attributes: custom_attributes }))
ContactAvatarJob.perform_later(@contact, params[:avatar_url]) if params[:avatar_url].present?
@contact.discard_invalid_attrs if discard_invalid_attrs
@contact.save!
Avatar::AvatarFromUrlJob.perform_later(@contact, params[:avatar_url]) if params[:avatar_url].present?
end
def merge_contact(base_contact, merge_contact)
return base_contact if base_contact.id == merge_contact.id
ContactMergeAction.new(
account: account,
base_contact: base_contact,
mergee_contact: merge_contact
).perform
end
def custom_attributes
return @contact.custom_attributes if params[:custom_attributes].blank?
(@contact.custom_attributes || {}).deep_merge(params[:custom_attributes].stringify_keys)
end
def additional_attributes
return @contact.additional_attributes if params[:additional_attributes].blank?
(@contact.additional_attributes || {}).deep_merge(params[:additional_attributes].stringify_keys)
end
end
+1
View File
@@ -2,3 +2,4 @@
//= link administrate/application.css
//= link administrate/application.js
//= link dashboardChart.js
//= link secretField.js
+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';
@@ -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;
}
}
}
+1 -1
View File
@@ -2,7 +2,7 @@
class AccountBuilder
include CustomExceptions::Account
pattr_initialize [:account_name!, :email!, :confirmed, :user, :user_full_name, :user_password, :super_admin]
pattr_initialize [:account_name!, :email!, :confirmed, :user, :user_full_name, :user_password, :super_admin, :locale]
def perform
if @user.nil?
@@ -1,5 +1,5 @@
class Campaigns::CampaignConversationBuilder
pattr_initialize [:contact_inbox_id!, :campaign_display_id!, :conversation_additional_attributes]
pattr_initialize [:contact_inbox_id!, :campaign_display_id!, :conversation_additional_attributes, :custom_attributes]
def perform
@contact_inbox = ContactInbox.find(@contact_inbox_id)
@@ -9,19 +9,23 @@ class Campaigns::CampaignConversationBuilder
@contact_inbox.lock!
# We won't send campaigns if a conversation is already present
return if @contact_inbox.reload.conversations.present?
raise 'Conversation alread present' if @contact_inbox.reload.conversations.present?
@conversation = ::Conversation.create!(conversation_params)
Messages::MessageBuilder.new(@campaign.sender, @conversation, message_params).perform
end
@conversation
rescue StandardError => e
Rails.logger.info(e.message)
nil
end
private
def message_params
ActionController::Parameters.new({
content: @campaign.message
content: @campaign.message,
campaign_id: @campaign.id
})
end
@@ -32,7 +36,8 @@ class Campaigns::CampaignConversationBuilder
contact_id: @contact_inbox.contact_id,
contact_inbox_id: @contact_inbox.id,
campaign_id: @campaign.id,
additional_attributes: conversation_additional_attributes
additional_attributes: conversation_additional_attributes,
custom_attributes: custom_attributes || {}
}
end
end
-77
View File
@@ -1,77 +0,0 @@
class ContactBuilder
pattr_initialize [:source_id!, :inbox!, :contact_attributes!, :hmac_verified]
def perform
contact_inbox = inbox.contact_inboxes.find_by(source_id: source_id)
return contact_inbox if contact_inbox
build_contact_inbox
end
private
def account
@account ||= inbox.account
end
def create_contact_inbox(contact)
::ContactInbox.create!(
contact_id: contact.id,
inbox_id: inbox.id,
source_id: source_id,
hmac_verified: hmac_verified || false
)
end
def update_contact_avatar(contact)
::ContactAvatarJob.perform_later(contact, contact_attributes[:avatar_url]) if contact_attributes[:avatar_url]
end
def create_contact
account.contacts.create!(
name: contact_attributes[:name] || ::Haikunator.haikunate(1000),
phone_number: contact_attributes[:phone_number],
email: contact_attributes[:email],
identifier: contact_attributes[:identifier],
additional_attributes: contact_attributes[:additional_attributes],
custom_attributes: contact_attributes[:custom_attributes]
)
end
def find_contact
contact = find_contact_by_identifier(contact_attributes[:identifier])
contact ||= find_contact_by_email(contact_attributes[:email])
contact ||= find_contact_by_phone_number(contact_attributes[:phone_number])
contact
end
def find_contact_by_identifier(identifier)
return if identifier.blank?
account.contacts.find_by(identifier: identifier)
end
def find_contact_by_email(email)
return if email.blank?
account.contacts.find_by(email: email.downcase)
end
def find_contact_by_phone_number(phone_number)
return if phone_number.blank?
account.contacts.find_by(phone_number: phone_number)
end
def build_contact_inbox
ActiveRecord::Base.transaction do
contact = find_contact || create_contact
contact_inbox = create_contact_inbox(contact)
update_contact_avatar(contact)
contact_inbox
rescue StandardError => e
Rails.logger.info e
raise e
end
end
end
+29 -16
View File
@@ -1,13 +1,12 @@
# This Builder will create a contact inbox with specified attributes. If the contact inbox already exists, it will be returned.
# For Specific Channels like whatsapp, email etc . it smartly generated appropriate the source id when none is provided.
class ContactInboxBuilder
pattr_initialize [:contact_id!, :inbox_id!, :source_id]
pattr_initialize [:contact, :inbox, :source_id, { hmac_verified: false }]
def perform
@contact = Contact.find(contact_id)
@inbox = @contact.account.inboxes.find(inbox_id)
return unless ['Channel::TwilioSms', 'Channel::Sms', 'Channel::Email', 'Channel::Api', 'Channel::Whatsapp'].include? @inbox.channel_type
source_id = @source_id || generate_source_id
create_contact_inbox(source_id) if source_id.present?
@source_id ||= generate_source_id
create_contact_inbox if source_id.present?
end
private
@@ -19,23 +18,37 @@ class ContactInboxBuilder
when 'Channel::Whatsapp'
wa_source_id
when 'Channel::Email'
@contact.email
email_source_id
when 'Channel::Sms'
@contact.phone_number
when 'Channel::Api'
phone_source_id
when 'Channel::Api', 'Channel::WebWidget'
SecureRandom.uuid
else
raise "Unsupported operation for this channel: #{@inbox.channel_type}"
end
end
def email_source_id
raise ActionController::ParameterMissing, 'contact email' unless @contact.email
@contact.email
end
def phone_source_id
raise ActionController::ParameterMissing, 'contact phone number' unless @contact.phone_number
@contact.phone_number
end
def wa_source_id
return unless @contact.phone_number
raise ActionController::ParameterMissing, 'contact phone number' unless @contact.phone_number
# whatsapp doesn't want the + in e164 format
"#{@contact.phone_number}.delete('+')"
@contact.phone_number.delete('+').to_s
end
def twilio_source_id
return unless @contact.phone_number
raise ActionController::ParameterMissing, 'contact phone number' unless @contact.phone_number
case @inbox.channel.medium
when 'sms'
@@ -45,11 +58,11 @@ class ContactInboxBuilder
end
end
def create_contact_inbox(source_id)
::ContactInbox.find_or_create_by!(
def create_contact_inbox
::ContactInbox.create_with(hmac_verified: hmac_verified || false).find_or_create_by!(
contact_id: @contact.id,
inbox_id: @inbox.id,
source_id: source_id
source_id: @source_id
)
end
end
@@ -0,0 +1,86 @@
# This Builder will create a contact and contact inbox with specified attributes.
# If an existing identified contact exisits, it will be returned.
# for contact inbox logic it uses the contact inbox builder
class ContactInboxWithContactBuilder
pattr_initialize [:inbox!, :contact_attributes!, :source_id, :hmac_verified]
def perform
find_or_create_contact_and_contact_inbox
# in case of race conditions where contact is created by another thread
# we will try to find the contact and create a contact inbox
rescue ActiveRecord::RecordNotUnique
find_or_create_contact_and_contact_inbox
end
def find_or_create_contact_and_contact_inbox
@contact_inbox = inbox.contact_inboxes.find_by(source_id: source_id) if source_id.present?
return @contact_inbox if @contact_inbox
ActiveRecord::Base.transaction(requires_new: true) do
build_contact_with_contact_inbox
update_contact_avatar(@contact) unless @contact.avatar.attached?
@contact_inbox
end
end
private
def build_contact_with_contact_inbox
@contact = find_contact || create_contact
@contact_inbox = create_contact_inbox
end
def account
@account ||= inbox.account
end
def create_contact_inbox
ContactInboxBuilder.new(
contact: @contact,
inbox: @inbox,
source_id: @source_id,
hmac_verified: hmac_verified
).perform
end
def update_contact_avatar(contact)
::Avatar::AvatarFromUrlJob.perform_later(contact, contact_attributes[:avatar_url]) if contact_attributes[:avatar_url]
end
def create_contact
account.contacts.create!(
name: contact_attributes[:name] || ::Haikunator.haikunate(1000),
phone_number: contact_attributes[:phone_number],
email: contact_attributes[:email],
identifier: contact_attributes[:identifier],
additional_attributes: contact_attributes[:additional_attributes],
custom_attributes: contact_attributes[:custom_attributes]
)
end
def find_contact
contact = find_contact_by_identifier(contact_attributes[:identifier])
contact ||= find_contact_by_email(contact_attributes[:email])
contact ||= find_contact_by_phone_number(contact_attributes[:phone_number])
contact
end
def find_contact_by_identifier(identifier)
return if identifier.blank?
account.contacts.find_by(identifier: identifier)
end
def find_contact_by_email(email)
return if email.blank?
account.contacts.find_by(email: email.downcase)
end
def find_contact_by_phone_number(phone_number)
return if phone_number.blank?
account.contacts.find_by(phone_number: phone_number)
end
end
+40
View File
@@ -0,0 +1,40 @@
class ConversationBuilder
pattr_initialize [:params!, :contact_inbox!]
def perform
look_up_exising_conversation || create_new_conversation
end
private
def look_up_exising_conversation
return unless @contact_inbox.inbox.lock_to_single_conversation?
@contact_inbox.conversations.last
end
def create_new_conversation
::Conversation.create!(conversation_params)
end
def conversation_params
additional_attributes = params[:additional_attributes]&.permit! || {}
custom_attributes = params[:custom_attributes]&.permit! || {}
status = params[:status].present? ? { status: params[: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 = { status: 'pending' } if status[:status] == 'bot'
{
account_id: @contact_inbox.inbox.account_id,
inbox_id: @contact_inbox.inbox_id,
contact_id: @contact_inbox.contact_id,
contact_inbox_id: @contact_inbox.id,
additional_attributes: additional_attributes,
custom_attributes: custom_attributes,
snoozed_until: params[:snoozed_until],
assignee_id: params[:assignee_id],
team_id: params[:team_id]
}.merge(status)
end
end
@@ -22,28 +22,24 @@ class Messages::Facebook::MessageBuilder < Messages::Messenger::MessageBuilder
return if @inbox.channel.reauthorization_required?
ActiveRecord::Base.transaction do
build_contact
build_contact_inbox
build_message
end
ensure_contact_avatar
rescue Koala::Facebook::AuthenticationError
Rails.logger.info "Facebook Authorization expired for Inbox #{@inbox.id}"
@inbox.channel.authorization_error!
rescue StandardError => e
Sentry.capture_exception(e)
ChatwootExceptionTracker.new(e, account: @inbox.account).capture_exception
true
end
private
def contact
@contact ||= @inbox.contact_inboxes.find_by(source_id: @sender_id)&.contact
end
def build_contact
return if contact.present?
@contact = Contact.create!(contact_params.except(:remote_avatar_url))
@contact_inbox = ContactInbox.create(contact: contact, inbox: @inbox, source_id: @sender_id)
def build_contact_inbox
@contact_inbox = ::ContactInboxWithContactBuilder.new(
source_id: @sender_id,
inbox: @inbox,
contact_attributes: contact_params
).perform
end
def build_message
@@ -54,19 +50,11 @@ class Messages::Facebook::MessageBuilder < Messages::Messenger::MessageBuilder
end
end
def ensure_contact_avatar
return if contact_params[:remote_avatar_url].blank?
return if @contact.avatar.attached?
ContactAvatarJob.perform_later(@contact, contact_params[:remote_avatar_url])
end
def conversation
@conversation ||= Conversation.find_by(conversation_params) || build_conversation
end
def build_conversation
@contact_inbox ||= contact.contact_inboxes.find_by!(source_id: @sender_id)
Conversation.create!(conversation_params.merge(
contact_inbox_id: @contact_inbox.id
))
@@ -94,7 +82,7 @@ class Messages::Facebook::MessageBuilder < Messages::Messenger::MessageBuilder
{
account_id: @inbox.account_id,
inbox_id: @inbox.id,
contact_id: contact.id
contact_id: @contact_inbox.contact_id
}
end
@@ -105,7 +93,7 @@ class Messages::Facebook::MessageBuilder < Messages::Messenger::MessageBuilder
message_type: @message_type,
content: response.content,
source_id: response.identifier,
sender: @outgoing_echo ? nil : contact
sender: @outgoing_echo ? nil : @contact_inbox.contact
}
end
@@ -113,7 +101,7 @@ class Messages::Facebook::MessageBuilder < Messages::Messenger::MessageBuilder
{
name: "#{result['first_name'] || 'John'} #{result['last_name'] || 'Doe'}",
account_id: @inbox.account_id,
remote_avatar_url: result['profile_pic'] || ''
avatar_url: result['profile_pic']
}
end
@@ -128,10 +116,14 @@ class Messages::Facebook::MessageBuilder < Messages::Messenger::MessageBuilder
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
Sentry.capture_exception(e) 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 = {}
Sentry.capture_exception(e)
ChatwootExceptionTracker.new(e, account: @inbox.account).capture_exception
end
process_contact_params_result(result)
end
@@ -24,7 +24,7 @@ class Messages::Instagram::MessageBuilder < Messages::Messenger::MessageBuilder
@inbox.channel.authorization_error!
raise
rescue StandardError => e
Sentry.capture_exception(e)
ChatwootExceptionTracker.new(e, account: @inbox.account).capture_exception
true
end
@@ -63,27 +63,42 @@ class Messages::Instagram::MessageBuilder < Messages::Messenger::MessageBuilder
end
def conversation
@conversation ||= Conversation.find_by(conversation_params) || build_conversation
@conversation ||= Conversation.where(
"additional_attributes ->> 'type' = 'instagram_direct_message'"
).find_by(conversation_params) || 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 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
@@ -91,10 +106,7 @@ 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
@@ -117,6 +129,13 @@ class Messages::Instagram::MessageBuilder < Messages::Messenger::MessageBuilder
cw_message.present?
end
def all_unsupported_files?
return if attachments.empty?
attachments_type = attachments.pluck(:type).uniq.first
unsupported_file_type?(attachments_type)
end
### Sample response
# {
# "object": "instagram",
+35 -4
View File
@@ -9,6 +9,7 @@ class Messages::MessageBuilder
@user = user
@message_type = params[:message_type] || 'outgoing'
@attachments = params[:attachments]
@automation_rule = @params&.dig(:content_attributes, :automation_rule_id)
return unless params.instance_of?(ActionController::Parameters)
@in_reply_to = params.to_unsafe_h&.dig(:content_attributes, :in_reply_to)
@@ -34,20 +35,38 @@ class Messages::MessageBuilder
file: uploaded_attachment
)
attachment.file_type = file_type(uploaded_attachment&.content_type) if uploaded_attachment.is_a?(ActionDispatch::Http::UploadedFile)
attachment.file_type = if uploaded_attachment.is_a?(String)
file_type_by_signed_id(
uploaded_attachment
)
else
file_type(uploaded_attachment&.content_type)
end
end
end
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 = []
cc_emails = @params[:cc_emails].gsub(/\s+/, '').split(',') if @params[:cc_emails].present?
bcc_emails = []
bcc_emails = @params[:bcc_emails].gsub(/\s+/, '').split(',') if @params[:bcc_emails].present?
all_email_addresses = cc_emails + bcc_emails
validate_email_addresses(all_email_addresses)
@message.content_attributes[:cc_emails] = cc_emails
@message.content_attributes[:bcc_emails] = bcc_emails
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
if @conversation.inbox.channel_type != 'Channel::Api' && @message_type == 'incoming'
raise StandardError, 'Incoming messages are only allowed in Api inboxes'
@@ -64,6 +83,18 @@ class Messages::MessageBuilder
@params[:external_created_at].present? ? { external_created_at: @params[:external_created_at] } : {}
end
def automation_rule_id
@automation_rule.present? ? { content_attributes: { automation_rule_id: @automation_rule } } : {}
end
def campaign_id
@params[:campaign_id].present? ? { additional_attributes: { campaign_id: @params[:campaign_id] } } : {}
end
def template_params
@params[:template_params].present? ? { additional_attributes: { template_params: JSON.parse(@params[:template_params].to_json) } } : {}
end
def message_sender
return if @params[:sender_type] != 'AgentBot'
@@ -82,6 +113,6 @@ class Messages::MessageBuilder
items: @items,
in_reply_to: @in_reply_to,
echo_id: @params[:echo_id]
}.merge(external_created_at)
}.merge(external_created_at).merge(automation_rule_id).merge(campaign_id).merge(template_params)
end
end
@@ -1,10 +1,15 @@
class Messages::Messenger::MessageBuilder
include ::FileTypeHelper
def process_attachment(attachment)
return if attachment['type'].to_sym == :template
# This check handles very rare case if there are multiple files to attach with only one usupported file
return if unsupported_file_type?(attachment['type'])
attachment_obj = @message.attachments.new(attachment_params(attachment).except(:remote_file_url))
attachment_obj.save!
attach_file(attachment_obj, attachment_params(attachment)[:remote_file_url]) if attachment_params(attachment)[:remote_file_url]
fetch_story_link(attachment_obj) if attachment_obj.file_type == 'story_mention'
update_attachment_file_type(attachment_obj)
end
def attach_file(attachment, file_url)
@@ -22,7 +27,7 @@ class Messages::Messenger::MessageBuilder
file_type = attachment['type'].to_sym
params = { file_type: file_type, account_id: @message.account_id }
if [:image, :file, :audio, :video].include? file_type
if [:image, :file, :audio, :video, :share, :story_mention].include? file_type
params.merge!(file_type_params(attachment))
elsif file_type == :location
params.merge!(location_params(attachment))
@@ -39,4 +44,50 @@ class Messages::Messenger::MessageBuilder
remote_file_url: attachment['payload']['url']
}
end
def update_attachment_file_type(attachment)
return if @message.reload.attachments.blank?
return unless attachment.file_type == 'share' || attachment.file_type == 'story_mention'
attachment.file_type = file_type(attachment.file&.content_type)
attachment.save!
end
def fetch_story_link(attachment)
message = attachment.message
result = get_story_object_from_source_id(message.source_id)
return if result.blank?
story_id = result['story']['mention']['id']
story_sender = result['from']['username']
message.content_attributes[:story_sender] = story_sender
message.content_attributes[:story_id] = story_id
message.content_attributes[:image_type] = 'story_mention'
message.content = I18n.t('conversations.messages.instagram_story_content', story_sender: story_sender)
message.save!
end
def get_story_object_from_source_id(source_id)
k = Koala::Facebook::API.new(@inbox.channel.page_access_token) if @inbox.facebook?
k.get_object(source_id, fields: %w[story from]) || {}
rescue Koala::Facebook::AuthenticationError
@inbox.channel.authorization_error!
raise
rescue Koala::Facebook::ClientError => e
# The exception occurs when we are trying fetch the deleted story or blocked story.
@message.attachments.destroy_all
@message.update(content: I18n.t('conversations.messages.instagram_deleted_story_content'))
Rails.logger.error e
{}
rescue StandardError => e
ChatwootExceptionTracker.new(e, account: @inbox.account).capture_exception
{}
end
private
def unsupported_file_type?(attachment_type)
[:template, :unsupported_type].include? attachment_type.to_sym
end
end
+3
View File
@@ -15,6 +15,9 @@ class NotificationBuilder
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 true if notification_setting.public_send("email_#{notification_type}?")
return true if notification_setting.public_send("push_#{notification_type}?")
@@ -25,7 +25,7 @@ class NotificationSubscriptionBuilder
end
def build_identifier_subscription
@identifier_subscription = user.notification_subscriptions.create(params.merge(identifier: identifier))
@identifier_subscription = user.notification_subscriptions.create!(params.merge(identifier: identifier))
end
def update_identifier_subscription
+41 -58
View File
@@ -1,8 +1,10 @@
class V2::ReportBuilder
include DateRangeHelper
include ReportHelper
attr_reader :account, :params
DEFAULT_GROUP_BY = 'day'.freeze
AGENT_RESULTS_PER_PAGE = 25
def initialize(account, params)
@account = account
@@ -18,8 +20,14 @@ class V2::ReportBuilder
# For backward compatible with old report
def build
timeseries.each_with_object([]) do |p, arr|
arr << { value: p[1], timestamp: p[0].to_time.to_i }
if %w[avg_first_response_time avg_resolution_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
else
timeseries.each_with_object([]) do |p, arr|
arr << { value: p[1], timestamp: p[0].in_time_zone(@timezone).to_i }
end
end
end
@@ -34,23 +42,16 @@ class V2::ReportBuilder
}
end
private
def scope
case params[:type]
when :account
account
when :inbox
inbox
when :agent
user
when :label
label
when :team
team
def conversation_metrics
if params[:type].equal?(:account)
conversations
else
agent_metrics.sort_by { |hash| hash[:metric][:open] }.reverse
end
end
private
def inbox
@inbox ||= account.inboxes.find(params[:id])
end
@@ -68,57 +69,39 @@ class V2::ReportBuilder
end
def get_grouped_values(object_scope)
object_scope.group_by_period(
@grouped_values = object_scope.group_by_period(
params[:group_by] || DEFAULT_GROUP_BY,
:created_at,
default_value: 0,
range: range,
permit: %w[day week month year],
permit: %w[day week month year hour],
time_zone: @timezone
)
end
def conversations_count
(get_grouped_values scope.conversations).count
def agent_metrics
account_users = @account.account_users.page(params[:page]).per(AGENT_RESULTS_PER_PAGE)
account_users.each_with_object([]) do |account_user, arr|
@user = account_user.user
arr << {
id: @user.id,
name: @user.name,
email: @user.email,
thumbnail: @user.avatar_url,
availability: account_user.availability_status,
metric: conversations
}
end
end
def incoming_messages_count
(get_grouped_values scope.messages.incoming.unscope(:order)).count
end
def outgoing_messages_count
(get_grouped_values scope.messages.outgoing.unscope(:order)).count
end
def resolutions_count
(get_grouped_values scope.conversations.resolved).count
end
def avg_first_response_time
(get_grouped_values scope.events.where(name: 'first_response')).average(:value)
end
def avg_resolution_time
(get_grouped_values scope.events.where(name: 'conversation_resolved')).average(:value)
end
def avg_resolution_time_summary
avg_rt = scope.events
.where(name: 'conversation_resolved', created_at: range)
.average(:value)
return 0 if avg_rt.blank?
avg_rt
end
def avg_first_response_time_summary
avg_frt = scope.events
.where(name: 'first_response', created_at: range)
.average(:value)
return 0 if avg_frt.blank?
avg_frt
def 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
}
metric[:unassigned] = @open_conversations.unassigned.count if params[:type].equal?(:account)
metric
end
end
+9
View File
@@ -1,5 +1,8 @@
class RoomChannel < ApplicationCable::Channel
def subscribed
# TODO: should we only do ensure stream if current account is present?
# for now going ahead with guard clauses in update_subscription and broadcast_presence
ensure_stream
current_user
current_account
@@ -15,6 +18,8 @@ class RoomChannel < ApplicationCable::Channel
private
def broadcast_presence
return if @current_account.blank?
data = { account_id: @current_account.id, users: ::OnlineStatusTracker.get_available_users(@current_account.id) }
data[:contacts] = ::OnlineStatusTracker.get_available_contacts(@current_account.id) if @current_user.is_a? User
ActionCable.server.broadcast(@pubsub_token, { event: 'presence.update', data: data })
@@ -26,6 +31,8 @@ class RoomChannel < ApplicationCable::Channel
end
def update_subscription
return if @current_account.blank?
::OnlineStatusTracker.update_presence(@current_account.id, @current_user.class.name, @current_user.id)
end
@@ -38,6 +45,8 @@ class RoomChannel < ApplicationCable::Channel
end
def current_account
return if current_user.blank?
@current_account ||= if @current_user.is_a? Contact
@current_user.account
else
@@ -18,7 +18,7 @@ class Api::V1::Accounts::AgentBotsController < Api::V1::Accounts::BaseController
end
def destroy
@agent_bot.destroy
@agent_bot.destroy!
head :ok
end
@@ -30,6 +30,6 @@ class Api::V1::Accounts::AgentBotsController < Api::V1::Accounts::BaseController
end
def permitted_params
params.permit(:name, :description, :outgoing_url)
params.permit(:name, :description, :outgoing_url, :bot_type, bot_config: [:csml_content])
end
end
@@ -18,7 +18,8 @@ class Api::V1::Accounts::AgentsController < Api::V1::Accounts::BaseController
end
def destroy
@agent.current_account_user.destroy
@agent.current_account_user.destroy!
delete_user_record(@agent)
head :ok
end
@@ -39,7 +40,7 @@ class Api::V1::Accounts::AgentsController < Api::V1::Accounts::BaseController
# TODO: move this to a builder and combine the save account user method into a builder
# ensure the account user association is also created in a single transaction
def create_user
return if @user
return @user.send_confirmation_instructions if @user
@user = User.create!(new_agent_params.slice(:email, :name, :password, :password_confirmation))
end
@@ -68,10 +69,14 @@ class Api::V1::Accounts::AgentsController < Api::V1::Accounts::BaseController
end
def agents
@agents ||= Current.account.users.order_by_full_name.includes({ avatar_attachment: [:blob] })
@agents ||= Current.account.users.order_by_full_name.includes(:account_users, { avatar_attachment: [:blob] })
end
def validate_limit
render_payment_required('Account limit exceeded. Upgrade to a higher plan') if agents.count >= Current.account.usage_limits[:agents]
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
@@ -0,0 +1,81 @@
class Api::V1::Accounts::ArticlesController < Api::V1::Accounts::BaseController
before_action :portal
before_action :check_authorization
before_action :fetch_article, except: [:index, :create, :attach_file, :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 = if list_params[:category_slug].present?
@all_articles.order_by_position.page(@current_page).per(50)
else
@all_articles.order_by_updated_at.page(@current_page)
end
end
def create
@article = @portal.articles.create!(article_params)
@article.associate_root_article(article_params[:associated_article_id])
@article.draft!
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) if params[:article].present?
render json: { error: @article.errors.messages }, status: :unprocessable_entity and return unless @article.valid?
end
def destroy
@article.destroy!
head :ok
end
def attach_file
file_blob = ActiveStorage::Blob.create_and_upload!(
key: nil,
io: params[:background_image].tempfile,
filename: params[:background_image].original_filename,
content_type: params[:background_image].content_type
)
file_blob.save!
render json: { file_url: url_for(file_blob) }
end
def reorder
Article.update_positions(params[:positions_hash])
head :ok
end
private
def fetch_article
@article = @portal.articles.find(params[:id])
end
def portal
@portal ||= Current.account.portals.find_by!(slug: params[:portal_id])
end
def article_params
params.require(:article).permit(
:title, :slug, :position, :content, :description, :position, :category_id, :author_id, :associated_article_id, :status, meta: [:title,
:description,
{ tags: [] }]
)
end
def list_params
params.permit(:locale, :query, :page, :category_slug, :status, :author_id)
end
def set_current_page
@current_page = params[:page] || 1
end
end
@@ -0,0 +1,24 @@
class Api::V1::Accounts::AssignableAgentsController < Api::V1::Accounts::BaseController
before_action :fetch_inboxes
def index
agent_ids = @inboxes.map do |inbox|
authorize inbox, :show?
member_ids = inbox.members.pluck(:user_id)
member_ids
end
agent_ids = agent_ids.inject(:&)
agents = Current.account.users.where(id: agent_ids)
@assignable_agents = (agents + Current.account.administrators).uniq
end
private
def fetch_inboxes
@inboxes = Current.account.inboxes.find(permitted_params[:inbox_ids])
end
def permitted_params
params.permit(inbox_ids: [])
end
end
@@ -3,17 +3,42 @@ class Api::V1::Accounts::AutomationRulesController < Api::V1::Accounts::BaseCont
before_action :fetch_automation_rule, only: [:show, :update, :destroy, :clone]
def index
@automation_rules = Current.account.automation_rules.active
@automation_rules = Current.account.automation_rules
end
def create
@automation_rule = Current.account.automation_rules.create(automation_rules_permit)
@automation_rule = Current.account.automation_rules.new(automation_rules_permit)
@automation_rule.actions = params[:actions]
@automation_rule.conditions = params[:conditions]
render json: { error: @automation_rule.errors.messages }, status: :unprocessable_entity and return unless @automation_rule.valid?
@automation_rule.save!
process_attachments
@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
@automation_rule.update(automation_rules_permit)
ActiveRecord::Base.transaction do
automation_rule_update
process_attachments
rescue StandardError => e
Rails.logger.error e
render json: { error: @automation_rule.errors.messages }.to_json, status: :unprocessable_entity
end
end
def destroy
@@ -24,16 +49,34 @@ class Api::V1::Accounts::AutomationRulesController < Api::V1::Accounts::BaseCont
def clone
automation_rule = Current.account.automation_rules.find_by(id: params[:automation_rule_id])
new_rule = automation_rule.dup
new_rule.save
new_rule.save!
@automation_rule = new_rule
end
def process_attachments
actions = @automation_rule.actions.filter_map { |k, _v| k if k['action_name'] == 'send_attachment' }
return if actions.blank?
actions.each do |action|
blob_id = action['action_params']
blob = ActiveStorage::Blob.find_by(id: blob_id)
@automation_rule.files.attach(blob)
end
end
private
def automation_rule_update
@automation_rule.update!(automation_rules_permit)
@automation_rule.actions = params[:actions] if params[:actions]
@automation_rule.conditions = params[:conditions] if params[:conditions]
@automation_rule.save!
end
def automation_rules_permit
params.permit(
:name, :description, :event_name, :account_id,
conditions: [:attribute_key, :filter_operator, :query_operator, { values: [] }],
:name, :description, :event_name, :account_id, :active,
conditions: [:attribute_key, :filter_operator, :query_operator, :custom_attribute_type, { values: [] }],
actions: [:action_name, { action_params: [] }]
)
end
@@ -1,32 +1,6 @@
class Api::V1::Accounts::BaseController < Api::BaseController
include SwitchLocale
include EnsureCurrentAccountHelper
before_action :current_account
around_action :switch_locale_using_account_locale
private
def current_account
@current_account ||= ensure_current_account
Current.account = @current_account
end
def ensure_current_account
account = Account.find(params[:account_id])
if current_user
account_accessible_for_user?(account)
elsif @resource.is_a?(AgentBot)
account_accessible_for_bot?(account)
end
account
end
def account_accessible_for_user?(account)
@current_account_user = account.account_users.find_by(user_id: current_user.id)
Current.account_user = @current_account_user
render_unauthorized('You are not authorized to access this account') unless @current_account_user
end
def account_accessible_for_bot?(account)
render_unauthorized('You are not authorized to access this account') unless @resource.agent_bot_inboxes.find_by(account_id: account.id)
end
end
@@ -15,7 +15,7 @@ class Api::V1::Accounts::CallbacksController < Api::V1::Accounts::BaseController
set_instagram_id(page_access_token, facebook_channel)
set_avatar(@facebook_inbox, page_id)
rescue StandardError => e
Sentry.capture_exception(e)
ChatwootExceptionTracker.new(e).capture_exception
end
end
@@ -60,7 +60,7 @@ class Api::V1::Accounts::CallbacksController < Api::V1::Accounts::BaseController
set_instagram_id(access_token, fb_page)
fb_page&.reauthorized!
rescue StandardError => e
Sentry.capture_exception(e)
ChatwootExceptionTracker.new(e).capture_exception
end
end
@@ -77,7 +77,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.info e
Rails.logger.error e
end
def mark_already_existing_facebook_pages(data)
@@ -90,9 +90,7 @@ class Api::V1::Accounts::CallbacksController < Api::V1::Accounts::BaseController
end
def set_avatar(facebook_inbox, page_id)
avatar_file = Down.download(
"http://graph.facebook.com/#{page_id}/picture?type=large"
)
facebook_inbox.avatar.attach(io: avatar_file, filename: avatar_file.original_filename, content_type: avatar_file.content_type)
avatar_url = "https://graph.facebook.com/#{page_id}/picture?type=large"
Avatar::AvatarFromUrlJob.perform_later(facebook_inbox, avatar_url)
end
end
@@ -11,7 +11,7 @@ class Api::V1::Accounts::CampaignsController < Api::V1::Accounts::BaseController
end
def destroy
@campaign.destroy
@campaign.destroy!
head :ok
end
@@ -17,7 +17,7 @@ class Api::V1::Accounts::CannedResponsesController < Api::V1::Accounts::BaseCont
end
def destroy
@canned_response.destroy
@canned_response.destroy!
head :ok
end
@@ -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
@@ -0,0 +1,58 @@
class Api::V1::Accounts::CategoriesController < Api::V1::Accounts::BaseController
before_action :portal
before_action :check_authorization
before_action :fetch_category, except: [:index, :create]
before_action :set_current_page, only: [:index]
def index
@current_locale = params[:locale]
@categories = @portal.categories.search(params)
end
def create
@category = @portal.categories.create!(category_params)
@category.related_categories << related_categories_records
render json: { error: @category.errors.messages }, status: :unprocessable_entity and return unless @category.valid?
@category.save!
end
def show; end
def update
@category.update!(category_params)
@category.related_categories = related_categories_records if related_categories_records.any?
render json: { error: @category.errors.messages }, status: :unprocessable_entity and return unless @category.valid?
@category.save!
end
def destroy
@category.destroy!
head :ok
end
private
def fetch_category
@category = @portal.categories.find(params[:id])
end
def portal
@portal ||= Current.account.portals.find_by(slug: params[:portal_id])
end
def related_categories_records
@portal.categories.where(id: params[:category][:related_category_ids])
end
def category_params
params.require(:category).permit(
:name, :description, :position, :slug, :locale, :parent_category_id, :associated_category_id
)
end
def set_current_page
@current_page = params[:page] || 1
end
end
@@ -7,7 +7,6 @@ class Api::V1::Accounts::Channels::TwilioChannelsController < Api::V1::Accounts:
build_inbox
setup_webhooks if @twilio_channel.sms?
rescue StandardError => e
Sentry.capture_exception(e)
render_could_not_create_error(e.message)
end
end
@@ -28,6 +27,8 @@ class Api::V1::Accounts::Channels::TwilioChannelsController < Api::V1::Accounts:
end
def phone_number
return if permitted_params[:phone_number].blank?
medium == 'sms' ? permitted_params[:phone_number] : "whatsapp:#{permitted_params[:phone_number]}"
end
@@ -39,10 +40,11 @@ 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],
messaging_service_sid: permitted_params[:messaging_service_sid].presence,
phone_number: phone_number,
medium: medium
)
@inbox = Current.account.inboxes.create(
@inbox = Current.account.inboxes.create!(
name: permitted_params[:name],
channel: @twilio_channel
)
@@ -50,7 +52,7 @@ class Api::V1::Accounts::Channels::TwilioChannelsController < Api::V1::Accounts:
def permitted_params
params.require(:twilio_channel).permit(
:account_id, :phone_number, :account_sid, :auth_token, :name, :medium
:account_id, :messaging_service_sid, :phone_number, :account_sid, :auth_token, :name, :medium
)
end
end
@@ -2,8 +2,11 @@ class Api::V1::Accounts::Contacts::ContactInboxesController < Api::V1::Accounts:
before_action :ensure_inbox, only: [:create]
def create
source_id = params[:source_id] || SecureRandom.uuid
@contact_inbox = ContactInbox.create!(contact: @contact, inbox: @inbox, source_id: source_id)
@contact_inbox = ContactInboxBuilder.new(
contact: @contact,
inbox: @inbox,
source_id: params[:source_id]
).perform
end
private
@@ -2,7 +2,7 @@ class Api::V1::Accounts::Contacts::ConversationsController < Api::V1::Accounts::
def index
@conversations = Current.account.conversations.includes(
:assignee, :contact, :inbox, :taggings
).where(inbox_id: inbox_ids, contact_id: @contact.id)
).where(inbox_id: inbox_ids, contact_id: @contact.id).order(id: :desc).limit(20)
end
private
@@ -10,7 +10,7 @@ class Api::V1::Accounts::Contacts::NotesController < Api::V1::Accounts::Contacts
end
def destroy
@note.destroy
@note.destroy!
head :ok
end
@@ -12,7 +12,7 @@ class Api::V1::Accounts::ContactsController < Api::V1::Accounts::BaseController
before_action :check_authorization
before_action :set_current_page, only: [:index, :active, :search, :filter]
before_action :fetch_contact, only: [:show, :update, :destroy, :contactable_inboxes, :destroy_custom_attributes]
before_action :fetch_contact, only: [:show, :update, :destroy, :avatar, :contactable_inboxes, :destroy_custom_attributes]
before_action :set_include_contact_inboxes, only: [:index, :search, :filter]
def index
@@ -25,7 +25,7 @@ class Api::V1::Accounts::ContactsController < Api::V1::Accounts::BaseController
contacts = resolved_contacts.where(
'name ILIKE :search OR email ILIKE :search OR phone_number ILIKE :search OR contacts.identifier LIKE :search',
search: "%#{params[:q]}%"
search: "%#{params[:q].strip}%"
)
@contacts_count = contacts.count
@contacts = fetch_contacts_with_conversation_count(contacts)
@@ -72,15 +72,17 @@ class Api::V1::Accounts::ContactsController < Api::V1::Accounts::BaseController
def create
ActiveRecord::Base.transaction do
@contact = Current.account.contacts.new(contact_params)
@contact = Current.account.contacts.new(permitted_params.except(:avatar_url))
@contact.save!
@contact_inbox = build_contact_inbox
process_avatar
end
end
def update
@contact.assign_attributes(contact_update_params)
@contact.save!
process_avatar if permitted_params[:avatar].present? || permitted_params[:avatar_url].present?
end
def destroy
@@ -95,6 +97,11 @@ class Api::V1::Accounts::ContactsController < Api::V1::Accounts::BaseController
head :ok
end
def avatar
@contact.avatar.purge if @contact.avatar.attached?
@contact
end
private
# TODO: Move this to a finder class
@@ -112,11 +119,12 @@ class Api::V1::Accounts::ContactsController < Api::V1::Accounts::BaseController
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)
conversation_count_sub_query = 'SELECT COUNT(*) FROM "conversations" WHERE "conversations"."contact_id" = "contacts"."id"'
contacts_with_conversation_count = filtrate(contacts)
.select("contacts.*, (#{conversation_count_sub_query}) as conversations_count")
.group('contacts.id')
.includes([{ avatar_attachment: [:blob] }])
.page(@current_page).per(RESULTS_PER_PAGE)
return contacts_with_conversation_count.includes([{ contact_inboxes: [:inbox] }]) if @include_contact_inboxes
@@ -127,23 +135,26 @@ class Api::V1::Accounts::ContactsController < Api::V1::Accounts::BaseController
return if params[:inbox_id].blank?
inbox = Current.account.inboxes.find(params[:inbox_id])
source_id = params[:source_id] || SecureRandom.uuid
ContactInbox.create(contact: @contact, inbox: inbox, source_id: source_id)
ContactInboxBuilder.new(
contact: @contact,
inbox: inbox,
source_id: params[:source_id]
).perform
end
def contact_params
params.require(:contact).permit(:name, :identifier, :email, :phone_number, additional_attributes: {}, custom_attributes: {})
def permitted_params
params.permit(:name, :identifier, :email, :phone_number, :avatar, :avatar_url, additional_attributes: {}, custom_attributes: {})
end
def contact_custom_attributes
return @contact.custom_attributes.merge(contact_params[:custom_attributes]) if contact_params[:custom_attributes]
return @contact.custom_attributes.merge(permitted_params[:custom_attributes]) if permitted_params[:custom_attributes]
@contact.custom_attributes
end
def contact_update_params
# we want the merged custom attributes not the original one
contact_params.except(:custom_attributes).merge({ custom_attributes: contact_custom_attributes })
permitted_params.except(:custom_attributes, :avatar_url).merge({ custom_attributes: contact_custom_attributes })
end
def set_include_contact_inboxes
@@ -158,6 +169,10 @@ class Api::V1::Accounts::ContactsController < Api::V1::Accounts::BaseController
@contact = Current.account.contacts.includes(contact_inboxes: [:inbox]).find(params[:id])
end
def process_avatar
::Avatar::AvatarFromUrlJob.perform_later(@contact, params[:avatar_url]) if params[:avatar_url].present?
end
def render_error(error, error_status)
render json: error, status: error_status
end
@@ -1,10 +1,11 @@
class Api::V1::Accounts::Conversations::BaseController < Api::V1::Accounts::BaseController
include EnsureCurrentAccountHelper
before_action :conversation
private
def conversation
@conversation ||= Current.account.conversations.find_by(display_id: params[:conversation_id])
@conversation ||= Current.account.conversations.find_by!(display_id: params[:conversation_id])
authorize @conversation.inbox, :show?
end
end
@@ -0,0 +1,17 @@
class Api::V1::Accounts::Conversations::DirectUploadsController < ActiveStorage::DirectUploadsController
include EnsureCurrentAccountHelper
before_action :current_account
before_action :conversation
def create
return if @conversation.nil? || @current_account.nil?
super
end
private
def conversation
@conversation ||= Current.account.conversations.find_by(display_id: params[:conversation_id])
end
end
@@ -13,11 +13,29 @@ class Api::V1::Accounts::Conversations::MessagesController < Api::V1::Accounts::
def destroy
ActiveRecord::Base.transaction do
message.update!(content: I18n.t('conversations.messages.deleted'), deleted: true)
message.update!(content: I18n.t('conversations.messages.deleted'), content_attributes: { deleted: true })
message.attachments.destroy_all
end
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 +47,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
@@ -3,7 +3,7 @@ class Api::V1::Accounts::ConversationsController < Api::V1::Accounts::BaseContro
include DateRangeHelper
before_action :conversation, except: [:index, :meta, :search, :create, :filter]
before_action :contact_inbox, only: [:create]
before_action :inbox, :contact, :contact_inbox, only: [:create]
def index
result = conversation_finder.perform
@@ -22,9 +22,13 @@ class Api::V1::Accounts::ConversationsController < Api::V1::Accounts::BaseContro
@conversations_count = result[:count]
end
def attachments
@attachments = @conversation.attachments
end
def create
ActiveRecord::Base.transaction do
@conversation = ::Conversation.create!(conversation_params)
@conversation = ConversationBuilder.new(params: params, contact_inbox: @contact_inbox).perform
Messages::MessageBuilder.new(Current.user, @conversation, params[:message]).perform if params[:message].present?
end
end
@@ -64,21 +68,25 @@ class Api::V1::Accounts::ConversationsController < Api::V1::Accounts::BaseContro
assign_conversation if @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
def update_last_seen
# rubocop:disable Rails/SkipsModelValidations
@conversation.update_column(:agent_last_seen_at, DateTime.now.utc)
@conversation.update_column(:assignee_last_seen_at, DateTime.now.utc) if assignee?
# rubocop:enable Rails/SkipsModelValidations
update_last_seen_on_conversation(DateTime.now.utc, assignee?)
end
def unread
last_incoming_message = @conversation.messages.incoming.last
last_seen_at = last_incoming_message.created_at - 1.second if last_incoming_message.present?
update_last_seen_on_conversation(last_seen_at, true)
end
def custom_attributes
@@ -88,9 +96,18 @@ class Api::V1::Accounts::ConversationsController < Api::V1::Accounts::BaseContro
private
def update_last_seen_on_conversation(last_seen_at, update_assignee)
# rubocop:disable Rails/SkipsModelValidations
@conversation.update_column(:agent_last_seen_at, last_seen_at)
@conversation.update_column(:assignee_last_seen_at, last_seen_at) if update_assignee.present?
# rubocop:enable Rails/SkipsModelValidations
end
def set_conversation_status
status = params[:status] == 'bot' ? 'pending' : params[:status]
@conversation.status = 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
@@ -99,61 +116,51 @@ class Api::V1::Accounts::ConversationsController < Api::V1::Accounts::BaseContro
@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)
end
def conversation
@conversation ||= Current.account.conversations.find_by!(display_id: params[:id])
authorize @conversation.inbox, :show?
end
def inbox
return if params[:inbox_id].blank?
@inbox = Current.account.inboxes.find(params[:inbox_id])
authorize @inbox, :show?
end
def contact
return if params[:contact_id].blank?
@contact = Current.account.contacts.find(params[:contact_id])
end
def contact_inbox
@contact_inbox = build_contact_inbox
# fallback for the old case where we do look up only using source id
# In future we need to change this and make sure we do look up on combination of inbox_id and source_id
# 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
return if params[:contact_id].blank? || params[:inbox_id].blank?
inbox = Current.account.inboxes.find(params[:inbox_id])
authorize inbox, :show?
return if @inbox.blank? || @contact.blank?
ContactInboxBuilder.new(
contact_id: params[:contact_id],
inbox_id: inbox.id,
contact: @contact,
inbox: @inbox,
source_id: params[:source_id]
).perform
end
def conversation_params
additional_attributes = params[:additional_attributes]&.permit! || {}
custom_attributes = params[:custom_attributes]&.permit! || {}
status = params[:status].present? ? { status: params[:status] } : {}
# TODO: temporary fallback for the old bot status in conversation, we will remove after couple of releases
status = { status: 'pending' } if status[:status] == 'bot'
{
account_id: Current.account.id,
inbox_id: @contact_inbox.inbox_id,
contact_id: @contact_inbox.contact_id,
contact_inbox_id: @contact_inbox.id,
additional_attributes: additional_attributes,
custom_attributes: custom_attributes,
snoozed_until: params[:snoozed_until],
assignee_id: params[:assignee_id],
team_id: params[:team_id]
}.merge(status)
end
def conversation_finder
@conversation_finder ||= ConversationFinder.new(current_user, params)
@conversation_finder ||= ConversationFinder.new(Current.user, params)
end
def assignee?
@conversation.assignee_id? && current_user == @conversation.assignee
@conversation.assignee_id? && Current.user == @conversation.assignee
end
end
@@ -5,7 +5,7 @@ class Api::V1::Accounts::CsatSurveyResponsesController < Api::V1::Accounts::Base
RESULTS_PER_PAGE = 25
before_action :check_authorization
before_action :set_csat_survey_responses, only: [:index, :metrics]
before_action :set_csat_survey_responses, only: [:index, :metrics, :download]
before_action :set_current_page, only: [:index]
before_action :set_current_page_surveys, only: [:index]
before_action :set_total_sent_messages_count, only: [:metrics]
@@ -19,6 +19,12 @@ class Api::V1::Accounts::CsatSurveyResponsesController < Api::V1::Accounts::Base
@ratings_count = @csat_survey_responses.group(:rating).count
end
def download
response.headers['Content-Type'] = 'text/csv'
response.headers['Content-Disposition'] = 'attachment; filename=csat_report.csv'
render layout: false, template: 'api/v1/accounts/csat_survey_responses/download', formats: [:csv]
end
private
def set_total_sent_messages_count
@@ -30,8 +36,7 @@ class Api::V1::Accounts::CsatSurveyResponsesController < Api::V1::Accounts::Base
def set_csat_survey_responses
@csat_survey_responses = filtrate(
Current.account.csat_survey_responses.includes([:conversation, :assigned_agent, :contact])
)
@csat_survey_responses = @csat_survey_responses.where(created_at: range) if range.present?
).filter_by_created_at(range).filter_by_assigned_agent_id(params[:user_ids])
end
def set_current_page_surveys
@@ -18,7 +18,7 @@ class Api::V1::Accounts::CustomAttributeDefinitionsController < Api::V1::Account
end
def destroy
@custom_attribute_definition.destroy
@custom_attribute_definition.destroy!
head :no_content
end
@@ -18,7 +18,7 @@ class Api::V1::Accounts::CustomFiltersController < Api::V1::Accounts::BaseContro
end
def destroy
@custom_filter.destroy
@custom_filter.destroy!
head :no_content
end
@@ -0,0 +1,44 @@
class Api::V1::Accounts::DashboardAppsController < Api::V1::Accounts::BaseController
before_action :fetch_dashboard_apps, except: [:create]
before_action :fetch_dashboard_app, only: [:show, :update, :destroy]
def index; end
def show; end
def create
@dashboard_app = Current.account.dashboard_apps.create!(
permitted_payload.merge(user_id: Current.user.id)
)
end
def update
@dashboard_app.update!(permitted_payload)
end
def destroy
@dashboard_app.destroy!
head :no_content
end
private
def fetch_dashboard_apps
@dashboard_apps = Current.account.dashboard_apps
end
def fetch_dashboard_app
@dashboard_app = @dashboard_apps.find(permitted_params[:id])
end
def permitted_payload
params.require(:dashboard_app).permit(
:title,
content: [:url, :type]
)
end
def permitted_params
params.permit(:id)
end
end
@@ -12,8 +12,9 @@ class Api::V1::Accounts::InboxesController < Api::V1::Accounts::BaseController
def show; end
# 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
@@ -41,19 +42,30 @@ class Api::V1::Accounts::InboxesController < Api::V1::Accounts::BaseController
end
def update
@inbox.update(permitted_params.except(:channel))
@inbox.update_working_hours(params.permit(working_hours: Inbox::OFFISABLE_ATTRS)[:working_hours]) if params[:working_hours]
@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?
validate_email_channel(channel_attributes) if @inbox.inbox_type == 'Email'
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]
end
def agent_bot
@agent_bot = @inbox.agent_bot
end
@@ -70,8 +82,8 @@ class Api::V1::Accounts::InboxesController < Api::V1::Accounts::BaseController
end
def destroy
@inbox.destroy
head :ok
::DeleteObjectJob.perform_later(@inbox) if @inbox.present?
render status: :ok, json: { message: I18n.t('messages.inbox_deletetion_response') }
end
private
@@ -85,12 +97,6 @@ class Api::V1::Accounts::InboxesController < Api::V1::Accounts::BaseController
@agent_bot = AgentBot.find(params[:agent_bot]) if params[:agent_bot]
end
def inbox_name(channel)
return channel.try(:bot_name) if channel.is_a?(Channel::Telegram)
permitted_params[:name]
end
def create_channel
return unless %w[web_widget api email line telegram whatsapp sms].include?(permitted_params[:channel][:type])
@@ -105,10 +111,18 @@ class Api::V1::Accounts::InboxesController < Api::V1::Accounts::BaseController
@inbox.channel.save!
end
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, :portal_id]
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(
: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,
*inbox_attributes,
channel: [:type, *channel_attributes]
)
end
@@ -125,18 +139,6 @@ class Api::V1::Accounts::InboxesController < Api::V1::Accounts::BaseController
}[permitted_params[:channel][:type]]
end
def account_channels_method
{
'web_widget' => Current.account.web_widgets,
'api' => Current.account.api_channels,
'email' => Current.account.email_channels,
'line' => Current.account.line_channels,
'telegram' => Current.account.telegram_channels,
'whatsapp' => Current.account.whatsapp_channels,
'sms' => Current.account.sms_channels
}[permitted_params[:channel][:type]]
end
def get_channel_attributes(channel_type)
if channel_type.constantize.const_defined?(:EDITABLE_ATTRS)
channel_type.constantize::EDITABLE_ATTRS.presence
@@ -144,10 +146,6 @@ class Api::V1::Accounts::InboxesController < Api::V1::Accounts::BaseController
[]
end
end
def validate_limit
return unless Current.account.inboxes.count >= Current.account.usage_limits[:inboxes]
render_payment_required('Account limit exceeded. Upgrade to a higher plan')
end
end
Api::V1::Accounts::InboxesController.prepend_mod_with('Api::V1::Accounts::InboxesController')
@@ -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]
@@ -0,0 +1,48 @@
class Api::V1::Accounts::Integrations::DyteController < Api::V1::Accounts::BaseController
before_action :fetch_conversation, only: [:create_a_meeting]
before_action :fetch_message, only: [:add_participant_to_meeting]
before_action :authorize_request
def create_a_meeting
render_response(dyte_processor_service.create_a_meeting(Current.user))
end
def add_participant_to_meeting
if @message.content_type != 'integrations'
return render json: {
error: I18n.t('errors.dyte.invalid_message_type')
}, status: :unprocessable_entity
end
render_response(
dyte_processor_service.add_participant_to_meeting(@message.content_attributes['data']['meeting_id'], Current.user)
)
end
private
def authorize_request
authorize @conversation.inbox, :show?
end
def render_response(response)
render json: response, status: response[:error].blank? ? :ok : :unprocessable_entity
end
def dyte_processor_service
Integrations::Dyte::ProcessorService.new(account: Current.account, conversation: @conversation)
end
def permitted_params
params.permit(:conversation_id, :message_id)
end
def fetch_conversation
@conversation = Current.account.conversations.find_by!(display_id: permitted_params[:conversation_id])
end
def fetch_message
@message = Current.account.messages.find(permitted_params[:message_id])
@conversation = @message.conversation
end
end
@@ -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,8 +10,12 @@ 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
@hook.destroy!
head :ok
end
@@ -20,7 +20,7 @@ class Api::V1::Accounts::Integrations::SlackController < Api::V1::Accounts::Base
end
def destroy
@hook.destroy
@hook.destroy!
head :ok
end
@@ -1,9 +0,0 @@
class Api::V1::Accounts::Kbase::BaseController < Api::V1::Accounts::BaseController
before_action :portal
private
def portal
@portal ||= Current.account.kbase_portals.find_by(id: params[:portal_id])
end
end
@@ -1,32 +0,0 @@
class Api::V1::Accounts::Kbase::CategoriesController < Api::V1::Accounts::Kbase::BaseController
before_action :fetch_category, except: [:index, :create]
def index
@categories = @portal.categories
end
def create
@category = @portal.categories.create!(category_params)
end
def update
@category.update!(category_params)
end
def destroy
@category.destroy
head :ok
end
private
def fetch_category
@category = @portal.categories.find(params[:id])
end
def category_params
params.require(:category).permit(
:name, :description, :position
)
end
end
@@ -1,32 +0,0 @@
class Api::V1::Accounts::Kbase::PortalsController < Api::V1::Accounts::Kbase::BaseController
before_action :fetch_portal, except: [:index, :create]
def index
@portals = Current.account.kbase_portals
end
def create
@portal = Current.account.kbase_portals.create!(portal_params)
end
def update
@portal.update!(portal_params)
end
def destroy
@portal.destroy
head :ok
end
private
def fetch_portal
@portal = current_account.kbase_portals.find(params[:id])
end
def portal_params
params.require(:portal).permit(
:account_id, :color, :custom_domain, :header_text, :homepage_link, :name, :page_title, :slug
)
end
end
@@ -18,7 +18,7 @@ class Api::V1::Accounts::LabelsController < Api::V1::Accounts::BaseController
end
def destroy
@label.destroy
@label.destroy!
head :ok
end
@@ -0,0 +1,89 @@
class Api::V1::Accounts::MacrosController < Api::V1::Accounts::BaseController
before_action :fetch_macro, only: [:show, :update, :destroy, :execute]
before_action :check_authorization, only: [:show, :update, :destroy, :execute]
def index
@macros = Macro.with_visibility(current_user, params)
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)
@macro.actions = params[:actions]
render json: { error: @macro.errors.messages }, status: :unprocessable_entity and return unless @macro.valid?
@macro.save!
process_attachments
@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)
@macro.set_visibility(current_user, permitted_params)
process_attachments
@macro.save!
rescue StandardError => e
Rails.logger.error e
render json: { error: @macro.errors.messages }.to_json, status: :unprocessable_entity
end
end
def execute
::MacrosExecutionJob.perform_later(@macro, conversation_ids: params[:conversation_ids], user: Current.user)
head :ok
end
private
def process_attachments
actions = @macro.actions.filter_map { |k, _v| k if k['action_name'] == 'send_attachment' }
return if actions.blank?
actions.each do |action|
blob_id = action['action_params']
blob = ActiveStorage::Blob.find_by(id: blob_id)
@macro.files.attach(blob)
end
end
def permitted_params
params.permit(
:name, :account_id, :visibility,
actions: [:action_name, { action_params: [] }]
)
end
def macros_with_user
permitted_params.merge(updated_by_id: current_user.id)
end
def fetch_macro
@macro = Current.account.macros.find_by(id: params[:id])
end
def check_authorization
authorize(@macro) if @macro.present?
end
end
@@ -0,0 +1,28 @@
class Api::V1::Accounts::Microsoft::AuthorizationsController < Api::V1::Accounts::BaseController
include MicrosoftConcern
before_action :check_authorization
def create
email = params[:authorization][:email]
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 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
render json: { success: false }, status: :unprocessable_entity
end
end
private
def check_authorization
raise Pundit::NotAuthorizedError unless Current.account_user.administrator?
end
end
@@ -0,0 +1,95 @@
class Api::V1::Accounts::PortalsController < Api::V1::Accounts::BaseController
include ::FileTypeHelper
before_action :fetch_portal, except: [:index, :create, :attach_file]
before_action :check_authorization
before_action :set_current_page, only: [:index]
def index
@portals = Current.account.portals
end
def add_members
agents = Current.account.agents.where(id: portal_member_params[:member_ids])
@portal.members << agents
end
def show
@all_articles = @portal.articles
@articles = @all_articles.search(locale: params[:locale])
end
def create
@portal = Current.account.portals.build(portal_params)
@portal.custom_domain = parsed_custom_domain
@portal.save!
process_attached_logo
end
def update
ActiveRecord::Base.transaction do
@portal.update!(portal_params) if params[:portal].present?
# @portal.custom_domain = parsed_custom_domain
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
end
end
def destroy
@portal.destroy!
head :ok
end
def archive
@portal.update(archive: true)
head :ok
end
def process_attached_logo
blob_id = params[:blob_id]
blob = ActiveStorage::Blob.find_by(id: blob_id)
@portal.logo.attach(blob)
end
def attach_file
file_blob = ActiveStorage::Blob.create_and_upload!(
key: nil,
io: params[:logo].tempfile,
filename: params[:logo].original_filename,
content_type: params[:logo].content_type
)
render json: { blob_key: file_blob.key, blob_id: file_blob.id }
end
private
def fetch_portal
@portal = Current.account.portals.find_by(slug: permitted_params[:id])
end
def permitted_params
params.permit(:id)
end
def portal_params
params.require(:portal).permit(
:account_id, :color, :custom_domain, :header_text, :homepage_link, :name, :page_title, :slug, :archived, { config: [:default_locale,
{ allowed_locales: [] }] }
)
end
def portal_member_params
params.require(:portal).permit(:account_id, member_ids: [])
end
def set_current_page
@current_page = params[:page] || 1
end
def parsed_custom_domain
domain = URI.parse(@portal.custom_domain)
domain.is_a?(URI::HTTP) ? domain.host : @portal.custom_domain
end
end
@@ -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
@@ -1,6 +1,7 @@
class Api::V1::Accounts::TeamMembersController < Api::V1::Accounts::BaseController
before_action :fetch_team
before_action :check_authorization
before_action :validate_member_id_params, only: [:create, :update, :destroy]
def index
@team_members = @team.team_members.map(&:user)
@@ -45,4 +46,10 @@ class Api::V1::Accounts::TeamMembersController < Api::V1::Accounts::BaseControll
def fetch_team
@team = Current.account.teams.find(params[:team_id])
end
def validate_member_id_params
invalid_ids = params[:user_ids].map(&:to_i) - @team.account.user_ids
render json: { error: 'Invalid User IDs' }, status: :unauthorized and return if invalid_ids.present?
end
end
@@ -18,7 +18,7 @@ class Api::V1::Accounts::TeamsController < Api::V1::Accounts::BaseController
end
def destroy
@team.destroy
@team.destroy!
head :ok
end

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