As it turned out Toolbar was dispatching parameter request draft in a function called as initParameterUpdate which was in a huge Toolbar component, therefore the behavior we observed was the mode dropdown button, start button, etc almost the entire toolbar would redraw when we changed values on QuickStart Page
Therefore, ToolBar was decomposed into
HeaderClock.tsx (clock component on the right side)
PowerIndicator.tsx (battery indicator on the toolbar)
StartPauseButton (contains all the logic related to start/pause ventilation, also contains StartButtonModalPopup that opens Alarm Limits Discard Modal Popup when there are unsaved changes on AlarmsPage, currently this component is small enough, but can be moved to a different file if required)
A generic ParamValueClicker component was added and moved into a separate file, which accepts props like selector
In conclusion, changes made on QuickStartPage will only redraw the StartPauseButton component after this PR.
Fixed ValueClicker redraws on MultiStep Modal Popup:
Here the commitDraftRequest was done for FiO2 and Flow value modals so that we can show them in top-level breadcrumbs modal, Currently, its achieved by dispatching when the user clicks on the reply icon button or one of the tabs
Fixed ValueClicker redraw on AlarmsPage:
AlarmsPage again was a huge JSX in one component, it was further decomposed into:
modules/alarms/limits/AlarmLimits, this is the primary alarm limits component that is used in modules/alarms/limits/Alarms.tsx file where we map and create numerous components depending on the number of alarms we need for different parameters.
modules/alarms/limits/Alarms.tsx as stated above is a simple component that creates multiple alarm limits modals on the page.
modules/alarms/limits/AlarmLimitsModalPopup, this file contains components that open AlarmLimits ModalPopup when user clicks on Submit and Cancel.
AlarmsPage is renamed to AlarmLimitsPage and moved to modules/alarms/limits, this encapsulates all the components stated above on the alarms page.
TODO:
add JSDOC comments wherever appropriate and for new files
This project is licensed under Apache License v2.0 for any software, and Solderpad Hardware License v2.1 for any hardware - do you agree that your contributions to this project will be under these licenses, too? Yes.
Were any of these contributions also part of work you did for an employer or a client? No.
Does this work include, or is it based on, any third-party work which you did not create? No.
This PR fixes #419
Changes:
Fixed ValueClicker redraw on QuickStart:
As it turned out
Toolbar
was dispatching parameter request draft in a function called asinitParameterUpdate
which was in a hugeToolbar
component, therefore the behavior we observed was the mode dropdown button, start button, etc almost the entire toolbar would redraw when we changed values onQuickStart
PageStartButtonModalPopup
that opens Alarm Limits Discard Modal Popup when there are unsaved changes onAlarmsPage
, currently this component is small enough, but can be moved to a different file if required)ParamValueClicker
component was added and moved into a separate file, which accepts props likeselector
In conclusion, changes made on
QuickStartPage
will only redraw theStartPauseButton
component after this PR.Fixed ValueClicker redraws on MultiStep Modal Popup:
commitDraftRequest
was done forFiO2
andFlow
value modals so that we can show them in top-level breadcrumbs modal, Currently, its achieved by dispatching when the user clicks on thereply
icon button or one of thetabs
Fixed ValueClicker redraw on AlarmsPage:
Submit
andCancel
.AlarmsPage
is renamed toAlarmLimitsPage
and moved tomodules/alarms/limits
, this encapsulates all the components stated above on the alarms page.TODO: