Open markus2330 opened 8 months ago
As first step, please collect which operations might be sharable between layers.
I would strongly agree to a refactor of the MapStore
into a more narrow layer specific store.
Also maybe a Stage
and Transformer
store.
This way more logic can be pulled from components into the respective stores and makes it easier to track where what happens.
A design pattern I would strongly encourage then is grouping actions under a actions
namespace inside the store.
@badnames Can you please also explain, why a stage listeners functionality was needed?
https://github.com/ElektraInitiative/PermaplanT/blob/9f142c507d329f56aa77d505a188463ad4e65725/frontend/src/features/map_planning/components/BaseStage.tsx#L34
Currently it seems a bit convoluted this way.
If you look at the plant layer https://github.com/ElektraInitiative/PermaplanT/blob/9f142c507d329f56aa77d505a188463ad4e65725/frontend/src/features/map_planning/layers/plant/PlantsLayer.tsx#L215 there is a backed-in functionality to listen to native Stage
events.
Maybe I am missing something?
@Bushuo thx for your great input!
A design pattern I would strongly encourage then is grouping actions under a actions namespace inside the store.
Can you maybe describe what you have in mind in our architecture documentation as a separate PR?
Can you please also explain
I created a separate issue #1155 as @badnames sometimes does not get all the notification. The extra issue will pop up in the sprint and I can ask him in the meeting.
I suggest that we should have a dedicated meeting together to discuss the frontend layer refactoring. But first we should have a PR that proposes an architecture. I think they (@badnames and @danielsteinkogler) will be very happy if you (@Bushuo) make specific suggestions.
Tasks
Common operations of elements:
Use case
shade and drawing layer
Related Pull request
No response