Closed abigailalexander closed 7 months ago
Additional changes:
Thanks for this PR. I tested by creating a BOB screen and a OPI screen with these different widgets. I compared the display in the web UI vs Phoebus/CSS. I found a few difference which I list below with examples:
Unrelated to changes made in this PR but I did notice in the Firefox console that a warning is thrown from the opiParser on line 560 where it complains that props.points
is undefined.
I think line https://github.com/dls-controls/cs-web-lib/blob/b8dfe4e4f8d2707255e615b7fcfd01a2502e0070/src/ui/widgets/EmbeddedDisplay/opiParser.ts#L560 needs changing from:
props.points.point.forEach((point: any) => {
to
props.points?.point.forEach((point: any) => {
Finally, I wasn't entirely sure how to test the EmbeddedDisplay resize property. I added it to the JSON file and changed the value between 1,2,3,4 but didn't notice a particular change in the web UI. Was I testing this incorrectly?
Thanks for pointing those out Becky! These last few commits should fix most of the issues you raised, with the exception of 7 - it seems like cs-web-lib is discarding props that are empty strings, which is why instead of BoolButton receiving the value from the .bob file of "", it instead uses the default "OFF" value set in the widget component.
Do we want to change the behaviour to allow for empty strings to be used as props? It seems like in this use case it makes sense.
Also regarding the embeddedDisplay resize change, I previously tested it by having a .bob file with an embeddedDisplay widget in the screen like so:
<widget type="embedded" version="2.0.0">
<name>Embedded Display_1</name>
<file>my_file.bob</file>
<x>30</x>
<y>550</y>
</widget>
It could be that the changes I made aren't supported well by json files, so I'll look into that as well.
Thanks for the fixes Abii. I've picked up a few bits relating to these changes.
width
and height
properties. In Phoebus you do not necessarily require these if using the default size so it is possible that these are missing from the widget and the web UI should allow it and use some default values.The two remaining issues are:
And finally, thank you for the tip on testing the resize
option - I've been able to test that now.
Thanks for your comments Becky. I think we're planning to prioritise Phoebus appearance, as the plan is to use .bob files in the Web UI. I've hopefully now sorted the issues with the led on the BoolButton widget, and allowed empty string parsing for property fields which could deliberately be left empty. This list of "allowed empty" widgets is stored as a list in the parser.ts file.
The ByteMonitor height and width can be undefined now as well - I had accidentally changed them from optional props to mandatory. Thank you again for your help in reviewing these widget changes
Thanks for the further changes Abii. The LED position on the BoolButton now looks great and scales appropriately similar to as it does in Phoebus. Defaults also look good now. It is just the 'Labels from PV' on the BoolButton that don't appear to be working in the web version but I think this is a feature that has never been implemented (neither in the opiParser) and may be a bit more involved so do you think it would be fair to call that a separate issue and merge these current changes?
I made several updates to widgets to reflect Phoebus default and behaviours
In addition I have updated the bob parsing, so all necessary props for existing widgets can be parsed in both .bob and .opi.