Skip to content

Commit a88f037

Browse files
Merge pull request #326 from fazer-ai/chore/merge-upstream-4.15.1
chore(merge): sync upstream chatwoot v4.15.1
2 parents f91fa75 + ebf9eca commit a88f037

57 files changed

Lines changed: 97 additions & 1581 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

VERSION_CW

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.15.0
1+
4.15.1

app/finders/conversation_finder.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def filter_by_conversation_type
149149
conversation_ids = current_account.mentions.where(user: current_user).pluck(:conversation_id)
150150
@conversations = @conversations.where(id: conversation_ids)
151151
when 'participating'
152-
@conversations = @conversations.where(id: current_user.participating_conversations.where(account_id: current_account.id).select(:id))
152+
@conversations = current_user.participating_conversations.where(account_id: current_account.id)
153153
when 'unattended'
154154
@conversations = @conversations.unattended
155155
end

app/javascript/dashboard/components-next/sidebar/ChannelLeaf.vue

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ const props = defineProps({
2222
type: [Number, String],
2323
default: 0,
2424
},
25-
badgeTooltip: {
26-
type: String,
27-
default: '',
28-
},
2925
});
3026
3127
const reauthorizationRequired = computed(() => {
@@ -38,7 +34,7 @@ const reauthorizationRequired = computed(() => {
3834
<ChannelIcon :inbox="inbox" class="size-4" />
3935
</span>
4036
<div class="flex-1 truncate min-w-0">{{ label }}</div>
41-
<SidebarUnreadBadge :count="badgeCount" :tooltip="badgeTooltip" />
37+
<SidebarUnreadBadge :count="badgeCount" />
4238
<div
4339
v-if="reauthorizationRequired"
4440
v-tooltip.top-end="$t('SIDEBAR.REAUTHORIZE')"

app/javascript/dashboard/components-next/sidebar/Sidebar.vue

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -200,18 +200,6 @@ const getLabelUnreadCount = useMapGetter(
200200
const getTeamUnreadCount = useMapGetter(
201201
'conversationUnreadCounts/getTeamUnreadCount'
202202
);
203-
const mentionsUnreadCount = useMapGetter(
204-
'conversationUnreadCounts/getMentionsUnreadCount'
205-
);
206-
const participatingUnreadCount = useMapGetter(
207-
'conversationUnreadCounts/getParticipatingUnreadCount'
208-
);
209-
const unattendedUnreadCount = useMapGetter(
210-
'conversationUnreadCounts/getUnattendedUnreadCount'
211-
);
212-
const getFolderUnreadCount = useMapGetter(
213-
'conversationUnreadCounts/getFolderUnreadCount'
214-
);
215203
const teams = useMapGetter('teams/getMyTeams');
216204
const contactCustomViews = useMapGetter('customViews/getContactCustomViews');
217205
const conversationCustomViews = useMapGetter(
@@ -294,19 +282,6 @@ const sortedLabels = computed(() =>
294282
})
295283
);
296284
297-
const unreadBadgeTooltips = computed(() => ({
298-
ALL: t('SIDEBAR.UNREAD_COUNT_TOOLTIP.ALL'),
299-
INBOX: t('SIDEBAR.UNREAD_COUNT_TOOLTIP.INBOX'),
300-
LABEL: t('SIDEBAR.UNREAD_COUNT_TOOLTIP.LABEL'),
301-
TEAM: t('SIDEBAR.UNREAD_COUNT_TOOLTIP.TEAM'),
302-
FOLDER: t('SIDEBAR.UNREAD_COUNT_TOOLTIP.FOLDER'),
303-
MENTIONS: t('SIDEBAR.UNREAD_COUNT_TOOLTIP.MENTIONS'),
304-
PARTICIPATING: t('SIDEBAR.UNREAD_COUNT_TOOLTIP.PARTICIPATING'),
305-
UNATTENDED: t('SIDEBAR.UNREAD_COUNT_TOOLTIP.UNATTENDED'),
306-
}));
307-
308-
const unreadBadgeTooltip = type => unreadBadgeTooltips.value[type];
309-
310285
const closeMobileSidebar = () => {
311286
if (!props.isMobileSidebarOpen) return;
312287
emit('closeMobileSidebar');
@@ -362,33 +337,26 @@ const menuItems = computed(() => {
362337
label: t('SIDEBAR.ALL_CONVERSATIONS'),
363338
icon: 'i-lucide-inbox',
364339
badgeCount: allUnreadCount.value,
365-
badgeTooltip: unreadBadgeTooltip('ALL'),
366340
activeOn: ['inbox_conversation'],
367341
to: accountScopedRoute('home'),
368342
},
369343
{
370344
name: 'Mentions',
371345
label: t('SIDEBAR.MENTIONED_CONVERSATIONS'),
372-
badgeCount: mentionsUnreadCount.value,
373-
badgeTooltip: unreadBadgeTooltip('MENTIONS'),
374346
icon: 'i-lucide-at-sign',
375347
activeOn: ['conversation_through_mentions'],
376348
to: accountScopedRoute('conversation_mentions'),
377349
},
378350
{
379351
name: 'Participating',
380352
label: t('SIDEBAR.PARTICIPATING_CONVERSATIONS'),
381-
badgeCount: participatingUnreadCount.value,
382-
badgeTooltip: unreadBadgeTooltip('PARTICIPATING'),
383353
icon: 'i-lucide-user-round-check',
384354
activeOn: ['conversation_through_participating'],
385355
to: accountScopedRoute('conversation_participating'),
386356
},
387357
{
388358
name: 'Unattended',
389359
activeOn: ['conversation_through_unattended'],
390-
badgeCount: unattendedUnreadCount.value,
391-
badgeTooltip: unreadBadgeTooltip('UNATTENDED'),
392360
label: t('SIDEBAR.UNATTENDED_CONVERSATIONS'),
393361
icon: 'i-lucide-clock-alert',
394362
to: accountScopedRoute('conversation_unattended'),
@@ -404,8 +372,6 @@ const menuItems = computed(() => {
404372
children: sortedFolders.value.map(view => ({
405373
name: `${view.name}-${view.id}`,
406374
label: view.name,
407-
badgeCount: getFolderUnreadCount.value(view.id),
408-
badgeTooltip: unreadBadgeTooltip('FOLDER'),
409375
to: accountScopedRoute('folder_conversations', { id: view.id }),
410376
})),
411377
},
@@ -421,7 +387,6 @@ const menuItems = computed(() => {
421387
name: `${team.name}-${team.id}`,
422388
label: team.name,
423389
badgeCount: getTeamUnreadCount.value(team.id),
424-
badgeTooltip: unreadBadgeTooltip('TEAM'),
425390
to: accountScopedRoute('team_conversations', { teamId: team.id }),
426391
})),
427392
},
@@ -437,7 +402,6 @@ const menuItems = computed(() => {
437402
name: `${inbox.name}-${inbox.id}`,
438403
label: inbox.name,
439404
badgeCount: getInboxUnreadCount.value(inbox.id),
440-
badgeTooltip: unreadBadgeTooltip('INBOX'),
441405
icon: h(ChannelIcon, { inbox, class: 'size-[16px]' }),
442406
to: accountScopedRoute('inbox_dashboard', { inbox_id: inbox.id }),
443407
component: leafProps =>
@@ -446,7 +410,6 @@ const menuItems = computed(() => {
446410
active: leafProps.active,
447411
inbox,
448412
badgeCount: leafProps.badgeCount,
449-
badgeTooltip: leafProps.badgeTooltip,
450413
}),
451414
})),
452415
},
@@ -462,7 +425,6 @@ const menuItems = computed(() => {
462425
name: `${label.title}-${label.id}`,
463426
label: label.title,
464427
badgeCount: getLabelUnreadCount.value(label.id),
465-
badgeTooltip: unreadBadgeTooltip('LABEL'),
466428
icon: h('span', {
467429
class: `size-[8px] rounded-sm`,
468430
style: { backgroundColor: label.color },

app/javascript/dashboard/components-next/sidebar/SidebarCollapsedPopover.vue

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,7 @@ onMounted(async () => {
197197
class="size-4 flex-shrink-0"
198198
/>
199199
<span class="flex-1 truncate">{{ subChild.label }}</span>
200-
<SidebarUnreadBadge
201-
:count="subChild.badgeCount"
202-
:tooltip="subChild.badgeTooltip"
203-
/>
200+
<SidebarUnreadBadge :count="subChild.badgeCount" />
204201
</button>
205202
</li>
206203
</ul>
@@ -223,10 +220,7 @@ onMounted(async () => {
223220
class="size-4 flex-shrink-0"
224221
/>
225222
<span class="flex-1 truncate">{{ child.label }}</span>
226-
<SidebarUnreadBadge
227-
:count="child.badgeCount"
228-
:tooltip="child.badgeTooltip"
229-
/>
223+
<SidebarUnreadBadge :count="child.badgeCount" />
230224
</button>
231225
</li>
232226
</template>

app/javascript/dashboard/components-next/sidebar/SidebarGroupLeaf.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const props = defineProps({
1212
active: { type: Boolean, default: false },
1313
component: { type: Function, default: null },
1414
badgeCount: { type: [Number, String], default: 0 },
15-
badgeTooltip: { type: String, default: '' },
1615
hideTreeLine: { type: Boolean, default: false },
1716
thinTreeLine: { type: Boolean, default: false },
1817
});
@@ -53,14 +52,14 @@ const TREE_CONNECTOR =
5352
<component
5453
:is="component"
5554
v-if="shouldRenderComponent"
56-
v-bind="{ label, icon, active, badgeCount, badgeTooltip }"
55+
v-bind="{ label, icon, active, badgeCount }"
5756
/>
5857
<template v-else>
5958
<span v-if="icon" class="size-4 grid place-content-center rounded-full">
6059
<Icon :icon="icon" class="size-4 inline-block" />
6160
</span>
6261
<div class="flex-1 truncate min-w-0 text-sm">{{ label }}</div>
63-
<SidebarUnreadBadge :count="badgeCount" :tooltip="badgeTooltip" />
62+
<SidebarUnreadBadge :count="badgeCount" />
6463
</template>
6564
</component>
6665
</Policy>

app/javascript/dashboard/components-next/sidebar/SidebarUnreadBadge.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { computed } from 'vue';
33
44
const props = defineProps({
55
count: { type: [Number, String], default: 0 },
6-
tooltip: { type: String, default: '' },
76
});
87
98
const normalizedCount = computed(() => {
@@ -19,7 +18,6 @@ const displayCount = computed(() =>
1918
<template>
2019
<span
2120
v-if="normalizedCount > 0"
22-
v-tooltip.top="tooltip || null"
2321
data-test-id="sidebar-unread-badge"
2422
class="inline-grid h-5 min-w-5 place-items-center rounded-full bg-n-slate-4 px-1 text-xxs font-medium leading-3 text-n-slate-12 dark:bg-n-slate-5 flex-shrink-0"
2523
>

app/javascript/dashboard/components-next/sidebar/specs/ChannelLeaf.spec.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { mount } from '@vue/test-utils';
22
import ChannelLeaf from '../ChannelLeaf.vue';
3-
import SidebarUnreadBadge from '../SidebarUnreadBadge.vue';
43

54
const mountChannelLeaf = props =>
65
mount(ChannelLeaf, {
@@ -29,17 +28,6 @@ describe('ChannelLeaf', () => {
2928
expect(badge.text()).toBe('3');
3029
});
3130

32-
it('passes tooltip copy to unread badge', () => {
33-
const wrapper = mountChannelLeaf({
34-
badgeCount: 3,
35-
badgeTooltip: 'Total unread conversations in this inbox',
36-
});
37-
38-
expect(wrapper.findComponent(SidebarUnreadBadge).props('tooltip')).toBe(
39-
'Total unread conversations in this inbox'
40-
);
41-
});
42-
4331
it('does not render unread badge when count is zero', () => {
4432
const wrapper = mountChannelLeaf({ badgeCount: 0 });
4533

app/javascript/dashboard/components-next/sidebar/specs/SidebarGroupLeaf.spec.js

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { mount } from '@vue/test-utils';
22
import { h } from 'vue';
33
import SidebarGroupLeaf from '../SidebarGroupLeaf.vue';
4-
import SidebarUnreadBadge from '../SidebarUnreadBadge.vue';
54

65
vi.mock('../provider', () => ({
76
useSidebarContext: () => ({
@@ -45,17 +44,6 @@ describe('SidebarGroupLeaf', () => {
4544
expect(badge.text()).toBe('7');
4645
});
4746

48-
it('passes tooltip copy to unread badge', () => {
49-
const wrapper = mountLeaf({
50-
badgeCount: 7,
51-
badgeTooltip: 'Total unread conversations in this label',
52-
});
53-
54-
expect(wrapper.findComponent(SidebarUnreadBadge).props('tooltip')).toBe(
55-
'Total unread conversations in this label'
56-
);
57-
});
58-
5947
it('does not render unread badge when count is zero', () => {
6048
const wrapper = mountLeaf({ badgeCount: 0 });
6149

@@ -75,17 +63,14 @@ describe('SidebarGroupLeaf', () => {
7563
it('passes unread count to custom leaf components', () => {
7664
const wrapper = mountLeaf({
7765
badgeCount: 4,
78-
badgeTooltip: 'Total unread conversations in this inbox',
7966
component: leafProps =>
8067
h(
8168
'span',
8269
{ 'data-test-id': 'custom-leaf-count' },
83-
`${leafProps.badgeCount}:${leafProps.badgeTooltip}`
70+
leafProps.badgeCount
8471
),
8572
});
8673

87-
expect(wrapper.find('[data-test-id="custom-leaf-count"]').text()).toBe(
88-
'4:Total unread conversations in this inbox'
89-
);
74+
expect(wrapper.find('[data-test-id="custom-leaf-count"]').text()).toBe('4');
9075
});
9176
});

app/javascript/dashboard/i18n/locale/en/settings.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -349,16 +349,6 @@
349349
"MENTIONED_CONVERSATIONS": "Mentions",
350350
"PARTICIPATING_CONVERSATIONS": "Participating",
351351
"UNATTENDED_CONVERSATIONS": "Unattended",
352-
"UNREAD_COUNT_TOOLTIP": {
353-
"ALL": "Total unread conversations",
354-
"INBOX": "Total unread conversations in this inbox",
355-
"LABEL": "Total unread conversations in this label",
356-
"TEAM": "Total unread conversations in this team",
357-
"FOLDER": "Total unread conversations in this folder",
358-
"MENTIONS": "Unread conversations where you were mentioned",
359-
"PARTICIPATING": "Unread conversations you're participating in",
360-
"UNATTENDED": "Unread unattended conversations"
361-
},
362352
"REPORTS": "Reports",
363353
"SETTINGS": "Settings",
364354
"CONTACTS": "Contacts",

0 commit comments

Comments
 (0)