Chemical-Curation / chemcurator_vuejs

Chemical registration and curation tool
https://chemreg.epa.gov
1 stars 0 forks source link

99 add synonym #130

Closed michael-barbour closed 3 years ago

michael-barbour commented 3 years ago

closes #99

Adds a synonym button to add rows.

Note If Source or Synonym Quality is left blank a generic "this field is required" error pops up without any way of pointing. This could be decoded from the pointer or the django error message could change.

If Synonym Type is left blank the request 500s out despite this not being a required field due to failed validation.

scaduto commented 3 years ago

If Source or Synonym Quality is left blank a generic "this field is required" error pops up without any way of pointing. This could be decoded from the pointer or the django error message could change.

After testing, I do agree that the error is extremely generic and without having prior knowledge of the issue itself I would have had trouble decoding it. I think a change to back-end in regards to creating a more verbose error message would be the best route and could be reused as well.

If Synonym Type is left blank the request 500s out despite this not being a required field due to failed validation.

While this is an issue, I believe it is outside the scope of this ticket and a request for a bug issue to be opened should be brought up.

michael-barbour commented 3 years ago

If Source or Synonym Quality is left blank a generic "this field is required" error pops up without any way of pointing. This could be decoded from the pointer or the django error message could change.

Upon thinking about this more over the weekend. I think decoding the pointer into a field name makes sense. It might be worth having a mapping list in data().

{"data/attributes/source":"Source"} used to map the source pointer to a title string of "Source". Then when decoding the error just use the map to prepend the title string if one is found. "Source: This field is required".

I can fix this functionality on #96 or add it here if you'd strongly prefer.

The 500 still seems out of scope.

scaduto commented 3 years ago

If Source or Synonym Quality is left blank a generic "this field is required" error pops up without any way of pointing. This could be decoded from the pointer or the django error message could change.

Upon thinking about this more over the weekend. I think decoding the pointer into a field name makes sense. It might be worth having a mapping list in data().

{"data/attributes/source":"Source"} used to map the source pointer to a title string of "Source". Then when decoding the error just use the map to prepend the title string if one is found. "Source: This field is required".

I can fix this functionality on #96 or add it here if you'd strongly prefer.

The 500 still seems out of scope.

I have no issue with you adding it on #96 - Whatever you think is going to be the most replicable for managing future error messages as well