inveniosoftware / react-invenio-deposit

React application for Invenio deposit forms.
https://react-invenio-deposit.readthedocs.io
MIT License
3 stars 46 forks source link

doi: doi component doesn't display errors on first save #403

Open zzacharo opened 2 years ago

zzacharo commented 2 years ago

Package version: RDM@v7.0

Describe the bug

The PIDField component doesn't display errors when you click save for the first time

Steps to Reproduce

  1. Go to '/uploads/new'
  2. Fill in a random value as an external DOI e.g 1234
  3. Click on Save draft
  4. See the errors in the top section and specifically the DOI: invalid scheme
  5. Notice that the PIDField is not in an error state.
  6. Change the field in another invalid value and click save again.
  7. See that now the PIDField is correctly in an error state.

Expected behavior

The component should be in an error state after the first save.

Additional context

Maybe it's worth cheking formik.setStatus() function in which you can set an arbitrary state e.g backendErrors. That way, we can distinguish backend from frontend errors. To evaluate the extend of changes needed.

lnielsen commented 2 years ago

Left over from #401