huridocs / uwazi

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

Migrate to new table #7052

Closed Zasa-san closed 3 weeks ago

Zasa-san commented 2 months ago

After #6826 is merged we need to use the new table for all the v2 UIs.

We should migrate all uses of V2/Components/UI/Table and replace it with V2/Components/UI/TableV2, and remove the corresponding story and test. Lastly, rename TableV2 module, story, and test to Table.

This is important because TableV2 handles groups differently and has a corrected dnd functionality.

Keep in mind that the new table requires that all its rows and sub rows have a unique rowId to properly handle dnd, selection and grouping.

Doing this migration will fix: #6431& #6432

Sections under Settings where migration to new table is needed:

Zasa-san commented 1 month ago

I was mistaken about #7065, our file dropzone component uses it's own dropzone library specifically tailored for file dropzones. There's no point in migrating it.

We can, however, remove react-dnd after the tables are migrated to the new version, and remove DragAndDrop.stories.tsx and the components that it has since they are not used.

In the end V2 will have dnd-kit for complex drag and drop for tables (and any other use that might come up) and react-dropzone for the file dropzone components.

We still have react-dnd-old which cannot be removed since it's used in tables and other places of V1.

@konzz @mfacar

oleksandrako commented 2 weeks ago

After testing, we found that in the specific Settings area of Users & Groups > Groups section, the look and feel of the table v2 is not consistent in terms of the i) look of the Group [see image here], ii) (may related to #6820), the Group name persists even when all users in the group are removed.

Screenshot 2024-09-10 at 17 13 52

Zasa-san commented 2 weeks ago

After testing, we found that in the specific Settings area of Users & Groups > Groups section, the look and feel of the table v2 is not consistent in terms of the i) look of the Group [see image here], ii) (may related to #6820), the Group name persists even when all users in the group are removed.

Screenshot 2024-09-10 at 17 13 52

Hi @oleksandrako! Thanks for the feedback, but I don't quite follow what the issue is. Does the table look odd or incorrect? Regarding groups, what do you mean the name persists when all the users are removed? What's the expected behavior?

pddocs commented 2 weeks ago

hi @Zasa-san (I was also part of testing team with @oleksandrako ), here is what we found:

  1. Users & Groups > Groups side has Table v2 implemented, as per our understanding. If that is the case, we expected that when you group items (here users) via 'Add Group', you will also get a grouping that looks something like this:

Screenshot 2024-09-13 at 12 18 56

But, it look different as shown in @oleksandrako 's comment above in the Users & Groups > Groups side. Correct us if this was a wrong expectation.

  1. The second point is also regarding the Users & Groups > Groups side. Steps to follow:

We tested this behaviour in light of the fix #6820 , expecting the label Group A to also get deleted. Is this not the expected behaviour?

Zasa-san commented 2 weeks ago

@pddocs @oleksandrako I think I understand now. This is an interesting point you bring up! I think the problem here is that the concept of groups in 'Users and groups' is very different to item grouping in other parts of the app.

In 'Users and groups' groups can be empty, and can be created with no users in them. Remember that you can give permissions to a group even if it has no users in it. Deleting a group if it's empty might disrupt how a user prefers to handle permissions. You can totally have empty groups that you use occasionally and then remove users from it.

The reason groups are handled differently in ‘Users and groups’ has to do with the fact that multiple users can belong to several groups. It would be confusing to show them all in one table. To make the UI simpler to understand we separate users and groups in different tables.

I don’t believe that our table grouping feature that is seen in things like filters or thesauri would be applicable to ‘Users and groups’.

Hope this clarifies!