Skip to content

Commit 7f0d9dc

Browse files
authoredJul 22, 2024
Merge pull request #11 from tintinthong/fix-contact-card-and-opportunity-card-errors
Fix contact card and opportunity card errors
2 parents 50bb112 + 7d19061 commit 7f0d9dc

File tree

3 files changed

+27
-19
lines changed

3 files changed

+27
-19
lines changed
 

‎packages/drafts-realm/OpportunityForm/5ab75971-9227-4a3e-84cc-537d84587994.json

+1-6
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@
1515
"thumbnailURL": null
1616
},
1717
"relationships": {
18-
"accountName": {
19-
"links": {
20-
"self": null
21-
}
22-
},
2318
"company": {
2419
"links": {
2520
"self": null
@@ -33,4 +28,4 @@
3328
}
3429
}
3530
}
36-
}
31+
}

‎packages/drafts-realm/contact-form.gts

+12-3
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,19 @@ class View extends Component<typeof ContactForm> {
171171
<FieldContainer @tag='label' @label='Address Info' @vertical={{true}}>
172172
<@fields.addressInfo />
173173
</FieldContainer>
174+
{{! TODO: If this @model.owner check doesn't exist, we get Encountered error rendering HTML for card: Cannot read properties of null (reading 'title') }}
175+
{{! This applies to the embedded template }}
176+
{{! This also occurs during indexing }}
177+
{{#if @model.owner}}
178+
<FieldContainer
179+
@tag='label'
180+
@label='Contact Owner'
181+
@vertical={{true}}
182+
>
183+
<@fields.owner />
184+
</FieldContainer>
185+
{{/if}}
174186

175-
<FieldContainer @tag='label' @label='Contact Owner' @vertical={{true}}>
176-
<@fields.owner />
177-
</FieldContainer>
178187
</div>
179188
</div>
180189

‎packages/drafts-realm/opportunity-form.gts

+14-10
Original file line numberDiff line numberDiff line change
@@ -454,9 +454,11 @@ class ViewSecForOpportunityForm extends Component<typeof OpportunityForm> {
454454
<@fields.accountName />
455455
</FieldContainer>
456456

457-
<FieldContainer @tag='label' @label='Company' @vertical={{true}}>
458-
<@fields.company />
459-
</FieldContainer>
457+
{{#if @model.company}}
458+
<FieldContainer @tag='label' @label='Company' @vertical={{true}}>
459+
<@fields.company />
460+
</FieldContainer>
461+
{{/if}}
460462

461463
<FieldContainer @tag='label' @label='Close Date' @vertical={{true}}>
462464
<@fields.closeDate />
@@ -485,13 +487,15 @@ class ViewSecForOpportunityForm extends Component<typeof OpportunityForm> {
485487
>
486488
<@fields.forecastCategory />
487489
</FieldContainer>
488-
<FieldContainer
489-
@tag='label'
490-
@label='Opportunity Owner'
491-
@vertical={{true}}
492-
>
493-
<@fields.owner />
494-
</FieldContainer>
490+
{{#if @model.owner}}
491+
<FieldContainer
492+
@tag='label'
493+
@label='Opportunity Owner'
494+
@vertical={{true}}
495+
>
496+
<@fields.owner />
497+
</FieldContainer>
498+
{{/if}}
495499
</div>
496500

497501
<style>

0 commit comments

Comments
 (0)