From 99329d781d86d5d2c31f59f274a8e8410fe14cfb Mon Sep 17 00:00:00 2001 From: tintinthong Date: Mon, 22 Jul 2024 16:28:13 +0800 Subject: [PATCH 1/2] Fix contact card indexing error missing title --- packages/drafts-realm/contact-form.gts | 15 +++++++++++--- packages/drafts-realm/opportunity-form.gts | 24 +++++++++++++--------- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/packages/drafts-realm/contact-form.gts b/packages/drafts-realm/contact-form.gts index 41f19d5cb8..80356099e2 100644 --- a/packages/drafts-realm/contact-form.gts +++ b/packages/drafts-realm/contact-form.gts @@ -171,10 +171,19 @@ class View extends Component { <@fields.addressInfo /> + {{! TODO: If this @model.owner check doesn't exist, we get Encountered error rendering HTML for card: Cannot read properties of null (reading 'title') }} + {{! This applies to the embedded template }} + {{! This also occurs during indexing }} + {{#if @model.owner}} + + <@fields.owner /> + + {{/if}} - - <@fields.owner /> - diff --git a/packages/drafts-realm/opportunity-form.gts b/packages/drafts-realm/opportunity-form.gts index 300f20f3ec..a56bb1cf83 100644 --- a/packages/drafts-realm/opportunity-form.gts +++ b/packages/drafts-realm/opportunity-form.gts @@ -454,9 +454,11 @@ class ViewSecForOpportunityForm extends Component { <@fields.accountName /> - - <@fields.company /> - + {{#if @model.company}} + + <@fields.company /> + + {{/if}} <@fields.closeDate /> @@ -485,13 +487,15 @@ class ViewSecForOpportunityForm extends Component { > <@fields.forecastCategory /> - - <@fields.owner /> - + {{#if @model.owner}} + + <@fields.owner /> + + {{/if}}