Skip to content

Commit

Permalink
Fix(crm): Improve activity log wording
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanarnault committed Jul 26, 2024
1 parent ad36a45 commit 08b2868
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 17 deletions.
4 changes: 2 additions & 2 deletions examples/crm/src/activity/ActivityLogCompanyCreated.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export function ActivityLogCompanyCreated({
}}
variant="body2"
>
<strong>{company.name}</strong> was added to companies
by {sale.first_name} {sale.last_name}
<strong>{company.name}</strong> has been added to{' '}
companies by {sale.first_name} {sale.last_name}
</Typography>

<ActivityLogDate date={company.created_at} />
Expand Down
2 changes: 1 addition & 1 deletion examples/crm/src/activity/ActivityLogContactCreated.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function ActivityLogContactCreated({
>
{contact.first_name} {contact.last_name}
</Link>{' '}
contact was added to <strong>{company.name}</strong> by{' '}
has been added to <strong>{company.name}</strong> by{' '}
{sale.first_name} {sale.last_name}
</Typography>

Expand Down
7 changes: 4 additions & 3 deletions examples/crm/src/activity/ActivityLogContactNoteCreated.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type ActivityLogContactNoteCreatedProps = {
};

export function ActivityLogContactNoteCreated({
activity: { sale, contact, contactNote },
activity: { sale, contact, contactNote, company },
}: ActivityLogContactNoteCreatedProps) {
return (
<RecordContextProvider value={contact}>
Expand All @@ -25,14 +25,15 @@ export function ActivityLogContactNoteCreated({
}}
variant="body2"
>
A note was added to{' '}
A note has been added to{' '}
<Link
to={`/contacts/${contact.id}/show`}
variant="body2"
>
{contact.first_name} {contact.last_name}
</Link>{' '}
contact by {sale.first_name} {sale.last_name}
from <strong>{company.name}</strong> by{' '}
{sale.first_name} {sale.last_name}
</Typography>

<ActivityLogDate date={contactNote.date} />
Expand Down
2 changes: 1 addition & 1 deletion examples/crm/src/activity/ActivityLogDealCreated.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function ActivityLogDealCreated({
<Link to={`/deals/${deal.id}/show`} variant="body2">
{deal.name}
</Link>{' '}
deal was added to <strong>{company.name}</strong> by{' '}
has been added to <strong>{company.name}</strong> by{' '}
{sale.first_name} {sale.last_name}
</Typography>

Expand Down
5 changes: 3 additions & 2 deletions examples/crm/src/activity/ActivityLogDealNoteCreated.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ export function ActivityLogDealNoteCreated({
}}
variant="body2"
>
A note was added to{' '}
A note has been added to{' '}
<Link to={`/deals/${deal.id}/show`} variant="body2">
{deal.name}
</Link>{' '}
deal by {sale.first_name} {sale.last_name}
from <strong>{company.name}</strong> by{' '}
{sale.first_name} {sale.last_name}
</Typography>

<ActivityLogDate date={dealNote.date} />
Expand Down
22 changes: 14 additions & 8 deletions examples/crm/src/dataProvider/activity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,20 @@ async function getContactsLog(
date: contact.first_seen,
}))
.concat(
contactNotes.map<Activity>(contactNote => ({
id: `contactNote.${contactNote.id}.created`,
type: CONTACT_NOTE_CREATED,
sale: salesDict.get(contactNote.sales_id) as Sale,
contact: contactsDict.get(contactNote.contact_id) as Contact,
contactNote,
date: contactNote.date,
}))
contactNotes.map<Activity>(contactNote => {
const contact = contactsDict.get(
contactNote.contact_id
) as Contact;
return {
id: `contactNote.${contactNote.id}.created`,
type: CONTACT_NOTE_CREATED,
company: companiesById.get(contact.company_id) as Company,
sale: salesDict.get(contactNote.sales_id) as Sale,
contact,
contactNote,
date: contactNote.date,
};
})
);
}

Expand Down
1 change: 1 addition & 0 deletions examples/crm/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export type ActivityContactCreated = {
export type ActivityContactNoteCreated = {
type: typeof CONTACT_NOTE_CREATED;
sale: Sale;
company: Company;
contact: Contact;
contactNote: ContactNote;
};
Expand Down

0 comments on commit 08b2868

Please sign in to comment.