diff --git a/app/javascript/dashboard/components-next/NewConversation/components/EmailOptions.vue b/app/javascript/dashboard/components-next/NewConversation/components/EmailOptions.vue index ded9375e5..96edddbef 100644 --- a/app/javascript/dashboard/components-next/NewConversation/components/EmailOptions.vue +++ b/app/javascript/dashboard/components-next/NewConversation/components/EmailOptions.vue @@ -7,54 +7,25 @@ import Button from 'dashboard/components-next/button/Button.vue'; import InlineInput from 'dashboard/components-next/inline-input/InlineInput.vue'; const props = defineProps({ - subject: { - type: String, - required: true, - }, - ccEmails: { - type: String, - required: true, - }, - bccEmails: { - type: String, - required: true, - }, - contacts: { - type: Array, - required: true, - }, - showCcEmailsDropdown: { - type: Boolean, - required: true, - }, - showBccEmailsDropdown: { - type: Boolean, - required: true, - }, - showBccInput: { - type: Boolean, - default: false, - }, - isLoading: { - type: Boolean, - default: false, - }, - hasErrors: { - type: Boolean, - default: false, - }, + contacts: { type: Array, required: true }, + showCcEmailsDropdown: { type: Boolean, required: false }, + showBccEmailsDropdown: { type: Boolean, required: false }, + showBccInput: { type: Boolean, default: false }, + isLoading: { type: Boolean, default: false }, + hasErrors: { type: Boolean, default: false }, }); const emit = defineEmits([ - 'update:ccEmails', - 'update:bccEmails', - 'update:subject', 'searchCcEmails', 'searchBccEmails', 'toggleBcc', 'updateDropdown', ]); +const subject = defineModel('subject', { type: String, default: '' }); +const ccEmails = defineModel('ccEmails', { type: String, default: '' }); +const bccEmails = defineModel('bccEmails', { type: String, default: '' }); + const { t } = useI18n(); // Convert string to array for TagInput @@ -79,11 +50,11 @@ const contactEmailsList = computed(() => { // Handle updates from TagInput and convert array back to string const handleCcUpdate = value => { - emit('update:ccEmails', value.join(',')); + ccEmails.value = value.join(','); }; const handleBccUpdate = value => { - emit('update:bccEmails', value.join(',')); + bccEmails.value = value.join(','); }; @@ -91,7 +62,7 @@ const handleBccUpdate = value => {
{ ? 'placeholder:!text-n-ruby-9 dark:placeholder:!text-n-ruby-9' : '' " - @update:model-value="emit('update:subject', $event)" />
diff --git a/app/javascript/dashboard/components-next/NewConversation/components/MessageEditor.vue b/app/javascript/dashboard/components-next/NewConversation/components/MessageEditor.vue index 6842c7b9e..ca54f7eca 100644 --- a/app/javascript/dashboard/components-next/NewConversation/components/MessageEditor.vue +++ b/app/javascript/dashboard/components-next/NewConversation/components/MessageEditor.vue @@ -5,10 +5,6 @@ import Editor from 'dashboard/components-next/Editor/Editor.vue'; import TextArea from 'dashboard/components-next/textarea/TextArea.vue'; defineProps({ - modelValue: { - type: String, - required: true, - }, isEmailOrWebWidgetInbox: { type: Boolean, required: true, @@ -23,9 +19,12 @@ defineProps({ }, }); -const emit = defineEmits(['update:modelValue']); - const { t } = useI18n(); + +const modelValue = defineModel({ + type: String, + default: '', +});