diff --git a/frontend/src/components/Settings/LeadSyncing/EditLeadSyncSource.vue b/frontend/src/components/Settings/LeadSyncing/EditLeadSyncSource.vue index a0616790..978b7dba 100644 --- a/frontend/src/components/Settings/LeadSyncing/EditLeadSyncSource.vue +++ b/frontend/src/components/Settings/LeadSyncing/EditLeadSyncSource.vue @@ -12,26 +12,66 @@
-
- +
+ {{ __('Enabled') }}
+ + +
+
+
+ +
+
+
+ +
+ + + +
+ + +
+ +
\ No newline at end of file diff --git a/frontend/src/components/Settings/LeadSyncing/LeadSyncSourcePage.vue b/frontend/src/components/Settings/LeadSyncing/LeadSyncSourcePage.vue index cff6a3fe..69d4e04a 100644 --- a/frontend/src/components/Settings/LeadSyncing/LeadSyncSourcePage.vue +++ b/frontend/src/components/Settings/LeadSyncing/LeadSyncSourcePage.vue @@ -36,7 +36,8 @@ const sources = createListResource({ 'name', 'enabled', 'type', - 'last_synced_at' + 'last_synced_at', + 'facebook_lead_form' ], auto: true, orderBy: 'modified desc', diff --git a/frontend/src/components/Settings/LeadSyncing/NewLeadSyncSource.vue b/frontend/src/components/Settings/LeadSyncing/NewLeadSyncSource.vue index 5fc29719..889916ad 100644 --- a/frontend/src/components/Settings/LeadSyncing/NewLeadSyncSource.vue +++ b/frontend/src/components/Settings/LeadSyncing/NewLeadSyncSource.vue @@ -38,17 +38,19 @@ -
- -
- -
- -
+
+
+ +
+ +
+ +
+
@@ -71,7 +73,7 @@ import { ref, inject, onMounted, reactive, watch, computed } from "vue"; import { FormControl, toast, call } from "frappe-ui"; import CircleAlert from "~icons/lucide/circle-alert"; -import { supportedSourceTypes } from "./leadSyncSourceConfig"; +import { supportedSourceTypes, fbSourceFields } from "./leadSyncSourceConfig"; import EmailProviderIcon from "../EmailProviderIcon.vue"; const syncSource = ref({ @@ -101,20 +103,6 @@ const selectedSourceType = ref(supportedSourceTypes[0]); syncSource.value.type = selectedSourceType.value.name; const sources = inject("sources"); -const fbSourceFields = [ - { - name: "name", - label: __("Name"), - type: "text", - placeholder: __("Add a name for your source"), - }, - { - name: "access_token", - label: __("Access Token"), - type: "password", - placeholder: __("Enter your Facebook Access Token"), - }, -]; function handleSelect(sourceType) { selectedSourceType.value = sourceType; @@ -180,6 +168,10 @@ const leadFormsForSelectedPage = computed(() => { })); }); +watch(syncSource.value.facebook_page, () => { + syncSource.value.facebook_lead_form = null; +}); + onMounted(() => { if (props.sourceData?.name) { Object.assign(syncSource.value, props.sourceData); diff --git a/frontend/src/components/Settings/LeadSyncing/leadSyncSourceConfig.js b/frontend/src/components/Settings/LeadSyncing/leadSyncSourceConfig.js index caec926f..d899311d 100644 --- a/frontend/src/components/Settings/LeadSyncing/leadSyncSourceConfig.js +++ b/frontend/src/components/Settings/LeadSyncing/leadSyncSourceConfig.js @@ -13,4 +13,19 @@ export const supportedSourceTypes = [ export const sourceIcon = { 'Facebook': LogoFacebook -} \ No newline at end of file +} + +export const fbSourceFields = [ + { + name: "name", + label: __("Name"), + type: "text", + placeholder: __("Add a name for your source"), + }, + { + name: "access_token", + label: __("Access Token"), + type: "password", + placeholder: __("Enter your Facebook Access Token"), + } +];