DigitalCommons / land-explorer-front-end

React app for the Land Explorer front end
http://landexplorer.cc
GNU Affero General Public License v3.0
2 stars 0 forks source link

[Backsearch P1]Array depth on ownership-search #287

Open King-Mob opened 11 months ago

King-Mob commented 11 months ago

Description

There are lots of arrays of properties in the ownership search and redux store and the use of literal arrays exacerbates how to access them.

Bring the items out of the arrays as much as possible to minimise the depth required.

Acceptance Criteria

Code is relatively readable.

rogup commented 11 months ago

@King-Mob I've had a look around the code and some clarification would be helpful :)

From what I understand, I think you're referring to the 'properties' and 'selectedProperties' in RelatedPropertiesReducer. And maybe also 'highlightedProperties' in LandOwnershipReducer.

We have a few filters where we regularly search for polygon objects within the array by poly_id. So this could be made more efficient by converting the arrays to objects, with poly_id as key.

This is only 1 layer deep though- are there any other array depth issues that you had in mind? We have a few objects within arrays within objects e.g. the coordinates in the geom object. But we're not searching for any of these values, so I don't think there's an efficiency issue here.

rogup commented 11 months ago

Have implemented the things I mentioned in the above comment, and waiting on @King-Mob to confirm whether there's anything else to do