dspace-angular
dspace-angular copied to clipboard
Submission Form should be loaded using fewer REST requests
Describe the bug
In 7.x and 8.x, when a user starts a new submission, this makes ~9 calls to the REST API to load all the required information to create the Submission form. First, the WorkspaceItem is loaded, then each section of the form (one by one), then any controlled vocabularies (one by one).
Here's an example of what you see in Chrome DevTools when the Submission Form loads:
# Load WorkspaceItem
GET /server/api/submission/workspaceitems/[:id]?embed=item,sections,collection
# Load each section of form one by one
GET /server/api/config/submissionforms/traditionalpageone
GET /server/api/config/submissionforms/traditionalpagetwo
GET /server/api/config/submissionforms/upload?embed=metadata
GET /server/api/config/submissionforms/license
# Load any referenced controlled vocabularies (to populate dropdowns, etc)
GET /server/api/submission/vocabularies/common_types
GET /server/api/submission/vocabularies/common_iso_languages
# Finally, load the *entry* values in those controlled vocabularies (as a separate request)
GET /server/api/submission/vocabularies/common_types/entries?page=0&size=10
GET /server/api/submission/vocabularies/common_iso_types/entries?page=0&size=10
Ideally, it'd be better to see if we can load all this information in a single request (or at least fewer requests) by better usage of Projections (embed param)
To Reproduce
Steps to reproduce the behavior:
- Login to demo.dspace.org or sandbox.dspace.org
- Open Chrome DevTools
- Create a new Submission. Verify that you see roughly 8-10 requests to build the submission form.
Expected behavior
Ideally, better usage of projections should allow us to load all this information in fewer REST requests. If additional endpoints need to be added to the REST API to support this behavior, then we should add them.