feat: add allow_bots checkbox to live chat campaign form

This commit is contained in:
Shivam Mishra
2025-11-05 17:28:12 +05:30
parent f245f4b2a4
commit bff1c07164
2 changed files with 13 additions and 1 deletions
@@ -47,6 +47,7 @@ const initialState = {
senderId: 0,
enabled: true,
triggerOnlyDuringBusinessHours: false,
allowBots: false,
endPoint: '',
timeOnPage: 10,
};
@@ -139,6 +140,7 @@ const prepareCampaignDetails = () => ({
sender_id: state.senderId || null,
enabled: state.enabled,
trigger_only_during_business_hours: state.triggerOnlyDuringBusinessHours,
allow_bots: state.allowBots,
trigger_rules: {
url: state.endPoint,
time_on_page: state.timeOnPage,
@@ -166,6 +168,7 @@ const updateStateFromCampaign = campaign => {
sender,
enabled,
trigger_only_during_business_hours: triggerOnlyDuringBusinessHours,
allow_bots: allowBots,
trigger_rules: { url: endPoint, time_on_page: timeOnPage },
} = campaign;
@@ -176,6 +179,7 @@ const updateStateFromCampaign = campaign => {
senderId: sender?.id ?? 0,
enabled,
triggerOnlyDuringBusinessHours,
allowBots,
endPoint,
timeOnPage,
});
@@ -295,6 +299,13 @@ defineExpose({ prepareCampaignDetails, isSubmitDisabled });
}}
</span>
</label>
<label class="flex items-center gap-2">
<input v-model="state.allowBots" type="checkbox" />
<span class="text-sm font-medium text-n-slate-12">
{{ t('CAMPAIGN.LIVE_CHAT.CREATE.FORM.OTHER_PREFERENCES.ALLOW_BOTS') }}
</span>
</label>
</fieldset>
<div
@@ -57,7 +57,8 @@
"OTHER_PREFERENCES": {
"TITLE": "Other preferences",
"ENABLED": "Enable campaign",
"TRIGGER_ONLY_BUSINESS_HOURS": "Trigger only during business hours"
"TRIGGER_ONLY_BUSINESS_HOURS": "Trigger only during business hours",
"ALLOW_BOTS": "Allow bots to handle conversations"
},
"BUTTONS": {
"CREATE": "Create",