Do not require PID for making requests
@macosta and collagues from @1cgiar/palmira propose to make it easier for users to make requests for material:
Allowing users regardless of having a registration in Easy-SMTA, to make a request for material. This is because not all genebanks routinely have the Easy-SMTA system in place and many users are not familiar with the system and registration is not easy to do, in other banks they must help customers to register.
We have support for Internal requests that do not require PID and the associated form. This form will become the default form for users to fill out.
Changes to Genesys
On the UI we treat all requests as internalRequest
which will skip PID validation on the backend.
The form uses EasySMTAUserData
data model, but it does not reflect the one from the server and needs updating. See https://gitlab.croptrust.org/genesys-pgr/genesys-server/-/blob/main/src/main/java/org/genesys/server/service/EasySMTA.java
-
Convert the form to
react-hook-form
. -
Force
internalRequest = true
and show the full "Requestor information" form -
Update form fields:
- Fields: email, first name, last name stay. Move telephone after last name.
-
address
"Address" (required) -
country
"Country" (required) - Add radio select
userType
"Type of request":in
"This is a personal request" andor
"This request is related to my work" - If user selected
userType === or
, then enable the section for "Organization" data:-
orgName
"Organization name" (required ifuserType === or
) -
orgAddress
"Organization address" (required ifuserType === or
) -
orgCountry
"Organization country" (required ifuserType === or
) - Add fields
aoName
andaoSurname
for name and last name of the "Authorized official" - Add
aoEmail
"Email of the authorized official"
-
- Add section "Shipping address":
- If user
userType === or
show a checkboxuseOrgAddress
"Use organization address". When checked, the inputs in this section are disabled. - If user
userType === in
show checkboxuseMyAddress
"Use my address". When checked, the inputs in this section are disabled. - Add field
shipAddress
"Shipping address" (3 lines, required) - Add field
shipCountry
"Country" (required) - Add field
shipTelephone
"Contact phone number"
- If user
-
Convert country code component from autocompleter to a dropdown with all options (active countries only)
-
Require some text to be present in the Notes field
-
Add "Direct use" to type of "Use of material"
Before the form is sent to the API the following processing must be done:
- Set
internalRequest = true
- If
userType === in
removeorgAddress
,orgCountry
,orgName
from JSON (set them toundefined
) - If
(userType === or && !useOrgAddress) || (userType === in && !useMyAddress)
then setshipAddrFlag = 'd'
otherwise remove allshipXxx
fields from JSON