Skip to content

Commit 99329d7

Browse files
committed
Fix contact card indexing error missing title
1 parent 50bb112 commit 99329d7

File tree

2 files changed

+26
-13
lines changed

2 files changed

+26
-13
lines changed

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)