Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix contact card and opportunity card errors #11

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@
"thumbnailURL": null
},
"relationships": {
"accountName": {
"links": {
"self": null
}
},
"company": {
"links": {
"self": null
Expand All @@ -33,4 +28,4 @@
}
}
}
}
}
15 changes: 12 additions & 3 deletions packages/drafts-realm/contact-form.gts
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,19 @@ class View extends Component<typeof ContactForm> {
<FieldContainer @tag='label' @label='Address Info' @vertical={{true}}>
<@fields.addressInfo />
</FieldContainer>
{{! 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}}
<FieldContainer
@tag='label'
@label='Contact Owner'
@vertical={{true}}
>
<@fields.owner />
</FieldContainer>
{{/if}}

<FieldContainer @tag='label' @label='Contact Owner' @vertical={{true}}>
<@fields.owner />
</FieldContainer>
</div>
</div>

Expand Down
24 changes: 14 additions & 10 deletions packages/drafts-realm/opportunity-form.gts
Original file line number Diff line number Diff line change
Expand Up @@ -454,9 +454,11 @@ class ViewSecForOpportunityForm extends Component<typeof OpportunityForm> {
<@fields.accountName />
</FieldContainer>

<FieldContainer @tag='label' @label='Company' @vertical={{true}}>
<@fields.company />
</FieldContainer>
{{#if @model.company}}
<FieldContainer @tag='label' @label='Company' @vertical={{true}}>
<@fields.company />
</FieldContainer>
{{/if}}

<FieldContainer @tag='label' @label='Close Date' @vertical={{true}}>
<@fields.closeDate />
Expand Down Expand Up @@ -485,13 +487,15 @@ class ViewSecForOpportunityForm extends Component<typeof OpportunityForm> {
>
<@fields.forecastCategory />
</FieldContainer>
<FieldContainer
@tag='label'
@label='Opportunity Owner'
@vertical={{true}}
>
<@fields.owner />
</FieldContainer>
{{#if @model.owner}}
<FieldContainer
@tag='label'
@label='Opportunity Owner'
@vertical={{true}}
>
<@fields.owner />
</FieldContainer>
{{/if}}
</div>

<style>
Expand Down
Loading