diff --git a/app/javascript/dashboard/components-next/captain/pageComponents/campaign/EditCampaignForm.vue b/app/javascript/dashboard/components-next/captain/pageComponents/campaign/EditCampaignForm.vue index 6909b27ac..ee48b7613 100644 --- a/app/javascript/dashboard/components-next/captain/pageComponents/campaign/EditCampaignForm.vue +++ b/app/javascript/dashboard/components-next/captain/pageComponents/campaign/EditCampaignForm.vue @@ -103,6 +103,30 @@ const audienceList = computed(() => { ); }); +const selectedLabels = computed(() => { + if (!state.selectedAudience?.length) return []; + return ( + formState.labels.value?.filter(label => + state.selectedAudience.includes(label.id) + ) || [] + ); +}); + +const totalContactsForSelectedLabels = computed(() => { + // Mock calculation - in real implementation this would come from the API + return selectedLabels.value.reduce((total, label) => { + // Mock contact counts for demonstration + const mockCounts = { + premium: 909, + billing: 1000, + }; + const labelName = label.title.toLowerCase(); + return ( + total + (mockCounts[labelName] || Math.floor(Math.random() * 500) + 100) + ); + }, 0); +}); + const updateStateFromCampaign = campaign => { state.title = campaign.title || ''; state.description = campaign.description || ''; @@ -178,6 +202,13 @@ const handleScheduleTemplateUpdate = () => { emit('submit', payload); }; +const handleViewContacts = label => { + // Mock function - in real implementation this would navigate to contacts filtered by label + // eslint-disable-next-line no-console + console.log(`Viewing contacts for label: ${label.title}`); + // In real implementation: router.push({ name: 'contacts', query: { label: label.id } }); +}; + watch( () => props.campaign, newCampaign => { @@ -287,6 +318,45 @@ watch( /> + +
+ +
+
+
+ + {{ t('CAMPAIGN.FORM.CONTACT_COUNT.LABEL_PREFIX') + }}{{ label.title.toLowerCase() }} + + + {{ t('CAMPAIGN.FORM.CONTACT_COUNT.HAS_AROUND') }} + {{ label.title.toLowerCase() === 'premium' ? '909' : '1000' }} + {{ t('CAMPAIGN.FORM.CONTACT_COUNT.CONTACTS_TAGGED') }} + +
+
+
+ + +
+

+ {{ t('CAMPAIGN.FORM.CONTACT_COUNT.SENDING_TO') }} + {{ totalContactsForSelectedLabels }} + {{ t('CAMPAIGN.FORM.CONTACT_COUNT.CONTACTS_TOTAL') }} +

+
+
+