SciCatProject / frontend

SciCat open data catalogue web client
https://scicatproject.github.io
BSD 3-Clause "New" or "Revised" License
23 stars 26 forks source link

Instruments page is empty if `customMetadata` exists #1627

Open alahiff opened 1 week ago

alahiff commented 1 week ago

Issue Name

Instruments page is empty if customMetadata exists

Summary

If an instrument includes customMetadata then the /instruments page is empty. In the browser's web developer tools console there is an error:

ERROR TypeError: n.value is undefined

Steps to Reproduce

  1. Create an instrument without any customMetadata
  2. Click on the instrument on the /instruments page
  3. Click on the Edit tab in the Custom Metadata section
  4. Click on +, and select Add new row
  5. Specify any name and value
  6. Click the tick and click the save button
  7. Go back to the /instruments page and make sure the page has reloaded

Current Behaviour

See above.

Expected Behaviour

Expect instruments to be listed whether or not they have custom metadata

Extra Details

Experience this problem in frontend versions 4.4.1 and 4.5.0. The problem occurs both with metadata which looks like this:

customMetadata: { name1: 'value1' },

and metadata which looks like this:

customMetadata: {
  attr1: { value: 10, unit: 'angstrom', valueSI: 1e-9, unitSI: 'm' }
},

Both of the above were examples generated using the Add new row in the UI.

nitrosx commented 21 hours ago

@alahiff thank you for reporting this issue. I promise that we will look into it, although at the moment resources are pretty tied up in few other things.