buttercup / buttercup-mobile

:iphone: React-Native mobile application for Buttercup
https://buttercup.pw
GNU General Public License v3.0
395 stars 71 forks source link

Fix issue #242: show groups hierarchical instead of flat #249

Closed powerflo closed 4 years ago

powerflo commented 4 years ago

Fix issue #242.

The groups in the redux state are a flat list of all groups (the groups in the state are set to the groups property of createVaultFacade(vault)). But the existing code to show the archive contents expects a hierachical list of groups (i.e. each group has a groups property with a list of its subgroups).

This leads to the issue that all groups and subgroups are displayed flat in the application, and if a group is selected no subgroups are shown (because the selected group has no groups property with a list of its subgroups).

To fix this and get a hierarchival view in the application, filter the list of groups by the respective parentID. This is the exact same approach as for the entries.

perry-mitchell commented 4 years ago

Thanks @powerflo! Much appreciated.