mysociety / theyworkforyou

Keeping tabs on the UK's parliaments and assemblies
http://www.theyworkforyou.com/
Other
224 stars 50 forks source link

Dynamic list of policies #1747

Closed ajparsons closed 2 months ago

ajparsons commented 7 months ago

Currently the policies that TWFY draws on are hardcoded as a series of arrays (different arrays for each policy group, and one to assign labels).

Given policy management otherwise happens in twfy-votes (including moving items between draft and active, and adding to groups) - it’d be nice to avoid having to change things in multiple places.

Ideally on deploy theyworkforyou would source a json from twfy-votes, and this would set the current policies.

dracos commented 6 months ago

We do also have a policies table in TWFY that is populated and has an admin interface, and has a "title" field, which I'm not sure how it differs from the hardcoded titles in Policies.php... I guess that's for display as well somewhere?

Happy to source a JSON for a current list with groups if that's the best place to do it.

ajparsons commented 6 months ago

The /policies/commons/active/all.json endpoint will give you all currently active policies for the commons, which is what we need at the moment.

Relevant bits for each item in policies are: