A full-featured CRM built with React, shadcn/ui, and Supabase.
[doc] Add merging contacts doc
François Zaninotto3776bd423eb3
diff --git a/doc/src/content/docs/users/merging-contacts.mdx b/doc/src/content/docs/users/merging-contacts.mdxnew file mode 100644index 00000000..d9889723--- /dev/null+++ b/doc/src/content/docs/users/merging-contacts.mdx@@ -0,0 +1,37 @@+---+title: Merging Contacts+---++Atomic CRM allows you to merge duplicate contacts into a single contact to maintain a clean and organized database.++## Selecting the Two Contacts to Merge++In the Contacts page, select the contact you want to merge into another, then edit it.++In the Contact Edit page, click on the "Merge with another contact" button on the side panel.++++A dialog will appear allowing you to search for the contact you want to merge with.++++## Reviewing and Confirming the Merge++Atomic CRM will merge the selected contact into the target contact. This means that all information from the selected contact will be transferred to the target contact, and the selected contact will be deleted.++When both the current contact and the target contact have a given property (like position or company), Atomic CRM keeps the one of the target contact.++++Click the "Merge Contacts" button to complete the process. The current contact will be merged into the target contact, and all associated data will be consolidated.++++## Causes of Duplicate Contacts++It is common to have duplicate contacts in your CRM. Duplicate contacts can arise from various situations, such as:++- Importing contacts from several CSV files that contain overlapping data.+- Receiving an inbound email creates a new contact for a new email address instead of associating with an existing contact.+- Manually adding contacts without checking for existing entries.\ No newline at end of filediff --git a/doc/src/content/images/merge-button.png b/doc/src/content/images/merge-button.pngnew file mode 100644index 00000000..46d9d94dBinary files /dev/null and b/doc/src/content/images/merge-button.png differdiff --git a/doc/src/content/images/merge-confirmation.png b/doc/src/content/images/merge-confirmation.pngnew file mode 100644index 00000000..03c148dcBinary files /dev/null and b/doc/src/content/images/merge-confirmation.png differdiff --git a/doc/src/content/images/merge-dialog.png b/doc/src/content/images/merge-dialog.pngnew file mode 100644index 00000000..26ba49eeBinary files /dev/null and b/doc/src/content/images/merge-dialog.png differdiff --git a/doc/src/content/images/merge-success.png b/doc/src/content/images/merge-success.pngnew file mode 100644index 00000000..e9b393f4Binary files /dev/null and b/doc/src/content/images/merge-success.png differdiff --git a/registry.json b/registry.jsonindex 91273aef..f1ed2a9c 100644--- a/registry.json+++ b/registry.json@@ -490,6 +490,10 @@"path": "src/components/atomic-crm/dashboard/Dashboard.tsx","type": "registry:component"},+ {+ "path": "src/components/atomic-crm/contacts/useContactMerge.ts",+ "type": "registry:component"+ },{"path": "src/components/atomic-crm/contacts/useContactImport.tsx","type": "registry:component"@@ -510,6 +514,10 @@"path": "src/components/atomic-crm/contacts/ContactShow.tsx","type": "registry:component"},+ {+ "path": "src/components/atomic-crm/contacts/ContactMergeDialog.tsx",+ "type": "registry:component"+ },{"path": "src/components/atomic-crm/contacts/ContactListFilter.tsx","type": "registry:component"diff --git a/src/components/atomic-crm/contacts/useContactMerge.ts b/src/components/atomic-crm/contacts/useContactMerge.tsindex 8fd4be9a..0a9de146 100644--- a/src/components/atomic-crm/contacts/useContactMerge.ts+++ b/src/components/atomic-crm/contacts/useContactMerge.ts@@ -121,7 +121,10 @@ export const useContactMerge = () => {const winnerUpdate = updateContact("contacts", {id: winnerId,data: {- avatar: winnerContact.avatar ?? loserContact.avatar,+ avatar:+ winnerContact.avatar && winnerContact.avatar.src+ ? winnerContact.avatar+ : loserContact.avatar,gender: winnerContact.gender ?? loserContact.gender,first_name: winnerContact.first_name ?? loserContact.first_name,last_name: winnerContact.last_name ?? loserContact.last_name,