chore: boilerplate frontend code
This commit is contained in:
parent
9cd86e99c3
commit
7d2ccc2e58
@ -10,6 +10,7 @@
|
||||
"access_token",
|
||||
"column_break_lwcw",
|
||||
"last_synced_at",
|
||||
"enabled",
|
||||
"facebook_tab",
|
||||
"facebook_page",
|
||||
"column_break_uxlr",
|
||||
@ -60,12 +61,18 @@
|
||||
"label": "Facebook Lead Form",
|
||||
"options": "Facebook Lead Form",
|
||||
"unique": 1
|
||||
},
|
||||
{
|
||||
"default": "1",
|
||||
"fieldname": "enabled",
|
||||
"fieldtype": "Check",
|
||||
"label": "Enabled?"
|
||||
}
|
||||
],
|
||||
"grid_page_length": 50,
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2025-09-29 19:03:14.804026",
|
||||
"modified": "2025-09-29 19:54:24.841414",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Lead Syncing",
|
||||
"name": "Lead Sync Source",
|
||||
|
||||
@ -26,6 +26,7 @@ class LeadSyncSource(Document):
|
||||
from frappe.types import DF
|
||||
|
||||
access_token: DF.SmallText | None
|
||||
enabled: DF.Check
|
||||
facebook_lead_form: DF.Link | None
|
||||
facebook_page: DF.Link | None
|
||||
last_synced_at: DF.Datetime | None
|
||||
|
||||
5
frontend/components.d.ts
vendored
5
frontend/components.d.ts
vendored
@ -103,6 +103,7 @@ declare module 'vue' {
|
||||
DurationIcon: typeof import('./src/components/Icons/DurationIcon.vue')['default']
|
||||
EditEmailTemplate: typeof import('./src/components/Settings/EmailTemplate/EditEmailTemplate.vue')['default']
|
||||
EditIcon: typeof import('./src/components/Icons/EditIcon.vue')['default']
|
||||
EditLeadSyncSource: typeof import('./src/components/Settings/LeadSyncing/EditLeadSyncSource.vue')['default']
|
||||
EditValueModal: typeof import('./src/components/Modals/EditValueModal.vue')['default']
|
||||
Email2Icon: typeof import('./src/components/Icons/Email2Icon.vue')['default']
|
||||
EmailAccountCard: typeof import('./src/components/Settings/EmailAccountCard.vue')['default']
|
||||
@ -178,6 +179,9 @@ declare module 'vue' {
|
||||
LeadModal: typeof import('./src/components/Modals/LeadModal.vue')['default']
|
||||
LeadsIcon: typeof import('./src/components/Icons/LeadsIcon.vue')['default']
|
||||
LeadsListView: typeof import('./src/components/ListViews/LeadsListView.vue')['default']
|
||||
LeadSyncSettings: typeof import('./src/components/Settings/LeadSyncing/LeadSyncSettings.vue')['default']
|
||||
LeadSyncSourcePage: typeof import('./src/components/Settings/LeadSyncing/LeadSyncSourcePage.vue')['default']
|
||||
LeadSyncSources: typeof import('./src/components/Settings/LeadSyncing/LeadSyncSources.vue')['default']
|
||||
LightningIcon: typeof import('./src/components/Icons/LightningIcon.vue')['default']
|
||||
Link: typeof import('./src/components/Controls/Link.vue')['default']
|
||||
LinkedDocsListView: typeof import('./src/components/ListViews/LinkedDocsListView.vue')['default']
|
||||
@ -205,6 +209,7 @@ declare module 'vue' {
|
||||
MultipleAvatar: typeof import('./src/components/MultipleAvatar.vue')['default']
|
||||
MuteIcon: typeof import('./src/components/Icons/MuteIcon.vue')['default']
|
||||
NewEmailTemplate: typeof import('./src/components/Settings/EmailTemplate/NewEmailTemplate.vue')['default']
|
||||
NewLeadSyncSource: typeof import('./src/components/Settings/LeadSyncing/NewLeadSyncSource.vue')['default']
|
||||
NoteArea: typeof import('./src/components/Activities/NoteArea.vue')['default']
|
||||
NoteIcon: typeof import('./src/components/Icons/NoteIcon.vue')['default']
|
||||
NoteModal: typeof import('./src/components/Modals/NoteModal.vue')['default']
|
||||
|
||||
@ -0,0 +1 @@
|
||||
<template></template>
|
||||
@ -0,0 +1,50 @@
|
||||
<template>
|
||||
<NewLeadSyncSource
|
||||
v-if="step === 'new-source'"
|
||||
:templateData="source"
|
||||
@updateStep="updateStep"
|
||||
/>
|
||||
<LeadSyncSources
|
||||
v-else-if="step === 'source-list'"
|
||||
@updateStep="updateStep"
|
||||
/>
|
||||
<EditLeadSyncSource
|
||||
v-else-if="step === 'edit-source'"
|
||||
:templateData="source"
|
||||
@updateStep="updateStep"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import EditLeadSyncSource from "./EditLeadSyncSource.vue"
|
||||
import LeadSyncSources from "./LeadSyncSources.vue"
|
||||
import NewLeadSyncSource from "./NewLeadSyncSource.vue";
|
||||
|
||||
import { createListResource } from 'frappe-ui'
|
||||
import { provide, ref } from 'vue'
|
||||
|
||||
const step = ref('source-list')
|
||||
const source = ref(null)
|
||||
|
||||
const sources = createListResource({
|
||||
type: 'list',
|
||||
doctype: 'Lead Sync Source',
|
||||
cache: 'lead_sync_sources',
|
||||
fields: [
|
||||
'name',
|
||||
'enabled',
|
||||
'type',
|
||||
'last_synced_at'
|
||||
],
|
||||
auto: true,
|
||||
orderBy: 'modified desc',
|
||||
pageLength: 20,
|
||||
})
|
||||
|
||||
provide('sources', sources)
|
||||
|
||||
function updateStep(newStep, data) {
|
||||
step.value = newStep
|
||||
source.value = data
|
||||
}
|
||||
</script>
|
||||
@ -0,0 +1,8 @@
|
||||
<template>
|
||||
<pre>{{ JSON.stringify(sources, null, 2) }}</pre>
|
||||
</template>
|
||||
<script setup>
|
||||
import { inject } from 'vue';
|
||||
|
||||
const sources = inject('sources')
|
||||
</script>
|
||||
@ -0,0 +1 @@
|
||||
<template></template>
|
||||
@ -60,6 +60,7 @@ import ProfileSettings from '@/components/Settings/ProfileSettings.vue'
|
||||
import WhatsAppSettings from '@/components/Settings/WhatsAppSettings.vue'
|
||||
import ERPNextSettings from '@/components/Settings/ERPNextSettings.vue'
|
||||
import HelpdeskSettings from '@/components/Settings/HelpdeskSettings.vue'
|
||||
import LeadSyncSourcePage from '@/components/Settings/LeadSyncing/LeadSyncSourcePage.vue'
|
||||
import BrandSettings from '@/components/Settings/BrandSettings.vue'
|
||||
import HomeActions from '@/components/Settings/HomeActions.vue'
|
||||
import ForecastingSettings from '@/components/Settings/ForecastingSettings.vue'
|
||||
@ -204,6 +205,12 @@ const tabs = computed(() => {
|
||||
component: markRaw(HelpdeskSettings),
|
||||
condition: () => isManager(),
|
||||
},
|
||||
{
|
||||
label: __('Lead Syncing'),
|
||||
icon: 'refresh-cw',
|
||||
component: markRaw(LeadSyncSourcePage),
|
||||
condition: () => isManager(),
|
||||
},
|
||||
],
|
||||
condition: () => isManager() || isTelephonyAgent(),
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user