Sojan Jose
4e28481f27
feat: Conversation API to return applied_sla and sla_events ( #9174 )
...
* chore: Add sla_events to push_event_data
* chore: Return SLA details in the API
* chore: feature lock sla push event data
* Update _conversation.json.jbuilder
* chore: rubocop fixes
2024-04-01 23:30:07 +05:30
Vishnu Narayanan
16282f6a66
feat: Add push/email notification support for SLA ( #9140 )
...
* feat: update SLA evaluation logic
* Update enterprise/app/services/sla/evaluate_applied_sla_service.rb
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com >
* chore: refactor spec to bring down expecations in a single block
* chore: fix process_account_applied_sla spec
* chore: add spec to test multiple nrt misses
* feat: persist sla notifications
* feat: revert persist sla notifications
* feat: add SLA push/email notification support
* chore: refactor sla_status to include active_with_misses
* chore: add support for sla push/email notifications
* chore: refactor
* chore: add liquid templates
* chore: add spec for liquid templates
* chore: add spec for sla email notifications
* chore: add spec for SlaPolicyDrop
* chore: refactor to ee namespace
* chore: set enterprise test type to mailer
* feat: enable sla notification settings only if SLA enabled
* chore: refactor
* chore: fix spec
---------
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com >
2024-03-29 20:27:21 +11:00
Vishnu Narayanan
6956436a76
feat: refactor SLA evaluation logic ( #9133 )
...
* feat: update SLA evaluation logic
* chore: handle nrt
* chore: handle applied_sla status
* chore: refactor spec to bring down expecations in a single block
* chore: fix process_account_applied_sla spec
* chore: add spec to test multiple nrt misses
* feat: persist sla notifications
* feat: revert persist sla notifications
* chore: refactor sla_status to include active_with_misses
* chore: refactor spec
* Update evaluate_applied_sla_service.rb
* minor refactors
* clean up
* move notification related spec
* chore: refactor notifications spec to sla_event model
---------
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com >
Co-authored-by: Sojan Jose <sojan@pepalo.com >
2024-03-29 02:01:43 +11:00
Shivam Mishra
9a1c54a82d
feat: disable automation rules if condition fails multiple times ( #9017 )
...
* feat: add email for disabling automation rule
* feat: disable automation rules and notify admin
* feat: reset error count after update
* feat: trigger invalid_condition_error if rule is invalid
* feat: setup error trackable concern
* refactor: use ErrorTrackable in Reauthorizable
* fix: optional argument
* feat: separate reauthorization_required_key
* test: update case to use ERROR_TRACKABLE_COUNT
* Revert "test: update case to use ERROR_TRACKABLE_COUNT"
This reverts commit f439847147556a02759a7597a7fcf1d66091cafc.
* Revert "feat: separate reauthorization_required_key"
This reverts commit f4514fce217b0a2f2c2bf701a15de0a8b47acbc4.
* Revert "fix: optional argument"
This reverts commit 93b4194ec3f10f67e2402388c966c071c4d3b4fd.
* Revert "refactor: use ErrorTrackable in Reauthorizable"
This reverts commit 513c2a522bc782e73ea4b0f5ae34ce01e70e042c.
* Revert "feat: setup error trackable concern"
This reverts commit 278683060cf422f60af5d5c77100aa5272141141.
* feat: use reauthorizable for automation rule
* feat: remove redis key
* test: fix method names
* chore: refactor
---------
Co-authored-by: Vishnu Narayanan <iamwishnu@gmail.com >
Co-authored-by: Sojan <sojan@pepalo.com >
2024-03-28 13:14:16 +05:30
Shivam Kumar
1253264382
fix: Avoid duplicate invitation emails when adding an agent ( #9131 )
...
Co-authored-by: Sojan <sojan@pepalo.com >
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com >
Co-authored-by: Pranav <pranav@chatwoot.com >
2024-03-26 18:58:45 -07:00
Shivam Mishra
d1dd319091
feat: API to download breached conversations ( #9150 )
...
* feat: add download conversations endpoint
* feat: template for conversation list download
* feat: setup download API and tests
* chore: revert formatting change
* feat: rename download method
* feat: rename template
* feat: include sla_policy table in download query
* refactor: add nil safety to assignee
* chore: Update en.yml
* fix: remove applied_sla relation
2024-03-26 09:22:49 +05:30
Muhsin Keloth
48452a42f4
feat: Add SLA metrics API ( #9132 )
2024-03-25 12:24:43 +05:30
Sojan Jose
1303469087
feat: Ability filter blocked contacts ( #9048 )
...
- This PR introduces the ability to filter blocked contacts from the contacts filter UI
2024-03-20 18:11:50 +05:30
Pranav
f78f278e2f
fix: Update validations for filter service ( #8239 )
...
- Refactor filter service for better readability and maintenance
- Add validations for the following:
- If an invalid attribute is passed, a custom exception InvalidAttribute will be thrown.
- If an invalid operator is passed, a custom exception InvalidOperator will be thrown.
- If an invalid value (currently checking only null check), a custom exception InvalidValue will be thrown.
Fixes: https://linear.app/chatwoot/issue/CW-2702/activerecordstatementinvalid-pginvalidtextrepresentation-error-invalid
Fixes: https://linear.app/chatwoot/issue/CW-2703/activerecordstatementinvalid-pginvaliddatetimeformat-error-invalid
Fixes: https://linear.app/chatwoot/issue/CW-2700/activerecordstatementinvalid-pgsyntaxerror-error-syntax-error-at-or
Co-authored-by: Sojan <sojan@pepalo.com >
2024-03-20 16:29:36 +05:30
Vishnu Narayanan
b017d05ed9
feat: add sla events table ( #9126 )
...
* feat: add sla events table
* chore: refactor to EE namespace
* chore: refactor
* chore: fix spec
* chore: add references to account,inbox,sla_policy
* chore: update specs
* chore: update spec to check backfilling id's
* Update spec/enterprise/models/sla_event_spec.rb
2024-03-20 11:59:37 +05:30
Sivin Varghese
476077ab84
fix: Update location component to avoid overflow, handle location title from Telegram payload ( #9113 )
...
Co-authored-by: Pranav <pranav@chatwoot.com >
2024-03-14 22:53:43 -07:00
Muhsin Keloth
586552013e
feat: Update the contact_type when creating or updating the contact ( #9107 )
...
* feat: Update location and country code when the contact create/update
* feat: Update the location and country_code when creating or updating the contact.
* chore: improve comments
* feat: Update the contact_type when the contact created/updated
* chore: add more specs
* chore: code cleanups
* chore: code cleanups
* Update contact_spec.rb
* Update inbox.rb
* Update sync_attributes_spec.rb
* chore: build fixes
* chore: check visitor type before update
* chore: review fixes
2024-03-15 10:55:40 +05:30
Sojan Jose
3dae3ff3ad
feat: Conversation update API for sla_policy_id ( #8973 )
...
- Add an endpoint for updating conversation attributes (priority / sla_policy_id )
- Swagger spec
- minor chores around the conversation API/spec
Fixes: https://linear.app/chatwoot/issue/CW-2100/feat-backend-api-to-update-the-sla-of-a-conversation
2024-03-14 17:22:32 +05:30
Vishnu Narayanan
7f4b2d66d4
feat: add activity message for SLA ( #9100 )
...
* feat: add activity message for SLA
* chore: refactor to reduce method complexity
* chore: refactor
* feat: add spec for SLAactivity message
* chore: move SLA spec to enterprise folder
* chore: move team activity methods to a separate module
* chore: fix typo
* chore: move sla activity message spec to conversation model
2024-03-13 20:05:34 +05:30
Muhsin Keloth
804a42c271
feat: Update the location and country_code when creating or updating the contact ( #9106 )
...
* feat: Update the location and country_code when creating or updating the contact.
* chore: improve comments
2024-03-13 16:40:21 +05:30
Vishnu Narayanan
aaf70cf1cf
feat: add push notification when SLA missed ( #9078 )
...
* feat: add push notification when SLA missed
* chore: sent notification only for inbox members
* feat: add conv particpants+admins to SLA notification list
* chore: add spec to ensure notification is created
* chore: refactor to multiple alerts for SLA conditions
* chore: add sla_policy as secondary_actor in notification
2024-03-11 21:49:41 +05:30
Muhsin Keloth
216de4d123
fix: Conversation assignment notification title ( #9071 )
2024-03-06 23:05:13 +05:30
Muhsin Keloth
ef90b7a3d8
feat: Revamp the notification title and content ( #8988 )
2024-03-06 20:51:56 +05:30
Muhsin Keloth
58dd2633ba
feat: Add contact helper ( #8989 )
2024-03-06 17:39:39 +05:30
Shivam Mishra
c62c512ec4
fix: inline attachments not handled if tag was missing ( #9068 )
2024-03-06 17:15:29 +05:30
Sojan Jose
881d4bf644
feat: Add backend APIs for the bot metrics ( #9031 )
...
Co-authored-by: Pranav <pranav@chatwoot.com >
2024-03-01 08:20:20 -08:00
Sojan Jose
41e269e873
feat(ee): Add reporting events for bots ( #9027 )
...
Added a new event conversation_bot_resolved and added a job to auto resolve the bot conversations if there was no activity for the last 1 hour.
2024-02-27 14:53:28 -08:00
Sojan Jose
ae4c8d818f
feat: Ability to block contacts permanently ( #8922 )
...
Co-authored-by: Pranav <pranav@chatwoot.com >
2024-02-21 14:18:42 -08:00
Shivam Mishra
c031cb19d2
fix: downcase email before finding ( #8921 )
...
* fix: downcase email when finding
* feat: add `from_email` class
* refactor: use `from_email`
* feat: add rule to disallow find_by email directly
* chore: remove redundant test
Since the previous imlpmentation didn't do a case-insentive search, a new user would be created, and the error would be raised at the DB layer. With the new changes, this test case is redundant
* refactor: use from_email
2024-02-21 18:51:00 +05:30
CristianDuta
ebae547a60
feat: Add ability to resolve API channel conversations ( #8348 )
...
- Create a new endpoint to fetch a single conversation in client apis
- Create a new endpoint to resolve a single conversation in client apis
- Update swagger API definition to include missing endpoints
Fixes : #6329
Co-authored-by: Cristian Duta <Cristian.Duta@ti8m.ch >
2024-02-21 17:41:20 +05:30
Vishnu Narayanan
d53097f77d
fix: Raise error if email to_header is invalid ( #8688 )
2024-02-20 17:03:39 -08:00
Vishnu Narayanan
23230e0143
feat: sla-7 ensure applied_sla uniqueness ( #8938 )
...
* feat: refactor fetching sla in action service
* chore: modify spec
* chore: ensure applied_sla uniqueness
* chore: review fixes
* feat: add unique index on applied_sla
* chore: fix spec
* chore: add new specs to improve coverage
* chore: improve spec
* Update spec/enterprise/services/enterprise/action_service_spec.rb
---------
Co-authored-by: Sojan Jose <sojan@pepalo.com >
2024-02-20 21:59:49 +05:30
Vishnu Narayanan
f92cea144c
feat(perf): sla-9 improve perf of TriggerSlasForAccountsJob ( #8953 )
...
* feat: improve perf of TriggerSlasForAccountsJob
2024-02-20 21:54:37 +05:30
Muhsin Keloth
e6cf8c39b7
feat: Update last_snoozed_at after the un-snooze notification ( #8943 )
2024-02-20 18:55:39 +05:30
Muhsin Keloth
c5c0845151
feat: Add labels, status and priority in notification push_event_data ( #8972 )
2024-02-20 17:17:25 +05:30
Liam
5d9fb55370
feat: Export contact improvements ( #8895 )
...
This pull request enhances the export contacts feature by adding a confirmation step before exporting. Previously, clicking the export button would trigger the export action without confirmation.
Additionally, it ensures that only the intended recipient receives the export email, addressing the previous behaviour where all administrators received it.
Fixes : #8504
Co-authored-by: Sojan Jose <sojan@pepalo.com >
2024-02-20 17:11:03 +05:30
Nithin David Thomas
721a2f5052
feat: API changes to support multi step user signup ( #8933 )
...
-API Changes to support the new onboarding flow
Co-authored-by: Sojan <sojan@pepalo.com >
2024-02-20 16:48:51 +05:30
Sojan Jose
978a8a4cb2
fix: support_email and inbound_email_domain returning empty string ( #8963 )
...
chore: Fix for inbound email domain being nil
2024-02-19 15:43:35 +05:30
Muhsin Keloth
cd06b2b337
fix: Inbox view Read/Snoozed display filters ( #8907 )
...
* fix: Notification filters
* Update notification_finder.rb
* Update notification_finder.rb
* Update notification_finder.rb
* fix: spec
* fix: specs
* Update notification_finder.rb
* fix: add more fixes
* Update notification_finder.rb
* fix: specs
* chore: better comments
* chore: removed filtering
* chore: refactoring
* fix: review fixes
* fix: API call
* chore: Minor fix
* Rename spec
* Fix params getting undefined
* Fix finder
---------
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com >
Co-authored-by: iamsivin <iamsivin@gmail.com >
Co-authored-by: Pranav <pranav@chatwoot.com >
2024-02-17 13:59:25 +05:30
Sojan Jose
94892e7168
chore: Fix flaky spec relying on unguaranteed order ( #8956 )
2024-02-16 12:11:39 -08:00
Muhsin Keloth
fe744abe26
fix: Mark notification as unread after the un-snooze ( #8917 )
2024-02-16 17:30:54 +05:30
Sojan Jose
9c07b6dd46
chore: Support for updated_within in ConverationFinder ( #8947 )
...
- `updated_within' accepts value in seconds and returns all conversations updated in the given period with out pagination. This API will assist in our refetch logic on socket disconnect
ref: #8888
2024-02-16 16:44:55 +05:30
Pranav Raj S
1ce5cbe275
feat: Add endpoints to retrieve summary of team/agents over a period of time ( #8916 )
...
- Internal APIs to prototype reporting improvements.
2024-02-13 15:44:40 +05:30
Pranav Raj S
c607f09be0
feat: Improve the rendering of CSV exports ( #8914 )
...
Improve the rendering of the datestamp
2024-02-12 20:01:58 -08:00
Shivam Mishra
e662336eaf
feat: handle already invited user ( #8912 )
2024-02-13 08:51:42 +05:30
Shivam Mishra
657843960c
feat: account onboarding with clearbit ( #8857 )
...
* feat: add clearbit lookup
* chore: fix typo in .env.example
* refactor: split lookup to reduce cognitive complexity
* feat: add more fields to lookup
* feat: extend accounts controller
* feat: save extra data to custom_attributes
* feat: allow v2 update with custom_attributes
* feat: add update route
* refactor: reduce complexity
* feat: move update to v1 controller
* test: add locale test
* feat: remove update from routes
* test: update API for custom attributes
* test: all custom attributes
* fix: v2 tests
* test: enterprise accounts controller
* fix: clearbit payload
* fix: with modified env
* feat: allow custom attributes updates to profile
* refactor: reduce complexity
* feat: allow clearbit api key in installation config
* refactor: move clearbit to internal
* feat: allow clearbit
* chore: add display_title for June
* feat: allow more internal options
* refactor: use globalconfig to fetch clearbit token
* test: move response body to a factory
* refactor: update ops
* chore: remove clearbit from .env.example
* chore: apply suggestions from code review
Co-authored-by: sojan-official <sojan@chatwoot.com >
---------
Co-authored-by: sojan-official <sojan@chatwoot.com >
2024-02-12 23:21:42 +05:30
giquieu
227d99934e
feat: Agent bot cant assign conversations to teams ( #8015 )
...
Implemented so that the API can process priority and agent/team changes per Agent Bot.
Fixes: #7474
Co-authored-by: Sojan Jose <sojan@pepalo.com >
2024-02-12 15:51:22 +05:30
Vishnu Narayanan
5036b28e45
chore: fix git_sha in instance health ( #8893 )
...
- Fix git-hash in super admin instance health page for Heroku installations
- Fix git boundary not set error for docker/heroku deployments which remove .git directory
2024-02-12 14:33:15 +05:30
Pranav Raj S
eb379e1849
fix(refactor): Cleanup the specs and the logic for FetchIMAP job ( #8766 )
2024-02-10 14:03:50 -08:00
Vishnu Narayanan
c1d07a5471
feat: Add sidekiq jobs to monitor applied SLAs ( #8828 )
...
Fixes: https://linear.app/chatwoot/issue/CW-2983/sidekiq-jobservice-to-monitor-sla-breach
Co-authored-by: Sojan <sojan@pepalo.com >
2024-02-07 21:44:56 +04:00
Jatin
98eddd0532
fix: Send push notification on bot_handoff ( #7636 )
...
Send a 'Conversation Created' push notification when the bot does a hand_off.
fixes : #7587
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com >
2024-02-07 17:45:08 +04:00
Muhsin Keloth
1b21e0d429
feat: Add notification.updated event ( #8871 )
2024-02-07 18:15:51 +05:30
Sojan Jose
7776b74126
chore: Apply fixes for items in rubocop_todo [CW-1806] ( #8864 )
...
This PR addresses several items listed in our rubocop_todo by implementing the necessary corrections and enhancements. As a result, we are now able to remove the rubocop_todo file entirely, streamlining our codebase and ensuring adherence to our coding standards.
fixes: https://linear.app/chatwoot/issue/CW-1806/chore-rubocop-audit
2024-02-07 13:36:04 +04:00
Shivam Mishra
a9ec3ae098
test: ensure that timestamp is in correct range ( #8868 )
...
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com >
2024-02-07 13:35:31 +05:30
Muhsin Keloth
d67b91d2b0
feat: Sort Notification API changes ( #8865 )
...
* feat: Inbox sort API changes
* Update notification_finder.rb
* Update notification_finder.rb
* Update notification_finder.rb
2024-02-06 21:03:22 +05:30