dspace-angular icon indicating copy to clipboard operation
dspace-angular copied to clipboard

Submission Form should be loaded using fewer REST requests

Open tdonohue opened this issue 1 year ago • 0 comments

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:

  1. Login to demo.dspace.org or sandbox.dspace.org
  2. Open Chrome DevTools
  3. 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.

tdonohue avatar Jul 03 '24 20:07 tdonohue