Skip to content

Commit 28b0df9

Browse files
author
lucas
committed
add leadOwner field to sale-hub & lead-form
1 parent 7e6313e commit 28b0df9

6 files changed

+281
-568
lines changed

packages/drafts-realm/LeadForm/ca5a2eb1-fb9e-4467-a7aa-54f3ec316ee9.json

+7
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@
3232
"industry": "Banking",
3333
"thumbnailURL": null
3434
},
35+
"relationships": {
36+
"leadOwner": {
37+
"links": {
38+
"self": "../MatrixUser/e65ae338-64a1-4a97-9ae8-9b9e773a7095"
39+
}
40+
}
41+
},
3542
"meta": {
3643
"adoptsFrom": {
3744
"module": "../lead-form",

packages/drafts-realm/LeadForm/fe2e7e4c-796c-4a59-93a0-c2463a10ffdc.json

+8-1
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,18 @@
3232
"industry": "Banking",
3333
"thumbnailURL": null
3434
},
35+
"relationships": {
36+
"leadOwner": {
37+
"links": {
38+
"self": "../CardDef/7298c9c6-2964-41a0-87f7-42127a16e12b"
39+
}
40+
}
41+
},
3542
"meta": {
3643
"adoptsFrom": {
3744
"module": "../lead-form",
3845
"name": "LeadForm"
3946
}
4047
}
4148
}
42-
}
49+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"data": {
3+
"type": "card",
4+
"attributes": {
5+
"username": "law bom bom",
6+
"email": {
7+
"value": "lawbombom@gmail.com"
8+
},
9+
"description": null,
10+
"thumbnailURL": null
11+
},
12+
"meta": {
13+
"adoptsFrom": {
14+
"module": "../matrix-user",
15+
"name": "MatrixUser"
16+
}
17+
}
18+
}
19+
}

packages/drafts-realm/SaleHub/bcbf2e7d-16ad-41e0-95a4-03dc988809e5.json

+28-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"title": "Lead Form - lawbombom",
1313
"website": "lawbom.com",
1414
"description": "this is lead-form",
15-
"leadStatus": "Unqualified",
15+
"leadStatus": "Qualified",
1616
"phone": "010381997",
1717
"email": "lawbombom@gmail.com",
1818
"addressInfo": {
@@ -120,7 +120,7 @@
120120
"subject": "task b",
121121
"dueDate": "2024-06-27",
122122
"comments": null,
123-
"isCompleted": false
123+
"isCompleted": true
124124
}
125125
},
126126
{
@@ -140,13 +140,29 @@
140140
"comments": null,
141141
"isCompleted": false
142142
}
143+
},
144+
{
145+
"taskForm": {
146+
"taskId": null,
147+
"subject": null,
148+
"dueDate": "2024-06-30",
149+
"comments": null,
150+
"isCompleted": false
151+
}
143152
}
144153
],
154+
"convertedStatus": "Qualified",
155+
"isLeadFormConverted": true,
145156
"title": null,
146157
"description": null,
147158
"thumbnailURL": null
148159
},
149160
"relationships": {
161+
"leadForm.leadOwner": {
162+
"links": {
163+
"self": "http://localhost:4201/drafts/MatrixUser/e65ae338-64a1-4a97-9ae8-9b9e773a7095"
164+
}
165+
},
150166
"accountForm.owner": {
151167
"links": {
152168
"self": null
@@ -186,6 +202,16 @@
186202
"links": {
187203
"self": "http://localhost:4201/drafts/CardDef/992531db-9912-49eb-9b72-f710cbcdb085"
188204
}
205+
},
206+
"scheduledTask.4.taskForm.relatedTo": {
207+
"links": {
208+
"self": null
209+
}
210+
},
211+
"recordOwner": {
212+
"links": {
213+
"self": "../MatrixUser/e65ae338-64a1-4a97-9ae8-9b9e773a7095"
214+
}
189215
}
190216
},
191217
"meta": {

packages/drafts-realm/lead-form.gts

+15
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
FieldDef,
55
contains,
66
field,
7+
linksTo,
78
} from 'https://cardstack.com/base/card-api';
89
import StringField from 'https://cardstack.com/base/string';
910
import NumberField from 'https://cardstack.com/base/number';
@@ -17,6 +18,7 @@ import { tracked } from '@glimmer/tracking';
1718
import { action } from '@ember/object';
1819
import { BoxelInput } from '@cardstack/boxel-ui/components';
1920
import { CurrencyAmount } from './currency-amount';
21+
import { MatrixUser } from './matrix-user';
2022

2123
interface CategorySignature {
2224
name: string;
@@ -53,6 +55,10 @@ class IsolatedSecForLeadForm extends Component<typeof LeadForm> {
5355
<label>Lead Status: </label>
5456
<@fields.leadStatus />
5557
</div>
58+
<div class='field-input'>
59+
<label>Lead Owner: </label>
60+
<@fields.leadOwner />
61+
</div>
5662
<div class='field-input-column description'>
5763
<label>Description: </label>
5864
<@fields.description />
@@ -178,6 +184,9 @@ class ViewSecForLeadForm extends Component<typeof LeadForm> {
178184
<FieldContainer @tag='label' @label='Lead Status' @vertical={{true}}>
179185
<@fields.leadStatus @format='edit' />
180186
</FieldContainer>
187+
<FieldContainer @tag='label' @label='Lead Owner' @vertical={{true}}>
188+
<@fields.leadOwner />
189+
</FieldContainer>
181190
</div>
182191
</section>
183192

@@ -385,6 +394,10 @@ class EditSecFoLeadForm extends Component<typeof LeadForm> {
385394
</BoxelSelect>
386395
</FieldContainer>
387396

397+
<FieldContainer @tag='label' @label='Lead Owner' @vertical={{true}}>
398+
<@fields.leadOwner />
399+
</FieldContainer>
400+
388401
<FieldContainer @tag='label' @label='Phone' @vertical={{true}}>
389402
<@fields.phone />
390403
</FieldContainer>
@@ -473,6 +486,7 @@ export class LeadFormField extends FieldDef {
473486
@field leadStatus = contains(StringField, {
474487
description: `Lead Status`,
475488
});
489+
@field leadOwner = linksTo(MatrixUser);
476490
@field phone = contains(StringField, {
477491
description: `User's phone number`,
478492
});
@@ -522,6 +536,7 @@ export class LeadForm extends CardDef {
522536
@field leadStatus = contains(StringField, {
523537
description: `Lead Status`,
524538
});
539+
@field leadOwner = linksTo(MatrixUser);
525540
@field phone = contains(StringField, {
526541
description: `User's phone number`,
527542
});

0 commit comments

Comments
 (0)