Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a "Merge" action #843

Open
Peltoche opened this issue Nov 14, 2021 · 4 comments
Open

Add a "Merge" action #843

Peltoche opened this issue Nov 14, 2021 · 4 comments

Comments

@Peltoche
Copy link

Hello,

I have often the case where for the same personne I have for example a contact with the email and another contact with the phone number.

The proposed solution would be to add to the selection menu a "merge" action which would simply merge the informations for all the selected contacts.

If you agree for the feature I would like to try to propose a PR.

@Crash--
Copy link
Contributor

Crash-- commented Nov 15, 2021

I like the idea!

If you need help during the implementation, do not hesitate to ask!

@Peltoche
Copy link
Author

Hi @Crash-- ,

I have started to write some lines. As I'm re-using your mergeContact method I would like to propose you a new merging strategy. The current strategy is:

const strategies = {
  email: mergeArrayOfObject('address'),
  phone: mergeArrayOfObject('number'),
  givenName: keepLonger,
  familyName: keepLonger
}

And my expectations would be:

If I have a contact A in my list and I decide to merge a contact B into it I would expect that the contact A remain the same and is only completed with the fields from B. A would the reference and in case of any conflicts I would choose the content of contact A.

The contact A have been previously created, checked and probably updated by the user if the he was not pleased by its content. With the rule above if the user updates a givenName field in order to make it shorter, each import would override the field and he will needs to make the change after each import.

What do you think of using this strategy for the import feature and the Merge action?

@Peltoche
Copy link
Author

You can find the code corresponding my idea juste above. I guess that's the best way to explain my idea.

@Crash--
Copy link
Contributor

Crash-- commented Nov 24, 2021

Hello @Peltoche

Changing our default merge strategy seems a bit complicated for now. It has impacts with the google konnector and with the csv import. I know that our current strategy is not perfect at all, but we don't really know the source of truth in that case.

But in your wanted feature, I agree that the strategy you describe is way better. Can we keep our default merge strategy for our import stuffs, but add your new strategy for the manuel merge?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants