refactor(app): move robot lights controls to state.robotControls #4631
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
overview
This PR follows up on the refactor work completed in #4440, #4477, #4544, #4599, and #4615. The endpoints being moved today are:
GET /robot/lights
POST /robot/lights
changelog
app/src/robot-controls
fetchLights
+ success / failure,updateLights
+ succcess / failure)state.robotControls
reducergetLightsOn
)fetchLightsEpic
,updateLightsEpic
)RobotControlsCard
:fetchLights
on mountupdateLights
on lights toggle clickrestartRobot
on restart button clickImportant to note: Previously, the deck calibration button was not disabled if you weren't "connected" to the robot. Given that the "Home" and "Restart" buttons were disabled in this instance, the DC button seemed like an oversight. This PR now guards the DC button behind the same logic as "Home" and "Restart"
review requests
All changes are in the "Robot Controls" card of the robot settings page
GET /robot/lights
is called