adiwg / mdEditor

Web application for writing metadata, an ADIwg project
https://www.mdeditor.org
GNU General Public License v3.0
43 stars 24 forks source link

Deleting Contacts #67

Open stansmith907 opened 7 years ago

stansmith907 commented 7 years ago

Though I would start a conversation about how to handle deleting contacts...

I see a check box on the contact tab operating similar to a 'show hidden' switch. This would flip from a 'show all' to 'show for resource'.

Resource contacts can NOT be deleted, only removed.

Contacts can be deleted from 'show all' but a search needs to be preformed before deleting. But search what? The open resource? All loaded resources?

We will definitely need a method of handling orphaned responsibleParties. Loading the contact block when saving the record might cover most cases. When loading the resource missing contacts could be restored. For this to work we would need to load the mdJson contact block on saving, but also on switching between resources.

All this same-same for dictionaries.

stansmith907 commented 7 years ago

Another thought. Maybe not allow deletion of contacts/dictionaries from sidebar at all, but only from dashboards. That way records/contacts/dictionaries will always be closed when deletes are requested.

jlblcc commented 7 years ago

I'm thinking that we treat the "application-level" and "record-level" contact lists as completely separate data stores. So once you put a contact into a "record" it's managed there. Deleting it will not delete from the app store and vice-versa. Of course, we can provide utilities for moving contacts between the two stores as well as updating "matching" (based on contactId) contacts. We'll still need to check the current record before allowing deletion of "record" contacts, but at least we're limiting the scan to one record. It's somewhat less elegant than I would like, but it seems the safest, most efficient way.