Skip to content

A full-featured CRM built with React, shadcn/ui, and Supabase.

Merge branch 'main' into user-config

François Zaninotto6eb767904236
diff --cc src/components/atomic-crm/providers/fakerest/dataGenerator/companies.ts
index 185a3177,e15e1b7a..ac2b711c
--- a/src/components/atomic-crm/providers/fakerest/dataGenerator/companies.ts
+++ b/src/components/atomic-crm/providers/fakerest/dataGenerator/companies.ts
@@@ -25,9 -25,9 +25,9 @@@ export const generateCompanies = (db: D
name: name,
logo: {
title: lorem.text(1),
- src: `./logos/${id}.png`,
+ src: `https://marmelab.com/react-admin-crm/logos/${id}.png`,
} as RAFile,
- sector: random.arrayElement(defaultCompanySectors),
+ sector: random.arrayElement(defaultCompanySectors).value,
size: random.arrayElement(sizes) as 1 | 10 | 50 | 250 | 500,
linkedin_url: `https://www.linkedin.com/company/${name
.toLowerCase()
diff --cc src/components/atomic-crm/providers/fakerest/dataProvider.ts
index 3fedba75,1b7afeac..4de49302
--- a/src/components/atomic-crm/providers/fakerest/dataProvider.ts
+++ b/src/components/atomic-crm/providers/fakerest/dataProvider.ts
@@@ -261,14 -245,18 +263,27 @@@ async function updateCompany
});
}
+const processConfigLogo = async (logo: any): Promise<string> => {
+ if (typeof logo === "string") return logo;
+ if (logo?.rawFile instanceof File) {
+ return (await convertFileToBase64(logo)) as string;
+ }
+ return logo?.src ?? "";
+};
+
+ const preserveAttachmentMimeType = <
+ NoteType extends { attachments?: Array<{ rawFile?: File; type?: string }> },
+ >(
+ note: NoteType,
+ ): NoteType => ({
+ ...note,
+ attachments: (note.attachments ?? []).map((attachment) => ({
+ ...attachment,
+ type: attachment.type ?? attachment.rawFile?.type,
+ })),
+ });
+
++
export const dataProvider = withLifecycleCallbacks(
withSupabaseFilterAdapter(dataProviderWithCustomMethod),
[