From d908c880d24974834a2e899ad38504b8e826e14f Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Mon, 11 Aug 2025 15:47:17 +0530 Subject: [PATCH] chore: Replace Thumbnail with Avatar (#12119) --- .../Campaigns/CampaignCard/CampaignCard.vue | 4 +- .../ConversationCard/ConversationCard.vue | 4 +- .../components-next/Inbox/InboxCard.vue | 4 +- .../helpers/composeConversationHelper.js | 3 +- .../components-next/avatar/Avatar.vue | 5 +- .../captain/assistant/InboxCard.vue | 7 +- app/javascript/dashboard/components/index.js | 4 - .../dashboard/components/widgets/Avatar.vue | 55 ----- .../components/widgets/Thumbnail.spec.js | 48 ---- .../components/widgets/Thumbnail.vue | 224 ------------------ .../components/widgets/ThumbnailGroup.vue | 111 ++++----- .../components/widgets/UserAvatarWithName.vue | 12 +- .../conversation/ConversationHeader.vue | 11 +- .../conversation/components/GalleryView.vue | 8 +- .../conversation/LabelSuggestion.vue | 19 +- .../conversationBulkActions/AgentSelector.vue | 12 +- .../widgets/forms/AvatarUploader.vue | 76 ------ app/javascript/dashboard/helper/inbox.js | 4 +- .../dashboard/helper/specs/inbox.spec.js | 20 +- .../components/ContactDropdownItem.vue | 51 ++-- .../components/WidgetFooter.vue | 4 +- .../conversation/contact/ContactForm.vue | 27 ++- .../conversation/contact/ContactInfo.vue | 12 +- .../components/NotificationTable.vue | 11 +- .../dashboard/settings/agents/Index.vue | 10 +- .../routes/dashboard/settings/inbox/Index.vue | 20 +- .../dashboard/settings/inbox/Settings.vue | 40 +++- .../settings/inbox/WidgetBuilder.vue | 28 ++- .../components/SenderNameExamplePreview.vue | 8 +- .../settings/macros/MacrosTableRow.vue | 6 +- .../reports/components/ReportFilters.vue | 20 +- .../reports/components/overview/AgentCell.vue | 10 +- .../settings/teams/AgentSelector.vue | 12 +- .../components/ui/MultiselectDropdown.vue | 10 +- .../ui/MultiselectDropdownItems.vue | 13 +- .../widget/components/AgentMessage.vue | 19 +- .../widget/components/GroupedAvatars.vue | 11 +- .../widget/components/UnreadMessage.vue | 11 +- 38 files changed, 297 insertions(+), 657 deletions(-) delete mode 100644 app/javascript/dashboard/components/widgets/Avatar.vue delete mode 100644 app/javascript/dashboard/components/widgets/Thumbnail.spec.js delete mode 100644 app/javascript/dashboard/components/widgets/Thumbnail.vue delete mode 100644 app/javascript/dashboard/components/widgets/forms/AvatarUploader.vue diff --git a/app/javascript/dashboard/components-next/Campaigns/CampaignCard/CampaignCard.vue b/app/javascript/dashboard/components-next/Campaigns/CampaignCard/CampaignCard.vue index 304e55347..05507fc89 100644 --- a/app/javascript/dashboard/components-next/Campaigns/CampaignCard/CampaignCard.vue +++ b/app/javascript/dashboard/components-next/Campaigns/CampaignCard/CampaignCard.vue @@ -76,8 +76,8 @@ const campaignStatus = computed(() => { const inboxName = computed(() => props.inbox?.name || ''); const inboxIcon = computed(() => { - const { phone_number: phoneNumber, channel_type: type } = props.inbox; - return getInboxIconByType(type, phoneNumber); + const { medium, channel_type: type } = props.inbox; + return getInboxIconByType(type, medium); }); diff --git a/app/javascript/dashboard/components-next/Conversation/ConversationCard/ConversationCard.vue b/app/javascript/dashboard/components-next/Conversation/ConversationCard/ConversationCard.vue index 36f611775..f9a2507a1 100644 --- a/app/javascript/dashboard/components-next/Conversation/ConversationCard/ConversationCard.vue +++ b/app/javascript/dashboard/components-next/Conversation/ConversationCard/ConversationCard.vue @@ -48,8 +48,8 @@ const inbox = computed(() => props.stateInbox); const inboxName = computed(() => inbox.value?.name); const inboxIcon = computed(() => { - const { phoneNumber, channelType } = inbox.value; - return getInboxIconByType(channelType, phoneNumber); + const { channelType, medium } = inbox.value; + return getInboxIconByType(channelType, medium); }); const lastActivityAt = computed(() => { diff --git a/app/javascript/dashboard/components-next/Inbox/InboxCard.vue b/app/javascript/dashboard/components-next/Inbox/InboxCard.vue index 90cc1ff53..958f25048 100644 --- a/app/javascript/dashboard/components-next/Inbox/InboxCard.vue +++ b/app/javascript/dashboard/components-next/Inbox/InboxCard.vue @@ -49,8 +49,8 @@ const isUnread = computed(() => !props.inboxItem?.readAt); const inbox = computed(() => props.stateInbox); const inboxIcon = computed(() => { - const { phoneNumber, channelType } = inbox.value; - return getInboxIconByType(channelType, phoneNumber); + const { channelType, medium } = inbox.value; + return getInboxIconByType(channelType, medium); }); const hasSlaThreshold = computed(() => { diff --git a/app/javascript/dashboard/components-next/NewConversation/helpers/composeConversationHelper.js b/app/javascript/dashboard/components-next/NewConversation/helpers/composeConversationHelper.js index 57e819245..cb79752f7 100644 --- a/app/javascript/dashboard/components-next/NewConversation/helpers/composeConversationHelper.js +++ b/app/javascript/dashboard/components-next/NewConversation/helpers/composeConversationHelper.js @@ -36,10 +36,11 @@ const transformInbox = ({ email, channelType, phoneNumber, + medium, ...rest }) => ({ id, - icon: getInboxIconByType(channelType, phoneNumber, 'line'), + icon: getInboxIconByType(channelType, medium, 'line'), label: generateLabelForContactableInboxesList({ name, email, diff --git a/app/javascript/dashboard/components-next/avatar/Avatar.vue b/app/javascript/dashboard/components-next/avatar/Avatar.vue index 08224995c..1b2ecbc05 100644 --- a/app/javascript/dashboard/components-next/avatar/Avatar.vue +++ b/app/javascript/dashboard/components-next/avatar/Avatar.vue @@ -183,7 +183,10 @@ watch(