Conversation
60f97ab to
752f899
Compare
752f899 to
26ab615
Compare
|
Nice! |
I am not showing the details button when the MOC is used for a search interface, like dce, spherex, or euclid. For coverage views I enable it. |
I will look at this |
| if (viewProps.value && !viewProps.displayValue) { | ||
| // eslint-disable-next-line react-hooks/immutability | ||
| viewProps.displayValue = convertQuantityUnits(viewProps.value, viewProps.quantityBaseUnit, viewProps.unit); | ||
| } |
There was a problem hiding this comment.
I did something very similar but I'm firing the changes in store instead of modifying the stateful prop (viewProps.displayValue in here). Also check with 0 is important otherwise it gets ignored in falsy value check.
Following is what I tested and is working for my PR:
| if (viewProps.value && !viewProps.displayValue) { | |
| // eslint-disable-next-line react-hooks/immutability | |
| viewProps.displayValue = convertQuantityUnits(viewProps.value, viewProps.quantityBaseUnit, viewProps.unit); | |
| } | |
| useEffect(() => { | |
| // if value changed in the store (for e.g. by a setFieldValue()) and there's no displayValue, set it | |
| if ((viewProps?.value || viewProps?.value===0) && viewProps?.unit && !viewProps?.displayValue) { | |
| const newDisplayValue = convertQuantityUnits(viewProps.value, quantityBaseUnit, viewProps.unit); | |
| fireValueChange({displayValue: newDisplayValue}); | |
| } | |
| }, [viewProps?.value, viewProps?.unit, viewProps?.displayValue, fireValueChange, convertQuantityUnits, quantityBaseUnit]); |
881f701 to
4470715
Compare
- include some reponse from feedback
4470715 to
fa56af2
Compare


Firefly-1924: Add Legend Support
xssize for buttonife PR: https://github.com/IPAC-SW/irsa-ife/pull/459
Testing