Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(app): Expose Labware Calibration Status on the FileInfo Page #6100

Merged
merged 18 commits into from
Jul 28, 2020

Conversation

Laura-Danielle
Copy link
Contributor

@Laura-Danielle Laura-Danielle commented Jul 9, 2020

Overview

Closes #5555 . This is the front-end side of skipping labware calibration.

Changelog

  • Add epic/selector/action etc in order to access the new labware/calibrations endpoint
  • Add tests associated with the above
  • Modify the FileInfo component to match with the new design
  • Add component tests

Review requests

There are more endpoints under labware/calibrations to access a single labware calibration -- I wasn't sure if this was useful to implement at this time. Happy to add it to the pull request as needed (wouldn't be used in any of the components here).

I am also still working on some more component tests (having issues with mocks), but I wanted to get this in front of people. Let me know if there are other tests I should add.

Test Plan

  • Check that uploading a file uses the new design in Epic: Display(Make skipping) labware calibration easier #5555
  • With no labware previously calibrated it should:
  • Say not yet calibrated
  • The button should still say Proceed to Calibrate and bring you to the calibration page
  • With labware previously calibrated it should:
  • Give the offset values for the labware
  • The button should still say Proceed to Run and bring you to the run page
  • Check that while calibrating, the calibration is updated in real time when you navigate back to the file info page

Risk assessment

High, this is a new user facing feature that will be used very often. We should thoroughly test and go through user testing rigors. Should this potentially be behind a feature flag?

┆Issue is synchronized with this Wrike Task by Unito

@Laura-Danielle Laura-Danielle added feature Ticket is a feature request / PR introduces a feature app Affects the `app` project labels Jul 9, 2020
@Laura-Danielle Laura-Danielle requested review from pantslakz, a team and b-cooper and removed request for a team July 9, 2020 19:14
@sfoster1 sfoster1 requested a review from nusrat813 July 9, 2020 20:01
Copy link
Contributor

@mcous mcous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking like it's on the right track code-wise. Added some early feedback as you continue to fix up tests and stuff

app/src/calibration/labware/index.js Outdated Show resolved Hide resolved
app/src/components/FileInfo/index.js Outdated Show resolved Hide resolved
app/src/components/FileInfo/ProtocolLabwareList.js Outdated Show resolved Hide resolved
app/src/components/FileInfo/ProtocolLabwareList.js Outdated Show resolved Hide resolved
app/src/components/FileInfo/ProtocolLabwareList.js Outdated Show resolved Hide resolved
app/src/components/FileInfo/ProtocolLabwareList.js Outdated Show resolved Hide resolved
app/src/components/FileInfo/ProtocolLabwareList.js Outdated Show resolved Hide resolved
app/src/components/FileInfo/ProtocolLabwareCard.js Outdated Show resolved Hide resolved
@Laura-Danielle Laura-Danielle force-pushed the app_expose_labware_calibration_status branch from 530d447 to 9f3be08 Compare July 12, 2020 04:30
@Laura-Danielle Laura-Danielle requested a review from a team as a code owner July 12, 2020 04:30
@Laura-Danielle Laura-Danielle requested a review from a team as a code owner July 14, 2020 15:56
@Laura-Danielle Laura-Danielle added api Affects the `api` project ready for review and removed WIP labels Jul 17, 2020
mcous
mcous previously requested changes Jul 20, 2020
Copy link
Contributor

@mcous mcous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know if you have any questions about any of this

app/src/calibration/index.js Outdated Show resolved Hide resolved
app/src/calibration/index.js Outdated Show resolved Hide resolved
app/src/calibration/labware/actions.js Outdated Show resolved Hide resolved
app/src/components/FileInfo/index.js Outdated Show resolved Hide resolved
app/src/components/FileInfo/ProtocolLabwareCard.js Outdated Show resolved Hide resolved
app/src/components/FileInfo/ProtocolLabwareCard.js Outdated Show resolved Hide resolved
app/src/components/FileInfo/index.js Outdated Show resolved Hide resolved
app/src/components/FileInfo/ProtocolLabwareCard.js Outdated Show resolved Hide resolved
@Laura-Danielle Laura-Danielle requested a review from mcous July 23, 2020 20:16
@codecov
Copy link

codecov bot commented Jul 24, 2020

Codecov Report

❗ No coverage uploaded for pull request base (edge@73152e3). Click here to learn what that means.
The diff coverage is 95.18%.

Impacted file tree graph

