Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic list of policies #1747

Closed
ajparsons opened this issue Nov 21, 2023 · 2 comments
Closed

Dynamic list of policies #1747

ajparsons opened this issue Nov 21, 2023 · 2 comments
Assignees

Comments

@ajparsons
Copy link
Contributor

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
Copy link
Member

dracos commented Dec 15, 2023

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
Copy link
Contributor Author

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:

  • id
  • name
  • context_description (the bold bit that's hardcoded at the moment)
  • policy_description
  • groups (a policy can be multiple groups)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants