foodcoops / foodsoft

Web-based software to manage a non-profit food coop (product catalog, ordering, accounting, job scheduling).
https://foodcoops.net/
Other
326 stars 146 forks source link

feat: only show shared suppliers that are allowed to be shown #1036

Open kidhab opened 9 months ago

kidhab commented 9 months ago

This SharedLists commit introduces a new foodcoop column at the SharedLists suppliers table.

The web interface will show a field that expects the name of a Foodcoop (has to be defined via [FoodsoftConfig[:name]). If the field is empty, the supplier will be show to all Foodsoft multisite instances.

If the field contains a string the Foodsoft will use it to filter out suppliers that are only allowed to be shown for a specific Foodcoop instance.

This MR introduces the filter at the Foodsoft side.

Closes #1033

kidhab commented 9 months ago

Maybe it would be better to introduce a new config item because it's possible to set [FoodsoftConfig[:name]) via the web interface (and not only via app_config.yml). If someone changes the value via web this would filter out the supplier.

Anyway let me know what you think in general.

yksflip commented 9 months ago

hey, as already mentioned in #1033, we should talk about how we want to proceed with sharedlist in general. I think the suggestion made by lentschi look very good. But as the timeline of the foodsoftAT fork is not predictable yet, I'd be okay to go with your changes, so you don't have to wait for it to finish

yksflip commented 9 months ago

Maybe you can have another look at the tests, it look's like your changes broke something.

wvengen commented 6 months ago

We could use the foodcoop config key (I think it is sometimes also called 'scope') instead of name. It's not ideal, I would expect a one-to-many relation (being able to allow multiple foodcoops), but as this may be a temporary solution anyway - until we have restructured the shared database approach (which will probably take some time) - it sounds like a great simple approach to solve a relevant use-case.

kidhab commented 6 months ago

Maybe you can have another look at the tests, it look's like your changes broke something.

Can you re-run the failed job so that I can see the error message again? I don't have the necessary permissions.

wvengen commented 6 months ago

Can you re-run the failed job so that I can see the error message again? I don't have the necessary permissions.

It appears this run has expired, and needs a re-push to run CI again (and if that fails, we could try to re-run in case of a flaky test).