frontend icon indicating copy to clipboard operation
frontend copied to clipboard

Instruments page is empty if `customMetadata` exists

Open alahiff opened this issue 1 year ago • 2 comments

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.

alahiff avatar Oct 25 '24 15:10 alahiff

@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.

nitrosx avatar Nov 05 '24 08:11 nitrosx

Ok, thankyou.

We have a workaround in place which, while probably incorrect, enables instruments to be listed and allows the metadata to be displayed in a basic way:

https://github.com/alahiff/frontend/commit/0bb77fb07ef2b983db0ef4cabf8626324ecdb8bf

alahiff avatar Nov 14 '24 08:11 alahiff