Commit Graph

2330 Commits

Author SHA1 Message Date
Sivin Varghese
41106bccb7 chore: Fix issues with Contact pages (#10544) 2024-12-05 14:24:10 -08:00
Shivam Mishra
cdff624a0a feat: update notification settings (#10529)
https://github.com/user-attachments/assets/52ecf3f8-0329-4268-906e-d6102338f4af

---------

Co-authored-by: Pranav <pranav@chatwoot.com>
Co-authored-by: Pranav <pranavrajs@gmail.com>
2024-12-05 19:05:04 +05:30
Sivin Varghese
d635be4b2a fix: Fetch assignable agents in expanded layout (#10540) 2024-12-04 21:26:00 -08:00
Sivin Varghese
f7b0d5dbe2 fix: Reset contact attributes when form is updated (#10539) 2024-12-04 21:25:28 -08:00
Sivin Varghese
3edc0542cc fix: Fix issue with profile picture not updating (#10532)
This PR resolves the issue with updating the profile picture in the profile settings.

**Cause of issue**
The issue can be reproduced with the old `ProfileAvatar.vue` component.
While the exact reason is unclear, it seems related to cases where the
file might be `null`.

**Solution**
Replaced the old `ProfileAvatar.vue` with `Avatar.vue` and tested it. It
works fine. I’ve attached a loom video below.

Fixes https://linear.app/chatwoot/issue/CW-3768/profile-picture-bug

Co-authored-by: Pranav <pranav@chatwoot.com>
Co-authored-by: Pranav <pranavrajs@gmail.com>
2024-12-04 15:02:29 -08:00
Sivin Varghese
bf58a18af4 fix: Update contact details page errors (#10536)
Co-authored-by: Pranav <pranavrajs@gmail.com>
2024-12-04 13:58:53 -08:00
Shivam Mishra
9b6830a610 fix: Update UI issues with sidebar (#10535)
This PR fixes a few UI issues with the sidebar

1. `z-index` issues with sidebar dropdowns
2. Move the event listener to the root of the dropdown container, it
allows more consistent behaviour of the trigger, earlier the click on
the trigger when the dropdown was open would cause the container to
re-render
3. Use `perserve-open` for the status switcher menu item in the profile
menu.
4. Use `sessionStorage` instead of `localStorage` to preserve sidebar
dropdown info. When opening the dashboard without directly going to a
specific route, any previous known item would get expanded even if it's
link was not active, this caused issues across tabs too, this fixes it.
5. Use `snakeCaseKeys` instead of `decamelize` we had two packages doing
the same thing
6. Update `vueuse` the new version is vue3 only
2024-12-04 13:48:12 -08:00
Sivin Varghese
769b7171f4 feat(v4): Add new contact details screen (#10504)
Co-authored-by: Pranav <pranavrajs@gmail.com>
2024-12-03 21:29:47 -08:00
Sivin Varghese
062587487a feat: Improve Contact list (#10522) 2024-12-02 18:23:41 -08:00
Sivin Varghese
0ab7accd3f feat: Contact filter preview (#10516)
# Pull Request Template

## Description

**Screenshots**
<img width="986" alt="image"
src="https://github.com/user-attachments/assets/8df44237-ec51-45d3-aed3-518cded42f5d">

<img width="986" alt="image"
src="https://github.com/user-attachments/assets/2213ce2e-2461-41f0-a05a-0f955a4d7e3a">

**Story**
<img width="992" alt="image"
src="https://github.com/user-attachments/assets/f8e25fe2-11e8-4b9b-8d0b-357f9b7b6e39">
2024-12-02 16:22:05 +05:30
Sivin Varghese
1c12fbceb9 feat: New contacts advanced filter (#10514) 2024-11-29 10:55:15 +05:30
Sivin Varghese
a50e4f1748 feat(v4): Update the design for the contacts list page (#10501)
---------
Co-authored-by: Pranav <pranavrajs@gmail.com>
Co-authored-by: Pranav <pranav@chatwoot.com>
2024-11-27 20:07:20 -08:00
Shivam Mishra
25c61aba25 feat(v4): Add new conversation filters component (#10502)
Co-authored-by: Pranav <pranav@chatwoot.com>
Co-authored-by: Pranav <pranavrajs@gmail.com>
2024-11-27 20:05:54 -08:00
Pranav
35702457ed feat: Update design for report pages (#10506)
<img width="1440" alt="Screenshot 2024-11-26 at 8 38 57 PM"
src="https://github.com/user-attachments/assets/f752157c-6134-42cb-8211-ce636ea9e4d6">
<img width="1439" alt="Screenshot 2024-11-26 at 8 40 47 PM"
src="https://github.com/user-attachments/assets/580b1f61-68bc-489b-9081-b0aeb402f31d">

---------

Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
2024-11-27 18:10:15 +08:00
Shivam Mishra
d569713b66 fix: Fix z-index issue on account switcher (#10505)
Co-authored-by: Pranav <pranav@chatwoot.com>
2024-11-26 19:59:16 -08:00
Sivin Varghese
b9d888d8ab feat: Add contact header components (#10498) 2024-11-25 19:59:04 -08:00
Sivin Varghese
ba1b02e274 feat: Add contact empty state components (#10499) 2024-11-25 19:50:33 -08:00
Shivam Mishra
b0287fe389 feat: Add conditions row component (#10496)
---------

Co-authored-by: Pranav <pranavrajs@gmail.com>
2024-11-25 16:33:12 -08:00
Shivam Mishra
c23cd094f9 feat(v4): Add filter input components (#10493)
This PR adds three components along with stories

1. MultiSelect - This is used for filter values, allowing multiple values and folding of values where there are too many items
2. SingleSelect - This is used for filter values, allows selecting and toggling a single item
3. FilterSelect - This is used for operators and others, it allows icons and labels as well as toggling them using props. The v-model for this binds just the final value unlike the previous two components with bind the entire object.

---------

Co-authored-by: Pranav <pranavrajs@gmail.com>
2024-11-25 11:52:28 -08:00
Sivin Varghese
e9ba4200b2 feat: Add custom attributes components (#10467) 2024-11-24 16:46:00 -08:00
Shivam Mishra
0f659224a7 feat: async update of article [CW-3721] (#10435)
### The problem

Writing in the text editor can be very frustrating, the reason is that
the editor had a debounced save method which would push the article to
the backend and update the current state. This however is a bad idea,
since the can take anywhere between 100-300ms depending on network
conditions.

While this would be in progress, the article is still being edited by
the user. So at the end of the network request, the state returned from
the backend and the current state in the editor is diverged. But since
the update happens anyway, the editor would prepend older context.

```
Time   --> 

User Action:      [Edit 1] ---> [Edit 2] ---> [Edit 3]
Backend Save:           Save Req (Edit 1) ----> Response (Edit 1)
Resulting Editor State: [Edit 3] + [Edit 1] (Outdated state prepended)
```

### The solution

The solution is to unbind the article from the backend state, ensuring
that the article editor is the source of truth and ignoring the
responses. This pull request does this by adding an asynchronous save
functionality. The changes include adding a new `saveArticleAsync` event
and ensuring that the local state is not updated unnecessarily during
asynchronous saves.

```
Time   --> 

User Action:      [Edit 1] ---> [Edit 2] ---> [Edit 3]
Backend Save:           Save Req (Edit 1) ----> Response (ignored)
Resulting Editor State: [Edit 3] (Consistent and up-to-date)
```

Added the following two debounced methods

These complementary debounce methods prevent unnecessary re-renders
while ensuring backend is in sync. `saveArticleAsync` preserves the
editor as the source of truth, while `saveArticle` manages periodic
state updates from the backend with a delay large enough to safely
assume that the user has stopped typing
Method | Delay | Behavior
-- | -- | -- 
`saveArticleAsync` | 400ms | Sends data to backend and ignores the
response
`saveArticle` | 2.5s | Sends data and updates local state with the
backend response

### How to test

1. Remove the following line
dc042f6ddc/app/javascript/dashboard/components-next/HelpCenter/Pages/ArticleEditorPage/ArticleEditor.vue (L64)
1. Update the latency here to 400 (P.S. the diff shows the latency to be
600, but that was added as a stop-gap solution)

dc042f6ddc/app/javascript/dashboard/components-next/HelpCenter/Pages/ArticleEditorPage/ArticleEditor.vue (L51)
1. Set the browser network latency to Slow 3G or 3G
1. Start writing on the editor, try fixing typos with backspace or
moving around with the cursor

---------

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Pranav <pranav@chatwoot.com>
2024-11-21 19:38:08 -08:00
Sivin Varghese
2dae4b22a2 feat: Add Label Input components (#10480) 2024-11-21 13:57:43 -08:00
Sivin Varghese
cf6ef11b9f feat: Add contact merge form component (#10478)
Co-authored-by: Pranav <pranavrajs@gmail.com>
2024-11-21 13:52:25 -08:00
Shivam Mishra
497bc055a2 feat: Attributify button component (#10473)
This PR allows attributify for `variant`, `size` and `color` props. This allows using shorthands, instant of writing full props.

We also added a small computed method to ensure these does not show up
in the DOM and pollute it

---------

Co-authored-by: Pranav <pranav@chatwoot.com>
2024-11-21 13:48:25 -08:00
Sivin Varghese
79daf56c31 feat: Add contact note item component (#10479) 2024-11-21 13:47:57 -08:00
Sivin Varghese
7b6195f28b fix: Component <woot-tabs /> reactivity issue. (#10476)
# Pull Request Template

## Description

This PR will fix reactivity issue with `<woot-tabs />` component.

**Cause of issue**
The `<woot-tabs />` component used an internal ref,
`internalActiveIndex` to track the `active` tab. However, it didn’t sync
with the `index` prop when updated by the parent, causing mismatched tab
selections.

**Solution**
The component now directly uses `props.index` to ensure it always
reflects the latest value from the parent. The unnecessary
`internalActiveIndex` ref has been removed. Changes to the active tab
emit a `change` event to update the parent.


## Type of change

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

## How Has This Been Tested?

**Loom video**

**Before**

https://www.loom.com/share/76eb32f1e7f7422f84055a102bf80951?sid=bc28c6ff-9640-4d3b-956c-99c1ec164971

**After**

https://www.loom.com/share/6bd8125ede5d43dc8fe115c3f1fb159b?sid=c376617a-94fb-4f71-8664-e0bd9e7af0b4

## 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-11-21 16:25:13 +05:30
Sivin Varghese
2309424cb1 feat: Add Contact card and form component (#10466)
Co-authored-by: Pranav <pranavrajs@gmail.com>
2024-11-20 21:18:25 -08:00
Shivam Mishra
3a334be582 feat: add channel icon component (#10471)
This pull request introduces a new `ChannelIcon` component and refactors the existing code to use this component, which simplifies the icon management for different channel types and providers.
2024-11-20 20:23:12 -08:00
Sivin Varghese
c3604bfcbf feat: New phone number input component (#10446) 2024-11-20 22:31:05 +05:30
Sivin Varghese
b0d6089bb6 feat: Updates on new components (#10444) 2024-11-20 20:21:35 +05:30
Shivam Mishra
759615d041 fix: Update the dropdown bg to match the design system (#10438)
This PR updates the background used in dropdown to match our design system. Previous PR failed to add this correctly.

---------

Co-authored-by: Pranav <pranav@chatwoot.com>
2024-11-19 14:29:45 -08:00
Sivin Varghese
a7e3d443c9 feat: Add the new select menu component (#10445) 2024-11-19 14:25:45 -08:00
Sivin Varghese
b680fa43ec fix: Country code missing when typing in phone input. (#10439) 2024-11-19 14:38:00 +05:30
Shivam Mishra
c2e2954dfa fix: Remove the warnings generated from the Sidebar component (#10437)
The following warning occurred since the `ChannelLeaf` component was passed extra props. This PR fixes it by passing only the required props
2024-11-18 19:09:09 -08:00
Shivam Mishra
aaa328be87 feat: Add dropdown component (#10358)
This PR adds dropdown primitives to help compose custom dropdowns across the app. The following the sample usage

---------

Co-authored-by: Pranav <pranav@chatwoot.com>
2024-11-18 17:29:27 -08:00
Sivin Varghese
4cfa7e4c97 feat: Remove incoming messages metrics from the agent reports (#10415) 2024-11-14 17:55:24 +05:30
Shivam Mishra
ac729cf0cf feat: update debounce duration for article editor (#10410)
Quick fix for CW-3721 until we work on a better solution
2024-11-13 12:29:50 +05:30
Shivam Mishra
97d7b9d754 feat(ee): Setup @chatwoot/captain NPM library (#10389)
--- 
Co-authored-by: Sojan <sojan@pepalo.com>
Co-authored-by: Pranav <pranavrajs@gmail.com>
2024-11-11 17:39:09 -08:00
Sivin Varghese
db327378fa feat(v4): Add new conversation card component (#10392) 2024-11-07 20:30:56 -08:00
Willian Coqueiro
54740e3bb9 fix: Update the translation for the text used in isTyping method (#10384)
This fix consists of translating the message when another user is typing on the other side.
---
Co-authored-by: Pranav <pranavrajs@gmail.com>
Co-authored-by: Pranav <pranav@chatwoot.com>
2024-11-04 20:04:08 -08:00
Sivin Varghese
579efd933b feat(v4): Update the campaigns page design (#10371)
<img width="1439" alt="Screenshot 2024-10-30 at 8 58 12 PM"
src="https://github.com/user-attachments/assets/26231270-5e73-40fb-9efa-c661585ebe7c">


Fixes
https://linear.app/chatwoot/project/campaign-redesign-f82bede26ca7/overview

---------

Co-authored-by: Pranav <pranavrajs@gmail.com>
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
2024-10-31 11:57:13 +05:30
Shivam Mishra
6e6c5a2f02 refactor: use css only last item detection (#10363)
The last item in the sidebar top level group has an indicator specified,
the problem in our case is that the structure can be nested and have sub
groups. So selecting the last item correctly can be tricky.

Previous implementation relied on the using DOM queries to find the last
item from a flat list of children, it would trigger on a `watch`. This
was error-prone as well as non idiomatic. The new approach is CSS-only
and reduces the unnecessary compute required.

Codepen for reference: https://codepen.io/scmmishra/pen/yLmKNLW

---------

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2024-10-31 09:39:18 +05:30
Shivam Mishra
2d35fa135b feat: Update colors (#10365) 2024-10-29 22:20:37 -07:00
Sivin Varghese
aa57431c48 fix: Dropdown menu issues (#10364) 2024-10-29 16:10:35 +05:30
Sivin Varghese
0689f59a05 feat: Update button component (#10362) 2024-10-29 14:00:24 +05:30
Sivin Varghese
f73798a1aa feat(v4): Help center portal redesign improvements (#10349) 2024-10-28 21:04:43 -07:00
Shivam Mishra
035a037313 fix: Use addEventListener instead of onmessage to listen to chatwoot-dashboard-app:fetch-info (#10342) 2024-10-28 20:43:47 -07:00
Shivam Mishra
7ba6c1d87d fix: Fix the issues with the new sidebar (#10348)
Co-authored-by: Pranav <pranavrajs@gmail.com>
2024-10-28 20:41:43 -07:00
Shivam Mishra
6df2d76c1e feat: new colors (#10352)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: iamsivin <iamsivin@gmail.com>
2024-10-28 14:27:08 +05:30
Shivam Mishra
80c9434069 feat(v4): Auto-navigate to first menu item on group menu open(#10350)
Ensures users are seamlessly directed to the first available menu item upon opening a group, improving UX by reducing unnecessary clicks. This change enhances navigation flow within groups.

Co-authored-by: Pranav <pranavrajs@gmail.com>
2024-10-25 13:01:29 -07:00