Feature/464 permission admin view slow#508
Conversation
stevenbal
left a comment
There was a problem hiding this comment.
I was thinking of the following to make it possible to fetch the fields via the frontend (such that the form doesn't have to be saved to fetch them):
- make an endpoint on the admin (that requires admin authentication) that performs the request for a specific object_type_id to retrieve the
data_fields(e.g./admin/objecttypes/<id>). That way we don't have to expose the token to the frontend and we only need to pass theidto the frontend - in react, call this new endpoint for the currently selected objecttype and display the result
@annashamray what do you think about this?
stevenbal
left a comment
There was a problem hiding this comment.
Looks good overall, some minor questions/remarks
annashamray
left a comment
There was a problem hiding this comment.
One thing I've noticed now, but it's been implemented like this since the beginning:
The state of selected fields is not tracked:
If you change the objecttype in the dropdown and then change it back, the fields previous will not be selected, even if they are saved in the DB
Screencast from 28-01-25 16:32:04.webm
It's been like this probably forever, so could you please create an issue to fix it?
No need to fix it in this PR, but some cleanup would be nice
annashamray
left a comment
There was a problem hiding this comment.
Please create an issue for keeping track of selected fields after changing the objecttype
stevenbal
left a comment
There was a problem hiding this comment.
Some minor comments about the tests, looks good otherwise
Fixes #464
An internal administration endpoint
admin/core/objecttype/<objecttype_id>/_versions/was created to retrieve all versions related to the objecttype.Then the FE part was modified, so that each time an objecttype is modifie/selected, it call a new request to the endpoint.