AllenNeuralDynamics / aind-metadata-entry-js

Metadata entry using javascript
https://metadata-entry.allenneuraldynamics.org
MIT License
1 stars 1 forks source link

Display full property name for validation errors #164

Closed helen-m-lin closed 3 weeks ago

helen-m-lin commented 5 months ago

Is your feature request related to a problem? Please describe. As a user, it is hard to understand the validation errors since they do not show which schema the property is for.

Another example, seen in the screenshot below. The full property is present in the logs but not in the displayed UI,

image

Describe the solution you'd like We can display the full property name by adding a transformErrors function to the rjsf props (docs). Something like this would work since error.stack is what is displayed in the UI:

function transformErrors(errors) {
    return errors.map(error => {
      if (error.property) { error.stack = `${error.property}: ${error.stack}` }
      return error
    })
  }

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.