@@           Coverage Diff           @@
##             edge    #6100   +/-   ##
=======================================
  Coverage        ?   67.61%           
=======================================
  Files           ?     1213           
  Lines           ?    33793           
  Branches        ?        0           
=======================================
  Hits            ?    22848           
  Misses          ?    10945           
  Partials        ?        0           
Impacted Files Coverage Δ
...src/calibration/epic/fetchCalibrationStatusEpic.js 100.00% <ø> (ø)
app/src/components/FileInfo/index.js 83.33% <ø> (ø)
app/src/epic.js 0.00% <ø> (ø)
app/src/protocol/selectors.js 82.35% <ø> (ø)
app/src/components/FileInfo/ProtocolLabwareCard.js 77.77% <75.00%> (ø)
app/src/calibration/epic/index.js 100.00% <100.00%> (ø)
app/src/calibration/index.js 100.00% <100.00%> (ø)
app/src/calibration/labware/actions.js 100.00% <100.00%> (ø)
app/src/calibration/labware/constants.js 100.00% <100.00%> (ø)
...ion/labware/epic/fetchAllLabwareCalibrationEpic.js 100.00% <100.00%> (ø)
... and 1220 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 73152e3...674a810. Read the comment docs.

Copy link
Contributor

@mcous mcous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this is ready yet

app/src/calibration/reducer.js Outdated Show resolved Hide resolved
app/src/calibration/index.js Outdated Show resolved Hide resolved
app/src/calibration/labware/actions.js Outdated Show resolved Hide resolved
app/src/calibration/labware/selectors.js Outdated Show resolved Hide resolved
app/src/calibration/labware/selectors.js Outdated Show resolved Hide resolved
app/src/epic.js Outdated Show resolved Hide resolved
app/src/protocol/selectors.js Outdated Show resolved Hide resolved
app/src/robot-api/__tests__/http.test.js Outdated Show resolved Hide resolved
app/src/robot-api/types.js Outdated Show resolved Hide resolved
robot-server/robot_server/service/labware/router.py Outdated Show resolved Hide resolved
@mcous mcous dismissed their stale review July 28, 2020 05:47

Pushed changes to this branch

@mcous
Copy link
Contributor

mcous commented Jul 28, 2020

Summary of changes that I pushed:

  • Removed query param behavior from GET /labware/calibrations actions
    • The reducer wasn't built to handle partial responses, so I removed the functionality rather than build out the reducer further
    • This functionality of the actions wasn't used, so it wasn't needed
  • Fixed bugs in the calibration reducer + selectors + typedefs where they wouldn't be able to handle having GET /labware/calibrations response in state without also having GET /calibration/status in state already
    • The UI doesn't/shouldn't guarantee that the endpoints are called in any particular order, nor that if one is called the other must also be called
  • Reworked the selector that feeds the labware list UI
    • Renamed it to getProtocolLabwareList
    • Fixed incorrect usage of Array.map
    • Added missing logic to use namespace and version in labware identity check
    • Added missing test cases to ensure proper flattening into the quantity count and proper linkage to calibration data from the response
  • Reworked the labware info components to lean more heavily on the selector and make better use of primitive components

Copy link

@nusrat813 nusrat813 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested - working as intended

Copy link
Contributor

@b-cooper b-cooper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 🖌️


// TODO(mc, 2020-07-27): this selector should move to a protocol-focused module
// when we don't have to rely on RPC-state selectors for protocol equipment info
// NOTE(mc, 2020-07-27): due to how these endpo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment was truncated somehow? Should it be removed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I should finish that comment. It was adding a note that v1 labware will always return "no calibration data" and that needs to be accounted for in UI

target.loadName === loadName &&
target.namespace === namespace &&
target.version === version &&
(!parent || target.parent === parent)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If !parent is supposed to matching the case where parent === '', it would be clearer to write that check explicitly

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is checking the case where parent === null (modulesBySlot[slot].model can never be '' to my knowledge), but good call on the explicit check, regardless


export function Continue(): React.Node {
const { path, disabledReason } = useSelector(getCalibrateLocation)
const [targetProps, tooltipProps] = useHoverTooltip({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛸 🔨 💁‍♂️

@sfoster1 sfoster1 merged commit 2a22f59 into edge Jul 28, 2020
@sfoster1 sfoster1 deleted the app_expose_labware_calibration_status branch July 28, 2020 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Affects the `api` project app Affects the `app` project feature Ticket is a feature request / PR introduces a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Epic: Display(Make skipping) labware calibration easier
5 participants