openhealthcare / elcid

elCID deployment for UCLH
http://elcid.openhealthcare.org.uk
Other
7 stars 3 forks source link

Assignment instead of equality test in ng-show logic will always return Truthy #1572

Closed pacharanero closed 5 years ago

pacharanero commented 6 years ago

In elcid-uch /elcid/templates/wardrounds/discharged_detail.html we have:

https://github.com/openhealthcare/elcid/blob/d33f828efc14aae2a58534ce886250666c58cd86/elcid/templates/wardrounds/discharged_detail.html#L30

We found this while implementing a fix to https://github.com/openhealthcare/elcid/issues/1557 - @fredkingham and I were looking into what hide_discharge_action does and found that a) the flag hide_discharge_action doesn't appear to be set anywhere in the Opal or Elcid codebases, and b) this expression will assign hide_discharge_action=true, which always returns true and therefore the ng-show span is always shown, irrespective of the state of hide_discharge_action.

fix:

davidmiller commented 5 years ago

This is the intended behaviour - e.g. it's supposed to assign there.... We've removed the flag wholesale as of Opal 0.13.0 - closing this accordingly.