|
8 | 8 | containsMany,
|
9 | 9 | } from 'https://cardstack.com/base/card-api';
|
10 | 10 |
|
11 |
| -import { Avatar } from '@cardstack/boxel-ui/components'; |
| 11 | +import { Avatar, FieldContainer } from '@cardstack/boxel-ui/components'; |
12 | 12 | import AvatarGroup from '../components/avatar-group';
|
13 | 13 |
|
14 | 14 | import ContactIcon from '@cardstack/boxel-icons/contact';
|
@@ -48,6 +48,54 @@ export class SocialLinkField extends ContactLinkField {
|
48 | 48 | ];
|
49 | 49 | }
|
50 | 50 |
|
| 51 | +class EditTemplate extends Component<typeof Contact> { |
| 52 | + <template> |
| 53 | + <div class='contact-form'> |
| 54 | + <FieldContainer @label='First Name'> |
| 55 | + <@fields.firstName /> |
| 56 | + </FieldContainer> |
| 57 | + <FieldContainer @label='Last Name'> |
| 58 | + <@fields.lastName /> |
| 59 | + </FieldContainer> |
| 60 | + <FieldContainer @label='Position'> |
| 61 | + <@fields.position /> |
| 62 | + </FieldContainer> |
| 63 | + <FieldContainer @label='Company'> |
| 64 | + <@fields.company /> |
| 65 | + </FieldContainer> |
| 66 | + <FieldContainer @label='Department'> |
| 67 | + <@fields.department /> |
| 68 | + </FieldContainer> |
| 69 | + <FieldContainer @label='Primary Email'> |
| 70 | + <@fields.primaryEmail /> |
| 71 | + </FieldContainer> |
| 72 | + <FieldContainer @label='Secondary Email'> |
| 73 | + <@fields.secondaryEmail /> |
| 74 | + </FieldContainer> |
| 75 | + <FieldContainer @label='Phone Number'> |
| 76 | + <@fields.phoneMobile /> |
| 77 | + </FieldContainer> |
| 78 | + <FieldContainer @label='Office Phone Number'> |
| 79 | + <@fields.phoneOffice /> |
| 80 | + </FieldContainer> |
| 81 | + <FieldContainer @label='Social Links'> |
| 82 | + <@fields.socialLinks /> |
| 83 | + </FieldContainer> |
| 84 | + <FieldContainer @label='Status'> |
| 85 | + <@fields.statusTag /> |
| 86 | + </FieldContainer> |
| 87 | + </div> |
| 88 | + <style scoped> |
| 89 | + .contact-form { |
| 90 | + display: flex; |
| 91 | + flex-direction: column; |
| 92 | + gap: var(--boxel-sp-lg); |
| 93 | + padding: var(--boxel-sp-xl); |
| 94 | + } |
| 95 | + </style> |
| 96 | + </template> |
| 97 | +} |
| 98 | + |
51 | 99 | class EmbeddedTemplate extends Component<typeof Contact> {
|
52 | 100 | get hasSocialLinks() {
|
53 | 101 | return Boolean(this.args.model?.socialLinks?.length);
|
@@ -710,6 +758,7 @@ export class Contact extends CardDef {
|
710 | 758 | },
|
711 | 759 | });
|
712 | 760 |
|
| 761 | + static edit = EditTemplate; |
713 | 762 | static embedded = EmbeddedTemplate;
|
714 | 763 | static fitted = FittedTemplate;
|
715 | 764 | static atom = AtomTemplate;
|
|
0 commit comments