Skip to content

Commit ff478ab

Browse files
authoredFeb 21, 2025
update summary card data to match zeplin design (#2175)
* update summary card data to match zeplin design * remove log
1 parent 99298ff commit ff478ab

File tree

1 file changed

+56
-27
lines changed

1 file changed

+56
-27
lines changed
 

‎packages/experiments-realm/crm/deal.gts

+56-27
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ import { DealEvent } from './deal-event';
4848
import { DealStatus } from './deal-status';
4949
import { DealPriority } from './deal-priority';
5050
import { CrmApp } from '../crm-app';
51+
import MapPin from '@cardstack/boxel-icons/map-pin';
52+
import Calendar from '@cardstack/boxel-icons/calendar';
53+
import UsersGroup from '@cardstack/boxel-icons/users-group';
5154

5255
interface DealSizeSummary {
5356
summary: string;
@@ -102,6 +105,9 @@ class EditTemplate extends Component<typeof Deal> {
102105
<FieldContainer @label='CRM App'>
103106
<@fields.crmApp />
104107
</FieldContainer>
108+
<FieldContainer @label='Logo URL'>
109+
<@fields.thumbnailURL />
110+
</FieldContainer>
105111
</div>
106112
<style scoped>
107113
.deal-form {
@@ -117,19 +123,36 @@ class EditTemplate extends Component<typeof Deal> {
117123
class IsolatedTemplate extends Component<typeof Deal> {
118124
get logoURL() {
119125
//We default to account thumbnail
120-
return (
121-
this.args.model.thumbnailURL ?? this.args.model.account?.thumbnailURL
122-
);
126+
return this.args.model?.thumbnailURL?.length
127+
? this.args.model.thumbnailURL
128+
: this.args.model.account?.thumbnailURL;
123129
}
124130
get primaryContactName() {
125131
return this.args.model.account?.primaryContact?.name;
126132
}
127133

128-
get hasCompanyInfo() {
129-
return (
130-
this.args.model?.account?.website ||
131-
this.args.model?.account?.headquartersAddress
132-
);
134+
get hasDealEventInfo() {
135+
return this.args.model?.event;
136+
}
137+
138+
get eventLocation() {
139+
return this.args.model?.event?.location?.length
140+
? this.args.model.event.location
141+
: '-';
142+
}
143+
144+
get eventDate() {
145+
return this.args.model?.event?.eventDate
146+
? this.args.model.event.eventDate
147+
: '-';
148+
}
149+
150+
get eventAttendees() {
151+
const attendees = this.args.model?.event?.attendees;
152+
const attendeesString = attendees
153+
? attendees.toString() + ' Expected Attendees'
154+
: '-';
155+
return attendeesString;
133156
}
134157

135158
get hasValueBreakdown() {
@@ -467,26 +490,41 @@ class IsolatedTemplate extends Component<typeof Deal> {
467490
<SummaryGridContainer class='task-summary-grid'>
468491
<SummaryCard class='info-card'>
469492
<:title>
470-
<h3 class='info-card-title'>Company Info</h3>
493+
<h3 class='info-card-title'>Deal Info</h3>
471494
</:title>
472495
<:icon>
473496
<World class='header-icon' />
474497
</:icon>
475498
<:content>
476-
{{#if this.hasCompanyInfo}}
477-
<@fields.headquartersAddress @format='atom' />
478-
<@fields.website @format='atom' />
499+
{{#if this.hasDealEventInfo}}
500+
<EntityDisplayWithIcon @title={{this.eventLocation}}>
501+
<:icon>
502+
<MapPin class='info-icon' />
503+
</:icon>
504+
</EntityDisplayWithIcon>
505+
506+
<EntityDisplayWithIcon @title={{this.eventDate}}>
507+
<:icon>
508+
<Calendar class='info-icon' />
509+
</:icon>
510+
</EntityDisplayWithIcon>
511+
512+
<EntityDisplayWithIcon @title={{this.eventAttendees}}>
513+
<:icon>
514+
<UsersGroup class='info-icon' />
515+
</:icon>
516+
</EntityDisplayWithIcon>
479517
{{else}}
480518
<div class='default-value'>
481-
Missing Company Info
519+
Missing Deal Info
482520
</div>
483521
{{/if}}
484522
</:content>
485523
</SummaryCard>
486524

487525
<SummaryCard class='info-card'>
488526
<:title>
489-
<h3 class='info-card-title'>Stakeholders</h3>
527+
<h3 class='info-card-title'>Key Stakeholders</h3>
490528
</:title>
491529
<:icon>
492530
<Users class='header-icon' />
@@ -660,9 +698,6 @@ class IsolatedTemplate extends Component<typeof Deal> {
660698
letter-spacing: var(--boxel-lsp-xxs);
661699
align-self: flex-start;
662700
}
663-
.summary-highlight {
664-
font: 600 var(--boxel-font-lg);
665-
}
666701
.description {
667702
color: var(--boxel-450);
668703
font: var(--boxel-font-sm);
@@ -753,22 +788,16 @@ class IsolatedTemplate extends Component<typeof Deal> {
753788

754789
class FittedTemplate extends Component<typeof Deal> {
755790
get logoURL() {
756-
return (
757-
this.args.model.thumbnailURL ?? this.args.model.account?.thumbnailURL
758-
);
791+
//We default to account thumbnail
792+
return this.args.model?.thumbnailURL?.length
793+
? this.args.model.thumbnailURL
794+
: this.args.model.account?.thumbnailURL;
759795
}
760796

761797
get primaryContactName() {
762798
return this.args.model.account?.primaryContact?.name;
763799
}
764800

765-
get hasCompanyInfo() {
766-
return (
767-
this.args.model?.account?.website ||
768-
this.args.model?.account?.headquartersAddress
769-
);
770-
}
771-
772801
get hasValueBreakdown() {
773802
return (
774803
this.args.model.valueBreakdown &&

0 commit comments

Comments
 (0)