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

Remove valid party filtering in frontend #2981

Open
olemartinorg opened this issue Feb 6, 2025 · 0 comments
Open

Remove valid party filtering in frontend #2981

olemartinorg opened this issue Feb 6, 2025 · 0 comments

Comments

@olemartinorg
Copy link
Contributor

When we fetch parties from the backend, we also pass ?allowedtoinstantiatefilter=true to get a filtered list of those parties allowed to instantiate a given form. However, we also do the exact same filtering in frontend afterwards via reduceToValidParties(). Currently, that seems to do a couple more things that backend doesn't do:

  • It flattens the list of parties
  • It removes deleted parties (which is up for debate if we should do, see Support deleted parties when instantiating #2972, and the fact that we have a "show deleted" toggle in our party selection page)
  • It removes parties where onlyHierarchyElementWithNoAccess: true. As I've understood it, if you only have permissions to instantiate for a subUnit, the main organisation will still show up in the list of valid parties from the backend, but this flag will be toggled on to indicate that the user shouldn't be allowed to click it.

Frontend should not need to do any additional filtering here when we've already asked backend to do that for us. If we decide to fix this in a non-major version, we should take extra care to make this right (these tests are full of mocked data, so I'm less confident in them than most other tests).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

1 participant