Commit Graph

938 Commits

Author SHA1 Message Date
Shivam Mishra
c51a458c25 style: apply fixes for eslint issues [cw-3590] (#10210)
These fixes are all auto generated and can be merged directly

Fixes the following issues

1. Event used on components should be hypenated
2. Attribute orders in components
3. Use `unmounted` instead of `destroyed`
4. Add explicit `emits` declarations for components, autofixed [using
this
script](https://gist.github.com/scmmishra/6f549109b96400006bb69bbde392eddf)


We ignore the top level v-if for now, we will fix it later
2024-10-03 15:02:12 +05:30
Shivam Mishra
b8d0252511 feat: remove usage of .sync and define explicitly emits (#10209)
References

- https://v3-migration.vuejs.org/breaking-changes/v-model
-
https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html
2024-10-03 12:44:18 +05:30
Shivam Mishra
b52950ba5a fix: Update event name for reports filter (#10199) 2024-10-02 09:16:23 -07:00
Shivam Mishra
42f6621afb feat: Vite + vue 3 💚 (#10047)
Fixes https://github.com/chatwoot/chatwoot/issues/8436
Fixes https://github.com/chatwoot/chatwoot/issues/9767
Fixes https://github.com/chatwoot/chatwoot/issues/10156
Fixes https://github.com/chatwoot/chatwoot/issues/6031
Fixes https://github.com/chatwoot/chatwoot/issues/5696
Fixes https://github.com/chatwoot/chatwoot/issues/9250
Fixes https://github.com/chatwoot/chatwoot/issues/9762

---------

Co-authored-by: Pranav <pranavrajs@gmail.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2024-10-02 00:36:30 -07:00
Shivam Mishra
a0dddae289 feat: let users re auth legacy google inboxes (#10179)
This PR allows migration of legacy GMail inbox users to new OAuth based
inbox

## How to test?

1. Create an inbox from the seed data and set it's IMAP address to
`imap.gmail.com` from the UI
2. Open `rails console` and run the following

   ```
   inbox = Inbox.find(100) # use your inbox id here
   channel = inbox.channel
   channel.update(email: 'hello@chatwoot.com')
   channel.prompt_reauthorization!
   ```
3. This will show the prompt on the UI. Once you click on Reauthorize,
it should open Google Auth. Reauthroize with the same email address as
used in the inbox and it should start working as usual

### Setting up ENV

```sh
GOOGLE_OAUTH_CLIENT_ID=<some-hash>.apps.googleusercontent.com
GOOGLE_OAUTH_CLIENT_SECRET=<client-secret>
GOOGLE_OAUTH_CALLBACK_URL="http://localhost:3000/omniauth/google_oauth2/callback"
```
2024-09-30 21:48:52 +05:30
Sivin Varghese
f4f2d678cf fix: Show error messages from response (#10173)
This PR fixes the issue where proper error messages from the backend
were not displayed when an email already exists in the system during a
profile update, or when a phone number is already taken for Twilio
during the creation of a new account.

Fixes:
https://linear.app/chatwoot/issue/CW-3560/prod-customer-facing-issue-updating-email
2024-09-26 20:16:39 -07:00
Sojan Jose
58e78621ba chore: Custom Roles to manage permissions [ UI ] (#9865)
In admin settings, this Pr will add the UI for managing custom roles (
ref: https://github.com/chatwoot/chatwoot/pull/9995 ). It also handles
the routing logic changes to accommodate fine-tuned permissions.

---------

Co-authored-by: Pranav <pranavrajs@gmail.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: iamsivin <iamsivin@gmail.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2024-09-17 11:40:11 -07:00
Sivin Varghese
aaab2ac788 fix: Cannot open conversation from contact sidebar. (#10102)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2024-09-13 17:58:23 +05:30
Muhsin Keloth
185a122ec7 fix: Contact filter attribute groups (#10080) 2024-09-06 13:41:48 +05:30
Pranav
f087461abc feat: Update the design for the webhook management page (#10050) 2024-08-29 20:29:27 +05:30
Pranav
3a47b7e3d1 feat(design): Update the design for the custom attribute console (#10049)
This PR continues the design update series, updates the design for the custom attributes management page. This PR improves the interaction in the Add Custom Attribute feature. Now, the attribute model in the add attribute form will default to the currently selected tab.


---------

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2024-08-29 19:06:11 +05:30
Pranav
31e7663258 feat: Update the design for the Inbox management console (#10043)
This is the continuation of the design update PR. This changes the design for the inbox pages.
---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2024-08-29 11:19:32 +05:30
Fayaz Ahmed
3b5f5b41ad chore: Replace campaign mixin with composable [CW-3463] (#9987)
# Pull Request Template

## Description

Repalces campaignMixin and its usage with the new useCampaign mixin

Fixes
https://linear.app/chatwoot/issue/CW-3463/rewrite-campaignmixin-mixin-to-a-composable

---------

Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2024-08-28 00:53:18 +05:30
Fayaz Ahmed
fe5670832a chore: Replace filtersMixin with useFilter composable [CW-3466] (#10036)
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2024-08-27 13:50:25 +05:30
Sivin Varghese
bc6420019f feat: Rewrite automations/methodsMixin to a composable (#9956)
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
2024-08-27 12:30:08 +05:30
Fayaz Ahmed
f82ec3b885 chore: Repalce message formatter mixin with useMessageFormatter [CW-3470] (#9986)
# Pull Request Template

## Description

Replaced the old messageFormatterMixin with a useMessageFormatter
composable
2024-08-27 08:06:51 +05:30
Sivin Varghese
32c25047c4 feat: Rewrite reportMixin to a composable (#10029)
# Pull Request Template

## Description

The PR will replace the usage of `reportMixin` with the help of
`useReportMetrics()` composable.

Fixes
https://linear.app/chatwoot/issue/CW-3450/rewrite-reportmixin-mixin-to-a-composable

**Files updated**
1. dashboard/routes/dashboard/settings/reports/Index.vue
2. dashboard/routes/dashboard/settings/reports/BotReports.vue
3. dashboard/routes/dashboard/settings/reports/ReportContainer.vue
4.
dashboard/routes/dashboard/settings/reports/components/WootReports.vue
5.
dashboard/routes/dashboard/settings/reports/components/ChartElements/ChartStats.vue

## Type of change

- [x] New feature (non-breaking change which adds functionality)

## How Has This Been Tested?

Test the all the reports view.


## 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
- [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
- [ ] Any dependent changes have been merged and published in downstream
modules
2024-08-27 08:00:05 +05:30
Sivin Varghese
7f8d718da3 feat: Rewrite command bar mixin to a composable (#10015)
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
2024-08-26 15:55:59 +05:30
Fayaz Ahmed
7c2353c7d9 chore: Repalce Hook Mixin with useHook composable [CW-3454] (#9994)
# Pull Request Template

## Description

Replace Hook mixin with useHook composable

Fixes # (issue)

## Type of change

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 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.


## Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] 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

---------

Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
2024-08-22 16:48:02 +05:30
Sivin Varghese
c80de24ac1 fix: TypeError Unhandled Promise Rejection: null is not an object (evaluating 'e[Symbol.iterator]') (#10007)
# Pull Request Template

## Description

**Cause of Issue**

The problem was that the `clearSelectedState` action was being
dispatched late in the component lifecycle. By the time it was called,
child components like `ConversationBox` and `MessagesView` had already
been mounted and were trying to access data from a previous conversation
that no longer existed. This resulted in throwing error `TypeError
Unhandled Promise Rejection: null is not an object (evaluating
'e[Symbol.iterator]')` when users navigated from other screens to the
conversation view screen.

**Solution**

I added the `clearSelectedState` dispatch to the `created()` lifecycle
hook for cases where there's no `conversationId` from route props. This
ensures that the state is cleared before any child components are
mounted.


Fixes
https://chatwoot-p3.sentry.io/issues/5707937964/?project=4507182691975168

## Type of change

Please delete options that are not relevant.

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

## How Has This Been Tested?

**Steps to reproduce**
1. Navigate to chat list screen and open the console.
2. Open any chat, wait to load the messages and stay in conversation
view screen.
3. Then navigate to contact or any other view from primary sidebar. 
4. Then back to chat list view. 
5. Now you can see this error in console.

**Before**

https://www.loom.com/share/193aaf1d1926479982a192dfb06a8764?sid=3f9ee000-d6a0-47cc-a49f-0050d2c64bbf

**After**

https://www.loom.com/share/3d88cfd5e7744958bc5856dd601ee6c4?sid=0e07a5d0-e461-4a1a-914b-e49f669422f5

## 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-08-22 16:41:42 +05:30
Shivam Mishra
dadd572f9d refactor: useKeyboardEvents composable (#9959)
This PR has the following changes

1. Fix tab styles issue caused by adding an additional wrapper for
getting an element ref on `ChatTypeTabs.vue`
2. Refactor `useKeyboardEvents` composable to not require an element
ref. It will use a local abort controller to abort any listener

---------

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2024-08-22 16:40:55 +05:30
Pranav
4aa4e2549f feat: Update the design for automation (#10002)
This is the continuation of the design update for the settings screens.
In this PR, the automation page is updated with the latest design.

- Moved the row to a new component
- Migrated both components to composition API.
- Order by ID (Earlier this was order by updated_at which was
confusing).

| Light | Dark |
| --  | -- |
| <img width="1438" alt="Screenshot 2024-08-21 at 9 46 48 PM"
src="https://github.com/user-attachments/assets/89d96745-6556-48a1-82fa-a115325c24c0">
| <img width="1398" alt="Screenshot 2024-08-21 at 9 46 57 PM"
src="https://github.com/user-attachments/assets/5f1935ec-6d0e-4f82-b895-f47244764474">
|

---------

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
2024-08-22 16:22:54 +05:30
Sivin Varghese
d19a9c38d7 feat: Rewrite aiMixin to a composable (#9955)
This PR will replace the usage of aiMixin with the useAI composable.

Fixes https://linear.app/chatwoot/issue/CW-3443/rewrite-aimixin-mixin-to-a-composable

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
2024-08-22 13:58:51 +05:30
Sivin Varghese
c63a6ed8ec feat: Rewrite agentMixin to a helper (#9940)
# Pull Request Template

## Description

This PR will replace the usage of `agentMixin`with the utility helpers
functions.

**Files updated**

1. dashboard/components/widgets/conversation/contextMenu/Index.vue
2. dashboard/components/widgets/conversation/ConversationHeader.vue
**(Not used)**
3. dashboard/routes/dashboard/commands/commandbar.vue
4. dashboard/routes/dashboard/conversation/ConversationAction.vue
5. dashboard/routes/dashboard/conversation/ConversationParticipant.vue

Fixes
https://linear.app/chatwoot/issue/CW-3442/rewrite-agentmixin-mixin-to-a-composable

## Type of change

- [x] New feature (non-breaking change which adds functionality)

## How Has This Been Tested?

**Test cases**

1. See agent list sorting based on availability, if agents are on the
same status, then sorted by name.
2. Test actions like assigning/unassigning agent from conversation
sidebar, CMD bar, Context menu.
3. Test actions like adding/removing participants from conversation
sidebar.
4. See agent list is generated properly, none value.


## 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
- [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
- [ ] Any dependent changes have been merged and published in downstream
modules
2024-08-22 13:02:11 +05:30
Pranav
44227de97e feat: Update the design for macros design page (#9999)
This is the continuation of the design update for settings page. This PR updates the design for the macros page.

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2024-08-21 18:27:53 +05:30
Pranav
77b718c22c fix: Remove user.permissions, resolve it from accounts (#9990)
Remove the `user.permissions` field and resolve the permissions directly
from the accounts array in the user. This change ensures that the cache
or previous values from the last active account don't affect the
permissions.

In this PR: 
- Remove user.permissions usage, replace it with getUserPermissions
method.
- Remove json.permissions from user.json.jbuilder
2024-08-21 11:36:26 +05:30
Sivin Varghese
dd8abe975c feat: Rewrite configMixin to a composable (#9921)
# Pull Request Template

## Description

This PR will replace the usage of `configMixin` with the `useConfig`
composable.

**Files updated**
1. dashboard/components/layout/sidebarComponents/SecondaryNavItem.vue
2. dashboard/components/widgets/conversation/MessagesView.vue
3. dashboard/routes/dashboard/settings/inbox/Settings.vue **(Not used)**
4. dashboard/routes/dashboard/settings/inbox/FinishSetup.vue **(Not
used)**
5.
dashboard/routes/dashboard/settings/inbox/settingsPage/CollaboratorsPage.vue
6.
dashboard/routes/dashboard/settings/profile/NotificationPreferences.vue
**(Not used)**
7. dashboard/routes/dashboard/settings/profile/AudioNotifications.vue
**(Not used)**
8. dashboard/routes/dashboard/settings/sla/Index.vue **(Not used)**
9. dashboard/routes/dashboard/settings/account/Index.vue
10. survey/views/Response.vue **(Not used)**

Fixes
https://linear.app/chatwoot/issue/CW-3464/rewrite-configmixin-mixin-to-a-composable

## Type of change

- [x] New feature (non-breaking change which adds functionality)

## How Has This Been Tested?

Test in the component related pages


## 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
- [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
- [ ] Any dependent changes have been merged and published in downstream
modules
2024-08-14 12:56:30 +05:30
Pranav
b998f04826 feat: Update the design for user management page (#9948)
This PR is the part of the settings page design update series. This PR updates the design for the user management page.


Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2024-08-13 19:31:31 +05:30
Sivin Varghese
66db9a0cc1 feat: Rewrite accountMixin to a composable (#9914) 2024-08-12 18:53:30 +05:30
Sivin Varghese
b1da3dc7cf feat: Replace attributeMixin within the component (#9919)
# Pull Request Template

## Description

This PR will replace the usage of `attributeMixin` within the component
itself. And moved the component from option API to composition API and
updated the styles and related component

Fixes
https://linear.app/chatwoot/issue/CW-3444/rewrite-attributemixin-mixin-to-a-composable

## Type of change

- [x] New feature (non-breaking change which adds functionality)

## How Has This Been Tested?

**Test cases**
1. Add custom attributes for both conversation and contact from the
settings
2. See all attributes are showing based on the conversation and contact
in both conversation and contact sidebar.
3. Try all CRUD operations like EDIT, DELETE. 
4. Check whether styles are properly showing or not (Background color
based on odd/even)

## 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
- [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
- [ ] Any dependent changes have been merged and published in downstream
modules
2024-08-12 18:26:07 +05:30
Sivin Varghese
4c6572c2c9 feat: Rewrite conversation/labelMixin to a composable (#9936)
# Pull Request Template

## Description

This PR will replace the usage of `conversation/labelMixin` with a
composable

Fixes
https://linear.app/chatwoot/issue/CW-3439/rewrite-conversationlabelmixin-mixin-to-a-composable

## Type of change

- [x] New feature (non-breaking change which adds functionality)

## How Has This Been Tested?

**Test cases**

1. Add/remove labels from conversation sidebar
2. See labels are showing up dynamically
3. Check add/remove labels working fine with CMD bar
4. Check card labels in conversation card and SLA reports table.


## 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
- [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
- [ ] Any dependent changes have been merged and published in downstream
modules
2024-08-12 17:41:12 +05:30
Sivin Varghese
452096f4b2 feat: Replace rtlMixin to a composable (#9924)
This PR will replace the usage of `rtlMixin` to the `useUISettings` composable, and moved the method to component itself.
2024-08-12 15:50:21 +05:30
Pranav
4a63d1d896 feat: Update the design for label management page (#9932)
This PR is part of the settings design update series. It updates the design for the label management page. I've made a few changes to the SettingsLayout page to reduce boilerplate code.
2024-08-12 09:29:39 +05:30
Sivin Varghese
d5f34bf9d0 feat: Replace conversation/teamMixin within the components (#9923) 2024-08-11 10:09:08 +05:30
Sivin Varghese
3558878ae2 feat: Replace the use of macroMixin with a composable (#9912)
# Pull Request Template

## Description

This PR will replace usage of `macroMixin` with the `useMacros`
composable. And updated components from option API to composition API.

**Files updated**
1. dashboard/routes/dashboard/settings/macros/MacroNode.vue
2. dashboard/routes/dashboard/settings/macros/MacroEditor.vue

Fixes
https://linear.app/chatwoot/issue/CW-3449/rewrite-macrosmixin-mixin-to-a-composable

## Type of change

- [x] New feature (non-breaking change which adds functionality)

## How Has This Been Tested?

**Test cases**
1. Check whether we can create a new macro.
2. Check whether validations and error animation are working or not.
3. Ability to drag the macro files
4. Check whether the edit pages and functionality is working or not.


## 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
- [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
- [ ] Any dependent changes have been merged and published in downstream
modules
2024-08-09 18:40:06 +05:30
Sivin Varghese
d1d1398d80 feat: Rewrite customAttributeMixin to validation helper (#9916)
# Pull Request Template

## Description

This PR will replace the use of `customAttributeMixin` with
`shared/helpers/Validators` helper.

Fixes
https://linear.app/chatwoot/issue/CW-3446/rewrite-customattributemixin-mixin-to-a-composable

**Files updated**
1. widget/components/PreChat/Form.vue
2. dashboard/components/CustomAttribute.vue
3. dashboard/routes/dashboard/settings/attributes/EditAttribute.vue

## Type of change

- [x] New feature (non-breaking change which adds functionality)

## How Has This Been Tested?

Test the custom validation is working or not with the custom attributes.


## 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
- [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
- [ ] Any dependent changes have been merged and published in downstream
modules
2024-08-09 18:37:26 +05:30
Sivin Varghese
74bbbd25b9 feat: Replace the use of keyboardEventListener mixin to a composable (Part -3) (#9897) 2024-08-08 12:40:56 +05:30
Pranav
ae938b2154 fix: Disable the password section is the admin has disabled user profile update (#9910)
This PR updates the profile settings page to completely disable the password section, including the heading, if the admin has disabled user profile updates. Previously, the section heading was shown with empty content, which caused confusion.
2024-08-07 09:51:37 -07:00
Pranav
80a90d9d8c feat: Update the design for canned responses (#9903)
This is the continuation of the design update series. Canned responses listing page is rewritten with the design change.
---------

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: iamsivin <iamsivin@gmail.com>
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
Co-authored-by: Vishnu Narayanan <iamwishnu@gmail.com>
2024-08-07 09:43:47 -07:00
Sivin Varghese
646cfb97e7 fix: Snooze conversation not working in Inbox view (#9875) 2024-08-07 18:57:29 +05:30
Pranav
aea68f1ecf feat: Update the design of the audit logs page (#9901)
This is continuation of the design update, updates the design for audit logs listing page.

---------

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2024-08-06 20:58:04 -07:00
Pranav
e330c2f6c0 feat: Update the design for teams (#9899)
This PR updates the design for the team listing page. This PR is part of the design revamp project for all the settings pages.

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2024-08-06 17:26:23 -07:00
rotsen
91b713f6f5 fix: Use appropriate logos for integrations in the dark mode (#9881) 2024-08-06 09:40:41 -07:00
Pranav
736f16b170 fix: Fix issues with new conversation form (#9891)
`requiredIf('isAnEmailInbox')` was not evaluated properly. This PR fixes
it by moving it to a method and using the `this.[variable]` pattern.
2024-08-06 16:22:38 +05:30
Sivin Varghese
b4b308336f feat: Eslint rules (#9839)
# Pull Request Template

## Description

This PR adds new eslint rules to the code base.

**Error rules**

|    Rule name     | Type | Files updated |
| ----------------- | --- | - |
| `vue/block-order`  | error  |    |
| `vue/component-name-in-template-casing`  | error  |    |
| `vue/component-options-name-casing`  | error  |    |
| `vue/custom-event-name-casing`  | error  |    |
| `vue/define-emits-declaration`  | error  |    |
| `vue/no-unused-properties`  | error  |    |
| `vue/define-macros-order`  | error  |    |
| `vue/define-props-declaration`  | error  |    |
| `vue/match-component-import-name`  | error  |    |
| `vue/next-tick-style`  | error  |    |
| `vue/no-bare-strings-in-template`  | error  |    |
| `vue/no-empty-component-block`  | error  |    |
| `vue/no-multiple-objects-in-class`  | error  |    |
| `vue/no-required-prop-with-default`  | error  |    |
| `vue/no-static-inline-styles`  | error  |    |
| `vue/no-template-target-blank`  | error  |    |
| `vue/no-this-in-before-route-enter`  | error  |    |
| `vue/no-undef-components`  | error  |    |
| `vue/no-unused-emit-declarations`  | error  |    |
| `vue/no-unused-refs`  | error  |    |
| `vue/no-use-v-else-with-v-for`  | error  |    |
| `vue/no-useless-v-bind`  | error  |    |
| `vue/no-v-text`  | error  |    |
| `vue/padding-line-between-blocks`  | error  |    |
| ~`vue/prefer-prop-type-boolean-first`~ | ~error~ |  (removed this
rule, cause a bug in displaying custom attributes) |
| `vue/prefer-separate-static-class`  | error  |    |
| `vue/prefer-true-attribute-shorthand`  | error  |    |
| `vue/require-explicit-slots`  | error  |    |
| `vue/require-macro-variable-name`  | error  |    |


**Warn rules**

|    Rule name     | Type | Files updated |
| ---- | ------------- | ------------- |
| `vue/no-root-v-if`  | warn  |    |


Fixes https://linear.app/chatwoot/issue/CW-3492/vue-eslint-rules

## Type of change

- [x] New feature (non-breaking change which adds functionality)


## 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
- [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
- [ ] Any dependent changes have been merged and published in downstream
modules

---------

Co-authored-by: Fayaz Ahmed <fayazara@gmail.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
Co-authored-by: Pranav <pranav@chatwoot.com>
2024-08-05 14:02:16 +05:30
Sojan Jose
829bb842fd feat: Generate SSO URL in Chatwoot, move Captain to primary tab (#9871)
- Generate SSO URL in Chatwoot, move Captain to the primary tab

Co-authored-by: Pranav <pranavrajs@gmail.com>
2024-08-01 19:22:34 -07:00
Shivam Mishra
68482db3a2 fix: templates in whatsapp (#9862) 2024-07-31 15:33:31 +05:30
Sivin Varghese
f7102d7f8b fix: Table styles (#9860)
# Pull Request Template

## Description

This PR will fix table style breakage in the portal and inbox pre-chat
form settings pages.

## Type of change

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

## How Has This Been Tested?

**Before**

1. 
<img width="1563" alt="image"
src="https://github.com/user-attachments/assets/b9eb7962-90ba-4a73-8221-08cb00e699e3">

2. 
<img width="1190" alt="image"
src="https://github.com/user-attachments/assets/d60ca321-9743-4c30-ba3c-a34633f6f360">

3. 
<img width="1190" alt="image"
src="https://github.com/user-attachments/assets/a0a91780-030e-4154-b80b-7dd7bade08e7">

4. 
<img width="1190" alt="image"
src="https://github.com/user-attachments/assets/dbd99e24-f907-48c4-b460-db2f03453bda">


**After**
1.
<img width="1613" alt="image"
src="https://github.com/user-attachments/assets/aa5cb340-965d-4956-b1e7-79d955a62f19">

2. 
<img width="1203" alt="image"
src="https://github.com/user-attachments/assets/dcb2b9df-e6a5-48a4-a5dd-2c1fc25fc9b2">

3. 
<img width="1203" alt="image"
src="https://github.com/user-attachments/assets/409f3983-7987-4250-b311-cbea5e757e47">

4. 
<img width="1203" alt="image"
src="https://github.com/user-attachments/assets/27db4709-6b67-459a-a784-fd902f202964">



## 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-07-31 11:17:05 +05:30
Fayaz Ahmed
ce8e1ec93d chore: Migrate all instances of old vuelidate to new v2 syntax [CW-3274] (#9623)
Removes all the old vuelidate syntax and replaced it with the new
`useValidate` composable and the `v$` helper.

| Component | Path | Migrated | Tested |

|------------------------------------|--------------------------------------------------------------|-----------------------------------------------|--------|
| Login page | app/javascript/v3/views/login/Index.vue |  |  |
| Custom Attributes settings page |
app/javascript/dashboard/components/CustomAttribute.vue |  |  |
| Account settings page |
app/javascript/dashboard/routes/dashboard/settings/account/Index.vue | 
|  |
| Add Account Modal |
app/javascript/dashboard/components/layout/sidebarComponents/AddAccountModal.vue
|  |  |
| AICTA Modal |
app/javascript/dashboard/components/widgets/AICTAModal.vue |  |  |
| Conversation Advanced Filters |
app/javascript/dashboard/components/widgets/conversation/ConversationAdvancedFilter.vue
| deprecated `$each` prop in validations object | |
| Email Transript Modal |
app/javascript/dashboard/components/widgets/conversation/EmailTranscriptModal.vue
|  |  |
| Linear Create Issue |
app/javascript/dashboard/components/widgets/conversation/linear/CreateIssue.vue
|  |  |
| Template Parser |
app/javascript/dashboard/components/widgets/conversation/WhatsappTemplates/TemplateParser.vue
|  | |
| Delete Confirmation Modal |
app/javascript/dashboard/components/widgets/modal/ConfirmDeleteModal.vue
|  |  |
| Add Custom Attribute |
app/javascript/dashboard/modules/contact/components/AddCustomAttribute.vue
|  |  |
| Merge Contacts |
app/javascript/dashboard/modules/contact/components/MergeContact.vue | 
|  |
| Contacts Advanced Filters |
app/javascript/dashboard/routes/dashboard/contacts/components/ContactsAdvancedFilters.vue
| deprecated `$each` prop in validations object | |
| Contact Form |
app/javascript/dashboard/routes/dashboard/conversation/contact/ContactForm.vue
|  |  |
| Conversation Form |
app/javascript/dashboard/routes/dashboard/conversation/contact/ConversationForm.vue
|  |  |
| Add Custom Views |
app/javascript/dashboard/routes/dashboard/customviews/AddCustomViews.vue
|  |  |
| Add Locale |
app/javascript/dashboard/routes/dashboard/helpcenter/components/AddLocale.vue
|  |  |
| Portal Settings Basic Form |
/app/javascript/dashboard/routes/dashboard/helpcenter/components/PortalSettingsBasicForm.vue
|  |  |
| Portal Settings Customization Form |
/app/javascript/dashboard/routes/dashboard/helpcenter/components/PortalSettingsCustomizationForm.vue
|  |  |
| Add Category |
app/javascript/dashboard/routes/dashboard/helpcenter/pages/categories/AddCategory.vue
|  |  |
| Edit Category |
app/javascript/dashboard/routes/dashboard/helpcenter/pages/categories/EditCategory.vue
|  |  |
| CSML Bot Editor |
app/javascript/dashboard/routes/dashboard/settings/agentBots/components/CSMLBotEditor.vue
|  |  |
| Add Agent |
app/javascript/dashboard/routes/dashboard/settings/agents/AddAgent.vue |
 |  |
| Edit Agent |
app/javascript/dashboard/routes/dashboard/settings/agents/EditAgent.vue
|  |  |
| Add Attribute |
app/javascript/dashboard/routes/dashboard/settings/attributes/AddAttribute.vue
|  |  |
| Edit Attribute |
app/javascript/dashboard/routes/dashboard/settings/attributes/EditAttribute.vue
|  |  |
| Add Campaign |
app/javascript/dashboard/routes/dashboard/settings/campaigns/AddCampaign.vue
|  |  |
| Edit Campaign |
app/javascript/dashboard/routes/dashboard/settings/campaigns/EditCampaign.vue
|  |  |
| Add Canned |
app/javascript/dashboard/routes/dashboard/settings/canned/AddCanned.vue
|  |  |
| Edit Canned |
app/javascript/dashboard/routes/dashboard/settings/canned/EditCanned.vue
|  |  |
| IMAP Settings |
app/javascript/dashboard/routes/dashboard/settings/inbox/ImapSettings.vue
|  |  |
| SMTP Settings |
app/javascript/dashboard/routes/dashboard/settings/inbox/SmtpSettings.vue
|  |  |
| Widget Builder |
app/javascript/dashboard/routes/dashboard/settings/inbox/WidgetBuilder.vue
|  |  |
| 360 Dialog Whatsapp |
app/javascript/dashboard/routes/dashboard/settings/inbox/channels/360DialogWhatsapp.vue
|  |  |
| Inbox API settings |
app/javascript/dashboard/routes/dashboard/settings/inbox/channels/Api.vue
|  |  |
| SMS Bandwidth settings |
app/javascript/dashboard/routes/dashboard/settings/inbox/channels/BandwidthSms.vue
|  |  |
| Cloud Whatsapp Settings |
app/javascript/dashboard/routes/dashboard/settings/inbox/channels/CloudWhatsapp.vue
|  |  |
| Facebook Settings |
app/javascript/dashboard/routes/dashboard/settings/inbox/channels/Facebook.vue
|  |  |
| Line Settings |
app/javascript/dashboard/routes/dashboard/settings/inbox/channels/Line.vue
|  |  |
| Telegram Settings |
app/javascript/dashboard/routes/dashboard/settings/inbox/channels/Telegram.vue
|  |  |
| Twillio Settings |
app/javascript/dashboard/routes/dashboard/settings/inbox/channels/Twilio.vue
|  |  |
| Forward To option settings |
app/javascript/dashboard/routes/dashboard/settings/inbox/channels/emailChannels/ForwardToOption.vue
|  |  |
| Microsoft settings |
app/javascript/dashboard/routes/dashboard/settings/inbox/channels/emailChannels/Microsoft.vue
|  |  |
| Collaborators page |
app/javascript/dashboard/routes/dashboard/settings/inbox/settingsPage/CollaboratorsPage.vue
|  |  |
| Configuration Page |
app/javascript/dashboard/routes/dashboard/settings/inbox/settingsPage/ConfigurationPage.vue
|  |  |
| Dashboard App Modal Settings |
app/javascript/dashboard/routes/dashboard/settings/integrations/DashboardApps/DashboardAppModal.vue
|  |  |
| Settings - Webhook Form |
app/javascript/dashboard/routes/dashboard/settings/integrations/Webhooks/WebhookForm.vue
|  |  |
| Macro Form |
app/javascript/dashboard/routes/dashboard/settings/macros/MacroForm.vue
| deprecated `$each` prop in validations object | |
| Change Password |
app/javascript/dashboard/routes/dashboard/settings/profile/ChangePassword.vue
|  |  |
| settings - User Basic Details |
app/javascript/dashboard/routes/dashboard/settings/profile/UserBasicDetails.vue
|  |  |
| Password Edit | app/javascript/v3/views/auth/password/Edit.vue |  | 
|
| Password Reset form |
app/javascript/v3/views/auth/reset/password/Index.vue |  |  |
| Signup form |
app/javascript/v3/views/auth/signup/components/Signup/Form.vue |  |  |
| Login form | app/javascript/v3/views/login/Index.vue |  |  |
| Custom Attributes |
app/javascript/dashboard/components/CustomAttribute.vue |  |  |
| Reply Email Head |
app/javascript/dashboard/components/widgets/conversation/ReplyEmailHead.vue
|  |  |
| Methods Mixin |
app/javascript/dashboard/mixins/automations/methodsMixin.js |  |  |
| Validations mixin |
app/javascript/dashboard/routes/dashboard/settings/labels/validationMixin.js
|  |  |
| SLA Form |
app/javascript/dashboard/routes/dashboard/settings/sla/SlaForm.vue |  |
 |
| SLA Time Input |
app/javascript/dashboard/routes/dashboard/settings/sla/SlaTimeInput.vue
|  |  |
| SLA Validation Mixin |
app/javascript/dashboard/routes/dashboard/settings/sla/validationMixin.js
|  |  |
| Team Form |
app/javascript/dashboard/routes/dashboard/settings/teams/TeamForm.vue |
 |  |
| Add Agents |
app/javascript/dashboard/routes/dashboard/settings/teams/Create/AddAgents.vue
|  |  |
| Edit Agents |
app/javascript/dashboard/routes/dashboard/settings/teams/Edit/EditAgents.vue
|  |  |


---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Pranav <pranav@chatwoot.com>
2024-07-30 15:08:22 +05:30
Pranav
6694db093f feat: Update the design for dashboard_apps (#9840)
This PR migrates the dashboard apps page to the new layout and includes
the following updates:

- Create a compact design for the back button
- Add a back button to the settings header
- Reduce letter-spacing on the description
- Fix mobile styles
- Migrate the layout of dashboard apps/index to new layouts


Note: I've moved all feature help URLs from features.yml to the frontend. This change prevents features.yml from becoming bloated due to frontend modifications.

---------

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2024-07-25 16:26:00 -07:00