Skip to content

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.

image

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

  1. Convert the form to react-hook-form.

  2. Force internalRequest = true and show the full "Requestor information" form

  3. 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" and or "This request is related to my work"
    • If user selected userType === or, then enable the section for "Organization" data:
      • orgName "Organization name" (required if userType === or)
      • orgAddress "Organization address" (required if userType === or)
      • orgCountry "Organization country" (required if userType === or)
      • Add fieldsaoName and aoSurname 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 checkbox useOrgAddress "Use organization address". When checked, the inputs in this section are disabled.
      • If user userType === in show checkbox useMyAddress "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"
  4. Convert country code component from autocompleter to a dropdown with all options (active countries only)

  5. Require some text to be present in the Notes field

  6. Add "Direct use" to type of "Use of material"

Before the form is sent to the API the following processing must be done:

  1. Set internalRequest = true
  2. If userType === in remove orgAddress, orgCountry, orgName from JSON (set them to undefined)
  3. If (userType === or && !useOrgAddress) || (userType === in && !useMyAddress) then set shipAddrFlag = 'd' otherwise remove all shipXxx fields from JSON
Edited by Matija Obreza
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information