Skip to content

Commit 5a125c0

Browse files
authored
create atom format & replace with atom (#2021)
* create atom format & replace with atom * fix lint & merge conflict * remove acc atom template & add primary tag * remove stale import
1 parent 6f004f7 commit 5a125c0

File tree

2 files changed

+34
-23
lines changed

2 files changed

+34
-23
lines changed

packages/experiments-realm/Account/bf437dc3-1f96-45e5-a057-3487c6a5c2f7.json

+8-5
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
"urgencyTag": {
3030
"index": 1,
3131
"label": "Renewal Due Soon",
32-
"value": "renewal-due-soon",
33-
"buttonText": "Create Account",
3432
"color": null,
3533
"colorScheme": {
3634
"foregroundColor": "#F57C00",
@@ -51,9 +49,14 @@
5149
"self": "../Contact/a01fc5c9-d70d-4b9c-aae4-384cf2b79b25"
5250
}
5351
},
54-
"contacts": {
52+
"contacts.0": {
5553
"links": {
56-
"self": null
54+
"self": "../Customer/0e5aec99-798b-4417-9426-a338432e0ee5"
55+
}
56+
},
57+
"contacts.1": {
58+
"links": {
59+
"self": "../Lead/9d7b2f20-c7da-4ddc-8e77-b75d88c97b48"
5760
}
5861
}
5962
},
@@ -64,4 +67,4 @@
6467
}
6568
}
6669
}
67-
}
70+
}

packages/experiments-realm/crm/account.gts

+26-18
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import BuildingIcon from '@cardstack/boxel-icons/building';
1919
import ChartBarPopular from '@cardstack/boxel-icons/chart-bar-popular';
2020
import AccountHeader from '../components/account-header';
2121
import { WebsiteField } from '../website';
22-
import { ContactRow } from '../components/contact-row';
2322
import TrendingUp from '@cardstack/boxel-icons/trending-up';
2423
import ContactIcon from '@cardstack/boxel-icons/contact';
2524
import CalendarExclamation from '@cardstack/boxel-icons/calendar-exclamation';
@@ -34,6 +33,7 @@ import Handshake from '@cardstack/boxel-icons/handshake';
3433
import ClockX from '@cardstack/boxel-icons/clock-x';
3534
import ClockUp from '@cardstack/boxel-icons/clock-up';
3635
import Contract from '@cardstack/boxel-icons/contract';
36+
import { Pill } from '@cardstack/boxel-ui/components';
3737

3838
export const urgencyTagValues = [
3939
{
@@ -189,24 +189,20 @@ class IsolatedTemplate extends Component<typeof Account> {
189189
<:content>
190190
<div class='description content-container'>
191191
{{#if this.hasContacts}}
192-
{{#if @model.primaryContact}}
193-
<ContactRow
194-
@userID={{@model.primaryContact.id}}
195-
@name={{@model.primaryContact.name}}
196-
@thumbnailURL={{@model.primaryContact.thumbnailURL}}
197-
@tagLabel='primary'
192+
<div class='primary-contact-group'>
193+
<@fields.primaryContact
194+
@format='atom'
195+
@displayContainer={{false}}
198196
/>
199-
{{/if}}
200-
{{#each @model.contacts as |contact|}}
201-
{{#if contact}}
202-
<ContactRow
203-
@userID={{contact.id}}
204-
@name={{contact.name}}
205-
@thumbnailURL={{contact.thumbnailURL}}
206-
@tagLabel={{contact.position}}
207-
/>
208-
{{/if}}
209-
{{/each}}
197+
<Pill class='primary-tag' @pillBackgroundColor='#e8e8e8'>
198+
Primary
199+
</Pill>
200+
</div>
201+
202+
<@fields.contacts
203+
@format='atom'
204+
@displayContainer={{false}}
205+
/>
210206
{{else}}
211207
<div class='default-value'>
212208
Missing Contacts
@@ -306,6 +302,18 @@ class IsolatedTemplate extends Component<typeof Account> {
306302
width: fit-content;
307303
display: inline-block;
308304
}
305+
.primary-contact-group {
306+
display: inline-flex;
307+
align-items: start;
308+
gap: var(--boxel-sp-xs);
309+
}
310+
.primary-tag {
311+
--pill-font-weight: 400;
312+
--pill-padding: var(--boxel-sp-6xs) var(--boxel-sp-xxs);
313+
--pill-font: 400 var(--boxel-font-xs);
314+
--pill-border: none;
315+
flex-shrink: 0;
316+
}
309317
.description {
310318
font: 500 var(--boxel-font-sm);
311319
letter-spacing: var(--boxel-lsp-xs);

0 commit comments

Comments
 (0)