-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathlead.view.ts
More file actions
121 lines (119 loc) · 3.19 KB
/
Copy pathlead.view.ts
File metadata and controls
121 lines (119 loc) · 3.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.
import { defineView } from '@objectstack/spec';
export const LeadViews = defineView({
list: {
label: 'All Leads',
type: 'grid',
data: { provider: 'object', object: 'crm_lead' },
columns: [
{ field: 'name' },
{ field: 'company' },
{ field: 'status' },
{ field: 'source' },
{ field: 'lead_score' },
{ field: 'assigned_to' },
{ field: 'email' },
],
},
listViews: {
all: {
label: 'All Leads',
data: { provider: 'object', object: 'crm_lead' },
type: 'grid',
columns: [
{ field: 'name' },
{ field: 'company' },
{ field: 'status' },
{ field: 'source' },
{ field: 'lead_score' },
{ field: 'assigned_to' },
{ field: 'email' },
],
},
pipeline: {
label: 'Lead Pipeline (Kanban)',
type: 'kanban',
data: { provider: 'object', object: 'crm_lead' },
columns: ['name', 'company', 'source', 'lead_score'],
kanban: {
groupByField: 'status',
summarizeField: 'lead_score',
columns: ['name', 'company', 'source', 'lead_score'],
},
},
},
formViews: {
/**
* PUBLIC / ANONYMOUS — Web-to-Lead.
*
* Hosted at GET/POST `/api/v1/forms/contact-us` (+ `/submit`). An
* unauthenticated visitor — or an `EmbeddableForm` iframe on a marketing
* site — submits it to create a `crm_lead`. `sharing.allowAnonymous` opens
* the public endpoint; the `guest_portal` profile (INSERT-only on crm_lead)
* authorizes the write. The lead object's own defaults/hooks stamp internal
* fields (status, owner, score).
*/
web_to_lead: {
type: 'simple',
data: { provider: 'object', object: 'crm_lead' },
sections: [
{
label: 'Contact us',
columns: 1,
fields: [
{ field: 'name', required: true },
{ field: 'company' },
{ field: 'email', required: true },
{ field: 'phone' },
{ field: 'title' },
],
},
],
sharing: {
enabled: true,
allowAnonymous: true,
publicLink: '/forms/contact-us',
},
},
default: {
type: 'simple',
sections: [
{
label: 'Lead Information',
columns: 2,
fields: [
{ field: 'name', required: true },
{ field: 'company' },
{ field: 'email' },
{ field: 'phone' },
{ field: 'title' },
{ field: 'source' },
],
},
{
label: 'Qualification',
columns: 2,
fields: [
{ field: 'status', required: true },
{ field: 'lead_score' },
{ field: 'assigned_to' },
{ field: 'account' },
],
},
{
label: 'Conversion',
columns: 2,
fields: [
{ field: 'converted_opportunity' },
{ field: 'is_closed' },
],
},
{
label: 'Notes',
columns: 1,
fields: [{ field: 'notes' }],
},
],
},
},
});