Skip to content

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.mdx
new file mode 100644
index 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.
+
+![Merge Contacts Button](../../images/merge-button.png)
+
+A dialog will appear allowing you to search for the contact you want to merge with.
+
+![Merge Dialog](../../images/merge-dialog.png)
+
+## 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.
+
+![Merge Confirmation](../../images/merge-confirmation.png)
+
+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.
+
+![Merge Success](../../images/merge-success.png)
+
+## 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 file
diff --git a/doc/src/content/images/merge-button.png b/doc/src/content/images/merge-button.png
new file mode 100644
index 00000000..46d9d94d
Binary files /dev/null and b/doc/src/content/images/merge-button.png differ
diff --git a/doc/src/content/images/merge-confirmation.png b/doc/src/content/images/merge-confirmation.png
new file mode 100644
index 00000000..03c148dc
Binary files /dev/null and b/doc/src/content/images/merge-confirmation.png differ
diff --git a/doc/src/content/images/merge-dialog.png b/doc/src/content/images/merge-dialog.png
new file mode 100644
index 00000000..26ba49ee
Binary files /dev/null and b/doc/src/content/images/merge-dialog.png differ
diff --git a/doc/src/content/images/merge-success.png b/doc/src/content/images/merge-success.png
new file mode 100644
index 00000000..e9b393f4
Binary files /dev/null and b/doc/src/content/images/merge-success.png differ
diff --git a/registry.json b/registry.json
index 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.ts
index 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,