AllenNeuralDynamics / aind-metadata-entry-js

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

Add check for undefined type for consts #156

Closed helen-m-lin closed 5 months ago

helen-m-lin commented 5 months ago

Describe the bug Some const fields do not have type in the schema, which is causing the UI to display "Unknown field type undefined" warnings. This is confusing for users. Please note this is currently only seen when the const value is null. Const strings without a defined type seem to be showing up fine.

To Reproduce This issue is seen whenever there are const fields that are null. For example, Manufacturers has many null const fields. Steps to reproduce the behavior:

  1. Go to https://metadata-entry.allenneuraldynamics.org/
  2. Select Instrument schema and scroll down to Instrument Manufacturer
  3. Observe warnings

Expected behavior The field values should not be displayed at all if they are null.

Screenshots image

Additional context The underlying issue is related to https://github.com/AllenNeuralDynamics/aind-data-schema/discussions/822 and may be resolved with a newer pydantic release. In the future, we may want to check if this manual type check is still needed and remove it if not.

Additionally, in the UI there may be some non-null const fields whose values do not get displayed. This is a separate issue being tracked in #102