Commit Graph

2901 Commits

Author SHA1 Message Date
Nithin David Thomas
d2aa5f4c69 fix: Reverts popover styling for search page (#6688) 2023-03-20 11:04:56 +05:30
Nithin David Thomas
e76b63f91d chore: Upgrade prosemirror package to fix link rendering issue (#6685) 2023-03-16 13:42:52 -07:00
Muhsin Keloth
5c5764ca85 chore: Enable icelandic language(#6682)
ref: #6681
2023-03-16 20:32:55 +05:30
Tejaswini Chile
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
565b87fa98 Bump version to 2.15.0 2023-03-15 19:57:59 +05:30
Sojan Jose
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
Chatwoot Bot
7331154f04 chore: Update translations
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-03-15 15:23:38 +05:30
Sojan Jose
a99c37ae5e chore: Resolve bundle audit (#6671)
- Update gems to resolve bundle Audit advisories
2023-03-15 14:05:54 +05:30
dependabot[bot]
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 S
eb7070d946 feat(poc): Disable widget based on country (#6658) 2023-03-14 09:09:57 -07:00
Sojan Jose
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 Chile
24f8befdf2 Fix: Add articles order in category show page (#6662) 2023-03-14 20:00:01 +05:30
Sojan Jose
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 Thomas
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 Jose
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 Jose
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 Chile
8f4d4798c2 feat: Backend changes for article and categories ordering (#6655) 2023-03-13 17:39:07 +05:30
Jacson Santos
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 Chile
c9b63ae8eb fix: hook exception for empty hook (#6646) 2023-03-10 16:40:15 +05:30
Tejaswini Chile
f2684545d9 fix: Handle dialogflow hook without setting and credentials (#6638) 2023-03-09 20:11:08 +05:30
Tejaswini Chile
fbdc79df76 Fix: skip invalid access token from sentry (#6639) 2023-03-09 16:28:45 +05:30
Tejaswini Chile
54b7c98795 fix: Warn Facebook error code 100-2018218 (#6632) 2023-03-09 13:51:10 +05:30
Tejaswini Chile
757e1bb1f7 fix: String interpolation (#6635) 2023-03-09 13:50:26 +05:30
Shivam Mishra
4673cf8cf1 fix: timing in the API (#6633)
* fix: timing in the API

* test: fix params
2023-03-09 00:40:38 +05:30
Tejaswini Chile
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
CristianDuta
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 Jose
9bc0f67f54 feat: Add specs for WHATSAPP_CLOUD_BASE_URL env variable (#6630)
ref: #6622
2023-03-08 18:38:54 +05:30
Clairton Rodrigo Heinzen
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
Shivam Mishra
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 Jose
d59fd6b747 chore: Ensure Template messages work even when bot is connected (#6455)
ref: #5592
2023-03-08 18:01:00 +05:30
Sojan Jose
5166fd8948 chore: Update gems (#6628)
- Updating gems based on ruby advisory warnings
2023-03-08 17:40:21 +05:30
Chatwoot Bot
5214be67c7 chore: Update translations
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-03-08 14:00:00 +05:30
GitStart
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 Chile
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
Shivam Mishra
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 Chile
2abc57300c fix: Add a check for automation_created message in FIRST_REPLY_CREATED event (#6618) 2023-03-06 17:47:35 +05:30
Wojtek
9c6eb8b03d chore: Fix the comment in schedule.yml (#6606) 2023-03-03 10:22:25 -08:00
Nithin David Thomas
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
Pranav Raj S
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 Chile
ec04ddc725 Fallback name branch (#6591) 2023-03-03 12:26:59 +05:30
Tejaswini Chile
60fee519bd Exception tracker with account (#6603) 2023-03-03 12:14:44 +05:30
Sivin Varghese
a685e065da fix: Fixes assignee and inbox name spacing issues (#6589) 2023-03-02 22:00:43 +05:30
Tejaswini Chile
a4fc0eef4b fix: Exception tracking for dialogflow bot service (#6593) 2023-03-02 21:33:07 +05:30
Shivam Mishra
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 Jose
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
GitStart
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 S
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 Chile
61d0a63bf7 Fix: product#804: email sender improvement (#6579) 2023-03-02 10:57:14 +05:30
Tejaswini Chile
f1827c82fd Update contact create swagger (#6576) 2023-03-01 20:24:21 +05:30