A full-featured CRM built with React, shadcn/ui, and Supabase.
Fix activity log formatting
fzaninotto605e42d3f75a
diff --git a/src/components/atomic-crm/activity/ActivityLogCompanyCreated.tsx b/src/components/atomic-crm/activity/ActivityLogCompanyCreated.tsxindex bf2fe98c..62b8a490 100644--- a/src/components/atomic-crm/activity/ActivityLogCompanyCreated.tsx+++ b/src/components/atomic-crm/activity/ActivityLogCompanyCreated.tsx@@ -21,24 +21,23 @@ export function ActivityLogCompanyCreated({<div className="flex flex-row space-x-1 items-center w-full"><CompanyAvatar width={20} height={20} record={company} />- <div className="text-sm text-muted-foreground flex-grow">- <span className="text-muted-foreground text-sm inline-flex">- <ReferenceField- source="sales_id"- reference="sales"- record={activity}- >- <SaleName />- </ReferenceField>- </span>- added company + <span className="text-muted-foreground text-sm inline-flex flex-grow">+ <ReferenceField+ source="sales_id"+ reference="sales"+ record={activity}+ >+ <SaleName />+ </ReferenceField>+ added company <Link to={`/companies/${company.id}/show`}>{company.name}</Link>{context === "all" && (<>+ <RelativeDate date={activity.date} /></>)}- </div>+ </span>{context === "company" && (<span className="text-muted-foreground text-sm"><RelativeDate date={activity.date} />diff --git a/src/components/atomic-crm/activity/ActivityLogDealCreated.tsx b/src/components/atomic-crm/activity/ActivityLogDealCreated.tsxindex a8d60232..8d3d0715 100644--- a/src/components/atomic-crm/activity/ActivityLogDealCreated.tsx+++ b/src/components/atomic-crm/activity/ActivityLogDealCreated.tsx@@ -1,7 +1,9 @@-import { Link } from "react-router";import type { RaRecord } from "ra-core";+import { Link } from "react-router";+import { ReferenceField } from "@/components/admin/reference-field";import { RelativeDate } from "../misc/RelativeDate";+import { SaleName } from "../sales/SaleName";import type { ActivityDealCreated } from "../types";import { useActivityLogContext } from "./ActivityLogContext";@@ -18,18 +20,27 @@ export function ActivityLogDealCreated({<div className="p-0"><div className="flex flex-row space-x-1 items-center w-full"><div className="w-5 h-5 bg-gray-300 rounded-full" />- <div className="text-sm text-muted-foreground flex-grow">- <span className="text-muted-foreground text-sm">- Sales ID: {activity.sales_id}- </span>{" "}- added deal <Link to={`/deals/${deal.id}/show`}>{deal.name}</Link>{" "}+ <span className="text-muted-foreground text-sm inline-flex flex-grow">+ <ReferenceField source="sales_id" reference="sales" record={activity}>+ <SaleName />+ </ReferenceField>+ added deal + <Link to={`/deals/${deal.id}/show`}>{deal.name}</Link>+ {context !== "company" && (<>- to company {activity.company_id}{" "}+ to + <ReferenceField+ source="company_id"+ reference="companies"+ record={activity}+ link="show"+ />+ <RelativeDate date={activity.date} /></>)}- </div>+ </span>{context === "company" && (<span className="text-muted-foreground text-sm"><RelativeDate date={activity.date} />diff --git a/src/components/atomic-crm/activity/ActivityLogDealNoteCreated.tsx b/src/components/atomic-crm/activity/ActivityLogDealNoteCreated.tsxindex 3810498b..fdd06946 100644--- a/src/components/atomic-crm/activity/ActivityLogDealNoteCreated.tsx+++ b/src/components/atomic-crm/activity/ActivityLogDealNoteCreated.tsx@@ -36,7 +36,7 @@ export function ActivityLogDealNoteCreated({</ReferenceField></ReferenceField>- <span className="text-sm text-muted-foreground flex-grow inline-flex">+ <span className="text-muted-foreground text-sm inline-flex flex-grow"><ReferenceFieldsource="sales_id"reference="sales"@@ -54,7 +54,7 @@ export function ActivityLogDealNoteCreated({/>{context !== "company" && (<>- {" at "}+ at <ReferenceFieldsource="deal_id"reference="deals"@@ -66,7 +66,9 @@ export function ActivityLogDealNoteCreated({reference="companies"link="show"/>- </ReferenceField>{" "}+ </ReferenceField>+ + <RelativeDate date={activity.date} /></>)}</span>