From 909755c34057c4b6c5b9e47bbede5c9da1ebb736 Mon Sep 17 00:00:00 2001 From: iamsivin Date: Tue, 12 Nov 2024 22:02:26 +0530 Subject: [PATCH] chore: Clean up --- .../ContactCustomAttributes.vue | 12 ++++++-- .../ContactsSidebar/ContactHistory.vue | 7 ++++- .../Contacts/ContactsSidebar/ContactNotes.vue | 5 +++- .../CustomAttributes/DateAttribute.vue | 6 ++-- .../CustomAttributes/ListAttribute.vue | 6 ++-- .../CustomAttributes/OtherAttribute.vue | 28 +++++++++++++++---- .../dashboard/i18n/locale/en/contact.json | 7 ++++- 7 files changed, 54 insertions(+), 17 deletions(-) diff --git a/app/javascript/dashboard/components-next/Contacts/ContactsSidebar/ContactCustomAttributes.vue b/app/javascript/dashboard/components-next/Contacts/ContactsSidebar/ContactCustomAttributes.vue index f8ae821d7..d2e678241 100644 --- a/app/javascript/dashboard/components-next/Contacts/ContactsSidebar/ContactCustomAttributes.vue +++ b/app/javascript/dashboard/components-next/Contacts/ContactsSidebar/ContactCustomAttributes.vue @@ -20,6 +20,10 @@ const attributes = useMapGetter('attributes/getAttributesByModelType'); const contactAttributes = computed(() => attributes.value('contact_attribute')); +const hasContactAttributes = computed( + () => contactAttributes.value?.length > 0 +); + // Convert attribute key value from snake_case to camelCase const toCamelCase = str => str.toLowerCase().replace(/_([a-z])/g, (_, letter) => letter.toUpperCase()); @@ -79,11 +83,12 @@ const filteredUnusedAttributes = computed(() => { const unusedAttributesCount = computed(() => unusedAttributes.value?.length); const hasNoUnusedAttributes = computed(() => unusedAttributesCount.value === 0); +const hasNoUsedAttributes = computed(() => usedAttributes.value.length === 0); diff --git a/app/javascript/dashboard/components-next/Contacts/ContactsSidebar/ContactHistory.vue b/app/javascript/dashboard/components-next/Contacts/ContactsSidebar/ContactHistory.vue index 9e8722a07..595b2eedc 100644 --- a/app/javascript/dashboard/components-next/Contacts/ContactsSidebar/ContactHistory.vue +++ b/app/javascript/dashboard/components-next/Contacts/ContactsSidebar/ContactHistory.vue @@ -2,10 +2,12 @@ import { computed } from 'vue'; import { useMapGetter } from 'dashboard/composables/store'; import { useRoute } from 'vue-router'; +import { useI18n } from 'vue-i18n'; import Spinner from 'dashboard/components-next/spinner/Spinner.vue'; import ConversationCard from 'dashboard/components-next/Conversation/ConversationCard/ConversationCard.vue'; +const { t } = useI18n(); const route = useRoute(); const conversations = useMapGetter( @@ -32,7 +34,7 @@ const contactConversations = computed(() => > -
+
/>
+

+ {{ t('CONTACTS_LAYOUT.SIDEBAR.HISTORY.EMPTY_STATE') }} +

diff --git a/app/javascript/dashboard/components-next/Contacts/ContactsSidebar/ContactNotes.vue b/app/javascript/dashboard/components-next/Contacts/ContactsSidebar/ContactNotes.vue index 2f7478730..a51129483 100644 --- a/app/javascript/dashboard/components-next/Contacts/ContactsSidebar/ContactNotes.vue +++ b/app/javascript/dashboard/components-next/Contacts/ContactsSidebar/ContactNotes.vue @@ -87,7 +87,7 @@ useKeyboardEvents(keyboardEvents); >
-
+
+

+ {{ t('CONTACTS_LAYOUT.SIDEBAR.NOTES.EMPTY_STATE') }} +

diff --git a/app/javascript/dashboard/components-next/CustomAttributes/DateAttribute.vue b/app/javascript/dashboard/components-next/CustomAttributes/DateAttribute.vue index 5d0537cb4..78478b43d 100644 --- a/app/javascript/dashboard/components-next/CustomAttributes/DateAttribute.vue +++ b/app/javascript/dashboard/components-next/CustomAttributes/DateAttribute.vue @@ -77,7 +77,7 @@ const handleInputUpdate = async () => {