SiLeBAT / fcl-client

Web app for analyzing food delivery networks
https://silebat.github.io/fcl-client/
GNU General Public License v3.0
7 stars 2 forks source link

Add state for IO and save Warnings to state. #897

Closed arne-z closed 1 week ago

arne-z commented 1 month ago

This PR only contains the behavior of filtering out duplicate IDs in station and delivery import, and writing the requested Error messages into the warning state. It is targeted at the template-warnings feature branch and should not be merged or considered complete on its own.

arne-z commented 4 weeks ago

@ruegenbfr

This is still a little bit messy, I am not super happy with the amount of code duplication between the import stations and the import deliveries functions, but I couldn't figure out a clean way to use templates for this today. If you have any ideas here, I'm open to them.

I'm also unhappy with the getWarnings function right now. I didn't find a nice solution here, because it feels like the entire filtering shouldn't be happening to begin with. The need to filter our warnings for only those that we currently have Texts for is awkward. I'm imagining we maybe need a getWarningText function that has a switch case, mapping warnings to their respective issue aggregator texts, which can then have a default for handling warnings we don't have text for yet? This doesn't feel correct either, and leaves up with the awkwardness of slicing up the issues along their types into different arrays.

So yeah, two spots where I would really like some input on how you would go about solving them.