huridocs / uwazi

Uwazi is a web-based, open-source solution for building and sharing document collections
http://www.uwazi.io
MIT License
237 stars 79 forks source link

Thesauri screen crash on dnd #6715

Closed Zasa-san closed 4 months ago

Zasa-san commented 5 months ago

Describe the bug When dragging and dropping items in the thesauri screen you can cause the app to crash. This seems to involve dragging and dropping root items inside a group.

To Reproduce Steps to reproduce the behavior:

  1. Go to a thesaurus, for example "Region" thesaurus in demo
  2. Create a group with at least one item (don't save yet)
  3. Grab root items and start trying to drop them inside the group
  4. See error eventually

Expected behavior You should be able to drag items from root to group, group to group, and group to root.

Screenshots image

Device (please select all that apply) Desktop

Browser Firefox

mfacar commented 4 months ago

The error is produced due to the implementation to limit the dragging across groups, I didn't find a reference to that except this comment, but remember some conversations about the topic and if I'm not wrong, it was necessary to restrict the changes between parents and children because the backend is not prepared to handle the updates in processes like the denormalization of entities.

I'm changing the approach of the control, instead of avoiding the actualization of changes from the table in the client (reason for the failure), I added a new param editableGroups that will define as a table behavior, if it is allowed to move items between parents and children.

@Zasa-san, @konzz, @RafaPolit