nycmeshnet / meshdb

A convenient, stable, and sane database for tracking Members and Nodes for use with robots and humans
https://db.mesh.nycmesh.net
MIT License
8 stars 13 forks source link

Create a warning in the admin UI before saving changes to a member which creates a dupe #463

Open Andrew-Dickinson opened 1 month ago

Andrew-Dickinson commented 1 month ago

In the admin UI, if the admin attempts to create or edit a member in such a way that any of the email addresses or phone numbers of the modified member overlap with any other existing member, display a warning and disable the save button(s). Instead, offer them a link to modify the existing member object

Allow the admin to override this with a checkbox that says something "I understand this will create a duplicate/ambiguous member object" which re-enables the save boxes

This check can probably just be implemented with a series of API calls to our existing member lookup endpoints (one for each email/phone number on the form being edited by the admin). However a backend endpoint might allow a small amount of logic re-use (join form de-duplication). I lean towards doing this in the frontend

Requested here: https://github.com/nycmeshnet/meshdb/pull/450#discussion_r1710596016

Andrew-Dickinson commented 1 month ago

At the risk of causing extreme scope creep (maybe this should be a separate issue), it would be nice if the other models did this too (e.g. trying to create a device with an identical name to an existing one would also trigger a warning)

Ditto for Links and Devices with the same UISP ID