Updated API for requesting material
genesys-server#640 (closed) implements new API for requesting material. This change request modifies how UI handles requests for accessions.
Please implement a new UI with new components and we will delete the original implementation.
User: Starting a request
On "Request for material" click, the list of all selected accession ids
is sent to the API /api/v1/requests/r/create
. The API returns a new DRAFT
MaterialRequest
with multiple MaterialSubRequests
. Please update the typescript classes.
The UI displays the MaterialSubRequests
and indicates the number of requested accessions for each genebank. This can be a simple h2
and a p
:
{ subRequests.map(subreq => <SubRequestInfo key={ subreq.uuid } value={ subreq } /> }
SubRequestInfo
also includes the of accessions in the sub request.
Possibility to request via Genesys
The flag FaoInstitute.allowMaterialRequests
indicates if it is possible to request via Genesys.
If the genebank does not allow for requests via Genesys, the UI displays a message saying "Sorry, XYZ does not allow for initiating requests for material from Genesys. We cannot relay your request directly."
Otherwise we indicate "XYZ allows initiating requests for material from Genesys".
User: Submitting requests
If there is at least one MaterialSubRequest
that can be relayed, then "Continue..." leads the user to provide additional info (same as now) and submit the request for validation.
When there are no such requests, "Continue..." is disabled, same as now.
Admin: Viewing requests
Check that Admin can browse all requests and subrequests.