Commit Graph

2111 Commits

Author SHA1 Message Date
Pranav
9de8c27368 feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722)
Due to the pattern `**/specs/*.spec.js` defined in CircleCI, none of the
frontend spec in the folders such as
`specs/<domain-name>/getters.spec.js` were not executed in Circle CI.

This PR fixes the issue, along with the following changes: 
- Use vitest instead of jest
- Remove jest dependancies
- Update tests to work with vitest

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2024-07-10 08:32:16 -07:00
wudi
9498d1f003 fix: Localize 'Social Profiles' text in ContactForm (#9745) 2024-07-09 22:16:45 -07:00
Sivin Varghese
6ae606c981 fix: Custom snooze is not working in mobile view (#9717)
# Pull Request Template

## Description

Currently, when a user navigates to a chat and attempts to access the
custom snooze modal, it is not visible, making it unable to set custom
snooze options. With this fix, the custom snooze modal will correctly
display even when a chat is open in mobile view.

**Cause of this issue**
The `<custom-snooze-modal/>` component is added to the `<chat-list/>`
component. To accommodate small screen views, we are using the expanded
view. However, if we open a chat and select the custom snooze option
from the chat header in the message view, the `<custom-snooze-modal/>`
component is hidden in the `<chat-list/>` component.

**Solution**
So, I moved the `<custom-snooze-modal/>` to the wrapper component
`<conversation-view/>` so we can use in all cases like,
1. Right-click to custom snooze
2. CMD bar custom snooze
3. Small screen custom snooze
2024-07-04 13:13:03 +05:30
Sojan Jose
cc4851b19d chore: Move frontend authorization to permission based system (#9709)
We previously relied on user roles to determine whether to render
specific routes in our frontend components. A permissions-based model is replacing this approach.


Follow up: #9695

Co-authored-by: Pranav <pranavrajs@gmail.com>
2024-07-03 15:13:16 -07:00
Shivam Mishra
5520bf68f3 feat: disable scripts on password reset page (#9693) 2024-07-01 11:11:57 +05:30
Sivin Varghese
2c94c89077 feat: Add video message viewer in agent widget bubble (#9691)
Fixes https://linear.app/chatwoot/issue/CW-3384/video-message-display-issue
2024-06-28 12:51:27 -07:00
Sivin Varghese
8f3234cf4b feat: Add video message viewing in to the user bubble in widget (#9642) 2024-06-26 13:21:41 -07:00
Clairton Rodrigo Heinzen
96f4f50d2d feat: Add the ability to un-assign teams using automation (#9668)
Co-authored-by: Pranav <pranavrajs@gmail.com>
2024-06-26 12:40:36 -07:00
Pranav
ef606204a2 fix: Temporarily fix text/plain email rendering (#9653)
This is hacky fix for plain text email rendering. The issue happens only
for the text/plain only emails. If there was an HTML component, then the
rendering works fine.

**How was this tested?**

Mac Email client allows you to send text/plain emails. I've sent one to
myself and imported it on Chatwoot. I've also verified that the email
contains only text/plain part.

Sample rendered email below.

<img width="476" alt="Screenshot 2024-06-18 at 8 15 10 PM"
src="https://github.com/chatwoot/chatwoot/assets/2246121/0c3c07f6-c49d-401a-bba5-a79e82b57bd6">

Fixes https://github.com/chatwoot/chatwoot/issues/9649
Fixes https://github.com/chatwoot/chatwoot/issues/9480
2024-06-18 21:10:41 -07:00
Shivam Mishra
08516e6c43 feat: Enable gmail channel (#9622)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2024-06-13 13:01:05 +05:30
Sivin Varghese
9689bbf0dd feat: Adds the ability to disable the "new message notification" popup (#9594) 2024-06-11 08:14:58 +05:30
Shivam Mishra
da4b75a3af feat: add Google login flow and inbox creation (#9580)
This PR adds the following changes

1. Refactor `microsoft/callbacks_controller` to move common logic to
`oauth_callback_controller`, most of the logic is re-used for Google
2. Add UI components, `googleClient` and I18n entries for Google login
3. Add Google callback and inbox creation
4. Add a `joinUrl` utility along with specs (need to move it to utils)
5. Add `GoogleConcern`, `Google::AuthorizationsController` and
`Google::CallbacksController`

> Note: The UI is hidden for now, so we can merge this without any
hiccups, to enable it just revert the commit `05c18de`

### Preview


https://github.com/chatwoot/chatwoot/assets/18097732/1606d150-4561-49dc-838d-e0b00fe49ce3

### Linear Tickers

[CW-3370](https://linear.app/chatwoot/issue/CW-3370)
[CW-3371](https://linear.app/chatwoot/issue/CW-3371)

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2024-06-07 16:37:46 +05:30
Pranav
76efe3c5c3 fix: Update the suspended page to show the chat bubble (#9604)
- This PR updates the implementation of chat bubble on suspended account.
2024-06-06 16:39:39 -07:00
Muhsin Keloth
f452565d13 feat: Add search support for drop downs in create linear issue (#9566)
Co-authored-by: iamsivin <iamsivin@gmail.com>
2024-06-05 16:40:10 +05:30
Muhsin Keloth
839f7fe719 fix: Reset loader state on error (#9597)
- Replace `showAlert` with `showAlertMessage` in auth related pages.
2024-06-05 16:07:44 +05:30
Fayaz Ahmed
88e4d9f06f fix: Missing mitt.js in vue 3 instance of app (#9596) 2024-06-05 15:15:25 +05:30
Fayaz Ahmed
bff19eb2e6 feat: Make context meny visible only on hover (#9592) 2024-06-05 11:13:16 +05:30
Fayaz Ahmed
00ef9c475f fix: Replace the bus events with emitter in widget (#9584)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2024-06-03 16:36:15 +05:30
Sivin Varghese
af90f21cfd feat: Reconnect logic (#9453)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
2024-06-03 15:54:19 +05:30
Shivam Mishra
00da2ac847 fix: locales settings on portal (#9583)
The previous changes made on Portal locales introduced a bug where users
were not able to set the default locale, this PR fixes that
2024-06-03 14:56:53 +05:30
Pavel Kuzmin
803471e42f fix: browser info (#9569)
# Pull Request Template

## Description

fixed getting browser data

In Vue, without computed properties, the data doesn't update, and
because of this, it doesn't display information about the browser.

## Type of change

Please delete options that are not relevant.

- [x] 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 not to work as expected)
- [ ] This change requires a documentation update

## Checklist:

- [x] My code follows the style guidelines of this project
- [x] 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
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream
modules
2024-06-02 19:06:10 +05:30
Shivam Mishra
ae35b47ae3 fix: Add the translation for Sign in with Microsoft button (#9567)
The sign in button for Microsoft inbox was not translated, this PR fixes it
2024-05-31 09:01:50 -07:00
Fayaz Ahmed
b474929f5e chore: Replace eventBus with mitt.js [CW-3275] (#9539)
# Replace the deprecated `eventBus` with mitt.js

## Description

Since eventBus and it's respective methods are deprecated and removed
from all future releases of vue, this was blocking us from migrating.
This PR replaces eventBus with
[mitt](https://github.com/developit/mitt). I have created a wrapper
mitt.js to simulate the same old event names so it's backwards
compatible, without making a lot of changes.


Fixes # (issue)

## Type of change

Please delete options that are not relevant.

- [x] 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 not to work as expected)
- [ ] This change requires a documentation update

## How Has This Been Tested?

1. Made sure all the places we're listening to bus events are working as
expected.
2. Respective specsf or the events from mitt.


## Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [x] I have commented on my code, particularly in hard-to-understand
areas
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [x] Any dependent changes have been merged and published in downstream
modules
2024-05-31 15:50:36 +05:30
Sivin Varghese
e3eca47c31 feat: Split reconnect logic PR (store) (#9520)
# Pull Request Template

## Description

This PR includes store filter parts split from this [Reconnect
PR](https://github.com/chatwoot/chatwoot/pull/9453)
2024-05-30 12:29:55 +05:30
Shivam Mishra
6c682a6869 feat: add reauthorization banner for Facebook (#9553) 2024-05-30 09:41:04 +05:30
Sivin Varghese
41e27e95b4 fix: TypeError cannot read properties of undefined (reading 'name') (#9562) 2024-05-29 22:04:30 +05:30
Sivin Varghese
b31be37dc2 fix: TypeError undefined is not an object (evaluating 'this.features.inbound_emails') (#9563) 2024-05-29 21:31:37 +05:30
Muhsin Keloth
a55fffab3a chore: Linear integration fixes (#9538) 2024-05-29 11:28:13 +05:30
Sivin Varghese
eb6a343810 fix: Enable edit option for custom attributes if value is present (#9543)
# Pull Request Template

## Description

This PR will enable a back edit option for custom attributes if there is
the value present, which is removed by this
[PR](https://github.com/chatwoot/chatwoot/pull/9070/files#diff-fe9b82bbef1da31faa513332ed6015c0ed23765a6368832137a5408547da8938R172)

Fixes
https://linear.app/chatwoot/issue/CW-3345/edit-attribute-does-not-work-anymore

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## How Has This Been Tested?

**Screenrecordings**

**Before**



https://github.com/chatwoot/chatwoot/assets/64252451/ab89e087-d919-404d-90a9-17982b425dc3



**After**


https://github.com/chatwoot/chatwoot/assets/64252451/98d8b0b2-2f8f-46ec-ace5-b3e2a721623e



## Checklist:

- [x] My code follows the style guidelines of this project
- [x] 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
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream
modules
2024-05-28 12:05:34 +05:30
Fernando Verdugo
4a3376e912 fix(typo): Update bulkActions.json (#9540) 2024-05-24 08:51:36 -07:00
Shivam Mishra
eafd3ae44d feat: new re-authorization flow for Microsoft (#9510)
This PR adds a cleaner re-authorization flow to Microsoft. This PR has
the following changes

1. Use `reauthorization_required` value for Microsoft Channel
2. Refactor `InboxReconnectionRequired` to reuse the `banner` component
3. Refactor `microsoft/Reauthorize.vue` to reuse
`InboxReconnectionRequired` component
4. Update `reauthorizable.rb` to update cache keys if the model has an
inbox
5. Update `microsoft/callbacks_controller.rb` to handle the
reauthorization case with a redirect to the inbox settings page if the
inbox already exists at the time of authorization.

## How Has This Been Tested?

- [x] Local Instance
- [ ] Staging Instance
- [x] Unit tests

## Pending Tasks

- [ ] ~Success Toast~ will do this in a follow-up PR with the screen

## Demo

The following video shows the whole process of creation and
re-authorization of the Microsoft channel


https://www.loom.com/share/e5cd9bd4439c4741b0dcfe66d67f88b3?sid=100f3642-43e4-46b3-8123-88a5dd9d8509

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2024-05-23 16:03:40 +05:30
Muhsin Keloth
f83af33b87 feat: Add title while linking the linear issue (#9529) 2024-05-23 13:32:41 +05:30
Shivam Mishra
9f625715ab fix: Cannot read properties of undefined (reading 'toLowerCase') (#9511)
Tried to replicate the issue, but Sentry didn't have enough information.
`toggleMessageSignature` is a user triggered action in
`ReplyBottomPanel.vue`, the value for `channelType` is provided from
`inboxMixin`. The error will occur if either `inbox` is an empty object
`{}` or `channel_type` in `inbox` object is undefined.

I couldn't find any instance where this could be the case. The PR has a
stop gap solution that ensures that no action is triggered
2024-05-23 12:08:04 +05:30
Muhsin Keloth
35508feaae feat: Linear front end (#9491)
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
Co-authored-by: iamsivin <iamsivin@gmail.com>
2024-05-23 11:58:24 +05:30
Sivin Varghese
be97c68721 fix: TypeError cannot read properties of undefined (reading 'status') (#9505) 2024-05-23 11:22:14 +05:30
Sivin Varghese
4b93738462 fix: Space key in input closing dropdown (#9525) 2024-05-23 10:40:44 +05:30
Muhsin Keloth
023b3ad507 feat: Add APIs for linear integration (#9346) 2024-05-22 13:37:58 +05:30
Sivin Varghese
0d13c11c44 fix: Right click Snooze is not working (#9498) 2024-05-22 13:03:49 +05:30
Pranav
7a1a686133 fix: Fix typo in the font for portals (#9515)
The fonts on the portal were not loaded properly before due to a typo in
the stylesheet. The font that is shown on the public portal is ui-sans
right now. This PR fixes it.
2024-05-21 13:35:35 -07:00
Sivin Varghese
00dca9466a feat: Move the SLA filter dropdown to UI folder (#9502)
# Pull Request Template

## Description

I moved the newly created SLA filter dropdown to the UI folder to use in
adding the Linear issue modal.
2024-05-20 16:23:42 +05:30
Shivam Mishra
e9831b8855 feat: add inbox reconnection banner (#9441)
![CleanShot 2024-05-09 at 12 44
07@2x](https://github.com/chatwoot/chatwoot/assets/18097732/2b2861d4-ddcb-481a-b411-f553c19ff573)

![CleanShot 2024-05-09 at 12 44
36@2x](https://github.com/chatwoot/chatwoot/assets/18097732/9cdb8213-acce-4499-a72b-1feba2b611a6)

---------

Co-authored-by: Fayaz Ahmed <fayazara@gmail.com>
2024-05-20 11:57:03 +05:30
Sivin Varghese
a83b609025 fix: New account button style in switch account modal (#9456) 2024-05-16 22:33:43 +05:30
Chatwoot Bot
b0b4668d23 chore: Update translations (#9439)
- update translations from crowdin
2024-05-15 21:52:30 -07:00
Sivin Varghese
5657473573 fix: Dashboard phone number input country undefined in onSelectCountry (#9473)
# Pull Request Template

## Description

This PR will fix this sentry
[issue](https://chatwoot-p3.sentry.io/issues/5291039795/)

**Issue**
The root cause of this issue is the usage of
`keyboardEventListenerMixins`. The key events are always active when the
edit conversation modal is active, even if the country dropdown is not
visible. So, if we press the enter key, this error will be thrown into
the console.

**Solution**
Remove the use of `keyboardEventListenerMixins` and handle it directly
in the Vue native key events. Also, always check if the dropdown is
active.

**Other changes**
1. Remove the `mouseup` event lister and use the click away directive.
2. Use inline Tailwind css


Fixes
https://linear.app/chatwoot/issue/CW-3282/phonenumberinput-country-undefined-in-onselectcountry

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## How Has This Been Tested?

**Steps**
1. Open a conversation.
3. And click the edit contact button
4. And click the enter key
5. Now you can see the error in the console


## Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [x] I have commented on my code, particularly in hard-to-understand
areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream
modules
2024-05-16 09:16:02 +05:30
Pranav
ae5ef73e91 fix: Update the voice note format to MP3 to fix the delivery issues (#9448)
Use MP3 as the default format to send voice notes recorded from
Chatwoot. This change was made to fix the issue of Telegram voice notes
not working with the error `WEBPAGE_CURL_FAILED` .

Telegram treats the mp3 recordings as audio attachments. Once we can
identify a fix for the original issue, we will revisit the `ogg`
implementation.

---------

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2024-05-15 17:53:45 -07:00
Sojan Jose
7ed375f6f5 chore: Show valid error messages on Inbox creation (#9474)
At the moment, when creating an inbox for Whatsapp, Telegram, etc., we show a generic error message saying that inbox creation failed. This PR will show the error messages directly from the API call, which is more helpful as it says if the error is due to the provided credentials.
2024-05-15 15:53:41 -07:00
Shivam Mishra
bc8736c08e fix: widget does not load when navigating on pages with view transition [CW-3249] (#9443)
* feat: add ids to each element

* feat: restore elements for apps that use view transitions

* fix: remove generator check condition

* feat: handle turbolinks

* fix: new body handling

* chore: undo debug changes
2024-05-15 10:45:03 +05:30
Sivin Varghese
5a289776de fix: Widget phone number input country undefined in onSelectCountry (#9457)
* fix: Widget phone number input country undefined in onSelectCountry

* chore: Minor fix
2024-05-15 09:48:55 +05:30
Shivam Mishra
a4001374a5 feat: add missing clickaway directives (#9451)
* feat: add onClickaway to widget

* feat: add clickaway to portal

* feat: add directive to PublicArticleSearch
2024-05-10 11:15:36 +05:30
Shivam Mishra
05f0398b86 fix: Update message signature default value (#9446) 2024-05-09 10:55:30 -07:00