pez-globo / pufferfish-software

All software for the Pufferfish ventilator.
Apache License 2.0
0 stars 1 forks source link

Disable start button in frontend until backend becomes available #339

Closed rohanpurohit closed 3 years ago

rohanpurohit commented 3 years ago

… (#325)

ethanjli commented 3 years ago

Right now the behavior I observe on the landing page is:

I see this behavior on the landing page, but not on the quickstart screen.

I believe the reason this behavior happens is that you assume that the backend is connected at the start, then you wait to see if the backend is lost based on a timeout which fires "BACKEND_CONNECTION_LOST". Maybe it would be cleaner if the button started as "Loading" by default, and then a "BACKEND_CONNECTION_INITIALIZED" event were fired which changed it to "Start"?

Minor feedback: let's have the button say "Loading...", rather than just "Loading".

ethanjli commented 3 years ago

Note related to futureproofing for the first task I'm working on this week (making the frontend initialize its store's ParametersRequest, AlarmLimitsRequest, etc., as undefined and wait for the backend to give it the initial values): (ignore everything in italics, we discussed a better solution in our meeting) _eventually we will want BACKEND_CONNECTION_INITIALIZED to be dispatched once the store's ParametersRequest, AlarmLimitsRequest, etc., are no longer undefined. It would be helpful if you could create an action for BACKEND_CONNECTIONINITIALIZED in such a way that I can go back in and modify its trigger conditions, e.g. using a selector. The approach we discussed trying out is just to make a selector which decides whether the backend connection is initialized, based on the values of things in the store.

rohanpurohit commented 3 years ago

Still working on it! has known issues, pushed to discuss approach and code review

rohanpurohit commented 3 years ago

@ethanjli This PR is ready for testing and code review.

rohanpurohit commented 3 years ago
  1. 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.
  2. Were any of these contributions also part of work you did for an employer or a client? No.
  3. Does this work include, or is it based on, any third-party work which you did not create? No.