From 35bef21f83dfcaf31239c454013af311e7bef41d Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Mon, 15 Jun 2026 15:42:11 +0530 Subject: [PATCH 01/26] feat: add media view for contacts (#14393) --- app/javascript/dashboard/api/contacts.js | 6 + .../Contacts/ContactsDetailsLayout.vue | 18 +- .../ContactCustomAttributes.vue | 2 +- .../ContactsSidebar/ContactHistory.vue | 2 +- .../Contacts/ContactsSidebar/ContactMedia.vue | 108 +++++ .../Contacts/ContactsSidebar/ContactMerge.vue | 2 +- .../Contacts/ContactsSidebar/ContactNotes.vue | 2 +- .../SharedAttachments/Files.vue | 175 ++++++++ .../SharedAttachments/Media.vue | 305 +++++++++++++ .../components-next/message/constants.js | 6 + .../dashboard/i18n/locale/en/contact.json | 1 + .../i18n/locale/en/conversation.json | 3 +- .../contacts/pages/ContactManageView.vue | 9 +- .../dashboard/conversation/SharedFiles.vue | 399 ++---------------- .../store/modules/contacts/actions.js | 17 +- .../store/modules/contacts/getters.js | 1 + .../store/modules/contacts/mutations.js | 10 +- .../modules/specs/contacts/actions.spec.js | 44 ++ .../modules/specs/contacts/getters.spec.js | 18 + .../modules/specs/contacts/mutations.spec.js | 44 ++ .../dashboard/store/mutation-types.js | 1 + 21 files changed, 788 insertions(+), 385 deletions(-) create mode 100644 app/javascript/dashboard/components-next/Contacts/ContactsSidebar/ContactMedia.vue create mode 100644 app/javascript/dashboard/components-next/SharedAttachments/Files.vue create mode 100644 app/javascript/dashboard/components-next/SharedAttachments/Media.vue diff --git a/app/javascript/dashboard/api/contacts.js b/app/javascript/dashboard/api/contacts.js index c39a4cf9d..0b32c0bc2 100644 --- a/app/javascript/dashboard/api/contacts.js +++ b/app/javascript/dashboard/api/contacts.js @@ -40,6 +40,12 @@ class ContactAPI extends ApiClient { return axios.get(`${this.url}/${contactId}/conversations`, { params }); } + getAttachments(contactId, page = 1) { + return axios.get(`${this.url}/${contactId}/attachments`, { + params: { page }, + }); + } + getContactableInboxes(contactId) { return axios.get(`${this.url}/${contactId}/contactable_inboxes`); } diff --git a/app/javascript/dashboard/components-next/Contacts/ContactsDetailsLayout.vue b/app/javascript/dashboard/components-next/Contacts/ContactsDetailsLayout.vue index 351cc7071..44fafb6c5 100644 --- a/app/javascript/dashboard/components-next/Contacts/ContactsDetailsLayout.vue +++ b/app/javascript/dashboard/components-next/Contacts/ContactsDetailsLayout.vue @@ -128,9 +128,14 @@ const closeMobileSidebar = () => { @@ -179,9 +184,14 @@ const closeMobileSidebar = () => {
- +
+ +
+
+ +
diff --git a/app/javascript/dashboard/components-next/Contacts/ContactsSidebar/ContactCustomAttributes.vue b/app/javascript/dashboard/components-next/Contacts/ContactsSidebar/ContactCustomAttributes.vue index 039d2c709..1a9246e27 100644 --- a/app/javascript/dashboard/components-next/Contacts/ContactsSidebar/ContactCustomAttributes.vue +++ b/app/javascript/dashboard/components-next/Contacts/ContactsSidebar/ContactCustomAttributes.vue @@ -108,7 +108,7 @@ const hasNoUsedAttributes = computed(() => usedAttributes.value.length === 0);