Closed rohanpurohit closed 3 years ago
@ethanjli observations from testing on my end:
start
button now shows Connecting
, but on plugging it back in, could you describe what do we want? currently, it toggles ventilation, which I suppose is undesirable. let me know!@ethanjli This PR is ready for testing/code review. I have updated the PR description with the latest changes, in terms of code quality:
useState
for opening the modalPopup on Pause Ventilation
and a separate OnConfirm
handler for the same.useState
for disabling
the buttons as the StartPauseVentilation
button is not really disabled
now other than when it says Connecting...
following the scenarios here #361 comment.Thanks, I will test and review. Were you able to identify the source of the behavior you reported about the backend's "firmware disconnected" alarm not causing the frontend to show it as an active alarm (with a red border)?
Thanks, I will test and review. Were you able to identify the source of the behavior you reported about the backend's "firmware disconnected" alarm not causing the frontend to show it as an active alarm (with a red border)?
sorry! I forgot about that, moreover so because we have disabled the mute button on firmware disconnection, but I realize we have to find the cause for that regression. I will do that now!
@ethanjli the behavior actually makes sense, so the mute button sends a request when it's clicked to change the active
state of AlarmMute
message and that certainly won't happen when the firmware is disconnected, and the red border
and audio
for alarms looks at the getAlarmMuteActive
selector which is AlarmMute
message active
field, so whatever was the state
before firmware was disconnected remains
, that is if mute
was active before disconnection, there won't be a border/audio and vice-versa. for the backend disconnection
we look at just AlarmMuteRequest
active
therefore we can toggle the border and audio.
I see. From your explanation, I must have misunderstood what the behavior was. I had thought that you meant that when the firmware got disconnected, backend created an active alarm but that never triggered the red border in the frontend (even when alarms weren't muted). Instead, it looks like the behavior is as follows:
This observation is useful for informing how we should implement #372, though I haven't thought about that enough to propose any concrete approaches.
Observations from testing against #361: everything works as expected, except when ventilation is inactive and the firmware disconnects - the comment I made at https://github.com/pez-globo/pufferfish-software/issues/361#issuecomment-863733123 only partially specified the desirable behavior, by describing a less desirable behavior. Perhaps what we should have here is that when the backend or firmware are disconnected in standby mode, then the "Start Ventilation" is disabled and says either "Loading...", "Connecting...", or something else. Let's discuss to see if this behavior would make the most sense for usability and safety, or if we should have some other behavior.
I'm also wondering if it might make more sense to say "Loading..." instead of "Connecting...", or even to have the button label say "Starting Ventilation..." or "Pausing Ventilation..." in their corresponding situations instead of "Connecting...".
Additional observations:
EventAlerts.tsx
I see code to disable the Alarm Mute button when the firmware is disconnected. But when I actually disconnect the firmware, I don't see this button getting changing or being disabled.~ I'm not able to reproduce this, I'll look out to see if it happens again
This PR includes:
Issue #390:
isVentilatorOn
useState,ventilating
selector is usedlandingLabel
useStateIssue #331:
useEffect
callinginitParameterUpdate
,currently called fromStartPauseVentilation
button'sOnClick
handler.Issue #361:
StartPauseVentilation
button'sOnClick
handler to handle these 3 scenarios commentStart ventilation
Misc Refactor/feature addition:
dispatchParameterRequest
method for better code-readability.LandingPage
to simplify code and to avoidUseStates
.Pause Ventilation
when there are unsaved changes in alarm limitsModalContent
component that hasdiscard or Keep Previous Values
content of alarm modal.ModalContent
is reused inAlarmsPage
,SideBarSlideRoute
,ToolBar
Mute button
is disabled on connection loss to firmwareeslint-disable-next-line react-hooks/exhaustive-deps