diff --git a/app/javascript/dashboard/components-next/Contacts/ContactsCard/ContactsCard.vue b/app/javascript/dashboard/components-next/Contacts/ContactsCard/ContactsCard.vue index 485566c38..92d26e90d 100644 --- a/app/javascript/dashboard/components-next/Contacts/ContactsCard/ContactsCard.vue +++ b/app/javascript/dashboard/components-next/Contacts/ContactsCard/ContactsCard.vue @@ -44,8 +44,6 @@ const ROUTE_MAPPINGS = { }; const onClickViewDetails = async () => { - await store.dispatch('contacts/show', { id: props.id }); - const dynamicRouteName = ROUTE_MAPPINGS[route.name] || 'contacts_dashboard_edit_index'; diff --git a/app/javascript/dashboard/components-next/Contacts/ContactsForm/ComposeConversation.vue b/app/javascript/dashboard/components-next/Contacts/ContactsForm/ComposeConversation.vue new file mode 100644 index 000000000..aa1ad5165 --- /dev/null +++ b/app/javascript/dashboard/components-next/Contacts/ContactsForm/ComposeConversation.vue @@ -0,0 +1,87 @@ + + + + + + + + + diff --git a/app/javascript/dashboard/components-next/Contacts/ContactsForm/CreateNewContactDialog.vue b/app/javascript/dashboard/components-next/Contacts/ContactsForm/CreateNewContactDialog.vue index 6bdec6b8d..add91350d 100644 --- a/app/javascript/dashboard/components-next/Contacts/ContactsForm/CreateNewContactDialog.vue +++ b/app/javascript/dashboard/components-next/Contacts/ContactsForm/CreateNewContactDialog.vue @@ -43,7 +43,7 @@ defineExpose({ dialogRef }); { @more="emit('more')" /> - + + + + + diff --git a/app/javascript/dashboard/components-next/HelpCenter/Pages/ArticleEditorPage/ArticleEditorProperties.vue b/app/javascript/dashboard/components-next/HelpCenter/Pages/ArticleEditorPage/ArticleEditorProperties.vue index 0a49be942..a237c1c1d 100644 --- a/app/javascript/dashboard/components-next/HelpCenter/Pages/ArticleEditorPage/ArticleEditorProperties.vue +++ b/app/javascript/dashboard/components-next/HelpCenter/Pages/ArticleEditorPage/ArticleEditorProperties.vue @@ -110,7 +110,7 @@ onMounted(() => { custom-label-class="min-w-[120px]" /> - + diff --git a/app/javascript/dashboard/components-next/NewConversation/ComposeNewConversation.vue b/app/javascript/dashboard/components-next/NewConversation/ComposeNewConversation.vue new file mode 100644 index 000000000..2aa848a88 --- /dev/null +++ b/app/javascript/dashboard/components-next/NewConversation/ComposeNewConversation.vue @@ -0,0 +1,420 @@ + + + + + + + + + + + + + + + + + diff --git a/app/javascript/dashboard/components-next/NewConversation/components/ActionButtons.vue b/app/javascript/dashboard/components-next/NewConversation/components/ActionButtons.vue new file mode 100644 index 000000000..c15b81bd3 --- /dev/null +++ b/app/javascript/dashboard/components-next/NewConversation/components/ActionButtons.vue @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/javascript/dashboard/components-next/NewConversation/components/ContactSelector.vue b/app/javascript/dashboard/components-next/NewConversation/components/ContactSelector.vue new file mode 100644 index 000000000..18c6292f9 --- /dev/null +++ b/app/javascript/dashboard/components-next/NewConversation/components/ContactSelector.vue @@ -0,0 +1,107 @@ + + + + + + + {{ 'To :' }} + + + + + {{ isCreatingContact ? 'Creating contact...' : selectedContactLabel }} + + + + + + + diff --git a/app/javascript/dashboard/components-next/NewConversation/components/EmailOptions.vue b/app/javascript/dashboard/components-next/NewConversation/components/EmailOptions.vue new file mode 100644 index 000000000..e8343bf89 --- /dev/null +++ b/app/javascript/dashboard/components-next/NewConversation/components/EmailOptions.vue @@ -0,0 +1,149 @@ + + + + + + + + + + {{ 'Cc :' }} + + + + + + + + + {{ 'Bcc :' }} + + + + + diff --git a/app/javascript/dashboard/components-next/NewConversation/components/InboxSelector.vue b/app/javascript/dashboard/components-next/NewConversation/components/InboxSelector.vue new file mode 100644 index 000000000..84d964984 --- /dev/null +++ b/app/javascript/dashboard/components-next/NewConversation/components/InboxSelector.vue @@ -0,0 +1,100 @@ + + + + + + {{ 'Via inbox :' }} + + + + {{ targetInboxLabel }} + + + + + + + + + diff --git a/app/javascript/dashboard/components-next/NewConversation/components/MessageEditor.vue b/app/javascript/dashboard/components-next/NewConversation/components/MessageEditor.vue new file mode 100644 index 000000000..d10a26dcc --- /dev/null +++ b/app/javascript/dashboard/components-next/NewConversation/components/MessageEditor.vue @@ -0,0 +1,42 @@ + + + + + + + + + + diff --git a/app/javascript/dashboard/components-next/NewConversation/components/WhatsAppOptions.vue b/app/javascript/dashboard/components-next/NewConversation/components/WhatsAppOptions.vue new file mode 100644 index 000000000..59af3723c --- /dev/null +++ b/app/javascript/dashboard/components-next/NewConversation/components/WhatsAppOptions.vue @@ -0,0 +1,113 @@ + + + + + + + + + + + + {{ template.name }} + + {{ getTemplateBody(template) }} + + + + + {{ 'No templates found' }} + + + + + + diff --git a/app/javascript/dashboard/components-next/NewConversation/components/WhatsappTemplateParser.vue b/app/javascript/dashboard/components-next/NewConversation/components/WhatsappTemplateParser.vue new file mode 100644 index 000000000..5b3cee85a --- /dev/null +++ b/app/javascript/dashboard/components-next/NewConversation/components/WhatsappTemplateParser.vue @@ -0,0 +1,128 @@ + + + + + + {{ `WhatsApp template: ${template.name}` }} + + {{ processedString }} + + + {{ 'Variables' }} + + + + {{ key }} + + + + + + + + + diff --git a/app/javascript/dashboard/components-next/dropdown-menu/DropdownMenu.vue b/app/javascript/dashboard/components-next/dropdown-menu/DropdownMenu.vue index 0b24b597d..cc4c3c4bf 100644 --- a/app/javascript/dashboard/components-next/dropdown-menu/DropdownMenu.vue +++ b/app/javascript/dashboard/components-next/dropdown-menu/DropdownMenu.vue @@ -25,6 +25,10 @@ const props = defineProps({ type: String, default: '', }, + isSearching: { + type: Boolean, + default: false, + }, }); const emit = defineEmits(['action']); @@ -81,7 +85,6 @@ onMounted(() => { }" :disabled="item.disabled" @click="handleAction(item)" - @keydown.enter="handleAction(item)" > { v-if="filteredMenuItems.length === 0" class="text-sm text-n-slate-11 px-2 py-1.5" > - {{ t('DROPDOWN_MENU.EMPTY_STATE') }} + {{ + isSearching + ? t('DROPDOWN_MENU.SEARCHING') + : t('DROPDOWN_MENU.EMPTY_STATE') + }} diff --git a/app/javascript/dashboard/components-next/inline-input/InlineInput.vue b/app/javascript/dashboard/components-next/inline-input/InlineInput.vue index 7731e84bb..c74cf3889 100644 --- a/app/javascript/dashboard/components-next/inline-input/InlineInput.vue +++ b/app/javascript/dashboard/components-next/inline-input/InlineInput.vue @@ -1,5 +1,7 @@ @@ -49,7 +78,7 @@ const onEnterPress = () => { v-if="label" :for="id" :class="customLabelClass" - class="mb-0.5 text-sm font-medium text-gray-900 dark:text-gray-50" + class="mb-0.5 text-sm font-medium text-n-slate-11" > {{ label }} @@ -57,13 +86,15 @@ const onEnterPress = () => { diff --git a/app/javascript/dashboard/components-next/taginput/TagInput.vue b/app/javascript/dashboard/components-next/taginput/TagInput.vue index 4ebd0f7c7..388b44541 100644 --- a/app/javascript/dashboard/components-next/taginput/TagInput.vue +++ b/app/javascript/dashboard/components-next/taginput/TagInput.vue @@ -1,49 +1,156 @@ - + - - - {{ tag }} - - - - {{ + tag + }} + - + + + + + diff --git a/app/javascript/dashboard/components-next/textarea/TextArea.vue b/app/javascript/dashboard/components-next/textarea/TextArea.vue index 5e5860fad..16e0fe052 100644 --- a/app/javascript/dashboard/components-next/textarea/TextArea.vue +++ b/app/javascript/dashboard/components-next/textarea/TextArea.vue @@ -179,7 +179,7 @@ onMounted(() => { }" :disabled="disabled" rows="1" - class="flex w-full reset-base text-sm p-0 !rounded-none !bg-transparent dark:!bg-transparent !border-0 !mb-0 placeholder:text-n-slate-11 dark:placeholder:text-n-slate-11 text-n-slate-12 dark:text-n-slate-12 disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-slate-25 dark:disabled:bg-slate-900" + class="flex w-full reset-base text-sm p-0 !rounded-none !bg-transparent dark:!bg-transparent !border-0 !mb-0 placeholder:text-n-slate-10 dark:placeholder:text-n-slate-10 text-n-slate-12 dark:text-n-slate-12 disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-slate-25 dark:disabled:bg-slate-900" @input="handleInput" @focus="handleFocus" @blur="handleBlur" diff --git a/app/javascript/dashboard/i18n/locale/en/components.json b/app/javascript/dashboard/i18n/locale/en/components.json index 7a0533cef..c784c3fac 100644 --- a/app/javascript/dashboard/i18n/locale/en/components.json +++ b/app/javascript/dashboard/i18n/locale/en/components.json @@ -10,7 +10,8 @@ }, "DROPDOWN_MENU": { "SEARCH_PLACEHOLDER": "Search...", - "EMPTY_STATE": "No results found." + "EMPTY_STATE": "No results found.", + "SEARCHING": "Searching..." }, "DIALOG": { "BUTTONS": { diff --git a/app/javascript/dashboard/i18n/locale/en/contact.json b/app/javascript/dashboard/i18n/locale/en/contact.json index 729bdb3ce..cf56757d4 100644 --- a/app/javascript/dashboard/i18n/locale/en/contact.json +++ b/app/javascript/dashboard/i18n/locale/en/contact.json @@ -393,6 +393,7 @@ "SEARCH_TITLE": "Search contacts", "SEARCH_PLACEHOLDER": "Search...", "MESSAGE_BUTTON": "Message", + "SEND_MESSAGE": "Send message", "BREADCRUMB": { "CONTACTS": "Contacts" }, diff --git a/app/javascript/dashboard/routes/dashboard/contact/pages/EditContactsPageRouteView.vue b/app/javascript/dashboard/routes/dashboard/contact/pages/EditContactsPageRouteView.vue index 3a8d50d82..7e13351eb 100644 --- a/app/javascript/dashboard/routes/dashboard/contact/pages/EditContactsPageRouteView.vue +++ b/app/javascript/dashboard/routes/dashboard/contact/pages/EditContactsPageRouteView.vue @@ -77,7 +77,11 @@ const goToContactsList = () => { const fetchActiveContact = async () => { if (route.params.contactId) { - store.dispatch('contacts/show', { id: route.params.contactId }); + await store.dispatch('contacts/show', { id: route.params.contactId }); + await store.dispatch( + 'contacts/fetchContactableInbox', + route.params.contactId + ); } }; @@ -112,7 +116,7 @@ onMounted(() => { class="flex flex-col justify-between flex-1 h-full m-0 overflow-auto bg-n-background" > { return inbox.inbox?.id && inbox.inbox?.id === this.targetInbox?.id; @@ -152,7 +152,7 @@ export default { }, }, showNoInboxAlert() { - if (!this.contact.contactableInboxes) { + if (!this.contact.contact_inboxes) { return false; } return this.inboxes.length === 0 && !this.uiFlags.isFetchingInboxes; @@ -166,7 +166,7 @@ export default { : this.$t('CONVERSATION.FOOTER.ENABLE_SIGN_TOOLTIP'); }, inboxes() { - const inboxList = this.contact.contactableInboxes || []; + const inboxList = this.contact.contact_inboxes || []; return inboxList.map(inbox => ({ ...inbox.inbox, sourceId: inbox.source_id, diff --git a/app/javascript/dashboard/store/modules/contacts/actions.js b/app/javascript/dashboard/store/modules/contacts/actions.js index 0169f2f2b..aacde61e6 100644 --- a/app/javascript/dashboard/store/modules/contacts/actions.js +++ b/app/javascript/dashboard/store/modules/contacts/actions.js @@ -195,8 +195,8 @@ export const actions = { try { const response = await ContactAPI.getContactableInboxes(id); const contact = { - id, - contactableInboxes: response.data.payload, + id: Number(id), + contact_inboxes: response.data.payload, }; commit(types.SET_CONTACT_ITEM, contact); } catch (error) {
+ {{ getTemplateBody(template) }} +
+ {{ 'No templates found' }} +
{{ processedString }}