Instruments page is empty if `customMetadata` exists
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
- Create an instrument without any
customMetadata - Click on the instrument on the
/instrumentspage - Click on the
Edittab in theCustom Metadatasection - Click on
+, and selectAdd new row - Specify any name and value
- Click the tick and click the save button
- Go back to the
/instrumentspage 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 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.
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