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, api-client, react-api-client): delete POC TLC calibration data from overflow menu #12075

Merged
merged 8 commits into from
Feb 1, 2023

Conversation

jgbowser
Copy link
Contributor

@jgbowser jgbowser commented Jan 27, 2023

Overview

adds a Delete calibration data option to the overflow menus for TLC and POC calibrations from the
robot settings calibration page. Also adds to the api-client and react-api-client packages, methods to
make a DELETE request to the /calibrations endpoint

closes RAUT-307

Screen.Recording.2023-01-27.at.1.43.38.PM.mov

Test Plan

Visited the Robot settings calibration page and ensured the POC and TLC overflow menus had the Delete calibration data options present. Clicked the delete option and ensured that the next page refresh showed the correct remaining calibrations. Double-checked local calibration data in the .opentrons folder to ensure the correct calibration data was removed

Changelog

  • app: adds "Delete calibration data" to the POC and TLC overflow menus in the robot settings calibrations page
  • api-client: adds the robot-calibrations directory and the deleteCalData function
  • react-api-client: adds the robot-calibrations directory and the useDeleteCalDataMutation hook

Review requests

Ensure the changes behave as expected using the above Test Plan as guidance. Ensure the mutation logic, and handle delete logic in the app all look appropriate

Risk assessment

Med - low, changes span several packages, but all new behavior is contained in a single user interaction

@codecov
Copy link

codecov bot commented Jan 27, 2023

Codecov Report

Merging #12075 (02cc1b5) into edge (2cd7948) will decrease coverage by 0.26%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             edge   #12075      +/-   ##
==========================================
- Coverage   73.99%   73.73%   -0.26%     
==========================================
  Files        2197     1440     -757     
  Lines       60839    47611   -13228     
  Branches     6456     2988    -3468     
==========================================
- Hits        45017    35106    -9911     
+ Misses      14300    12050    -2250     
+ Partials     1522      455    -1067     
Flag Coverage Δ
app 46.34% <ø> (-26.17%) ⬇️
protocol-designer 45.89% <ø> (ø)
react-api-client 83.46% <100.00%> (+0.40%) ⬆️
step-generation 88.46% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...nt/src/calibration/useDeleteCalibrationMutation.ts 100.00% <100.00%> (ø)
...ngsCalibration/CalibrationDetails/OverflowMenu.tsx
...n/CalibrationDetails/TipLengthCalibrationItems.tsx
...rc/redux/robot-admin/epic/fetchResetOptionsEpic.ts
app/src/redux/protocol/reducer.ts
app/src/redux/custom-labware/actions.ts
app/src/redux/analytics/hash.ts
app/src/atoms/MenuList/index.tsx
app/src/organisms/LabwareDetails/index.tsx
app/src/redux/protocol/selectors.ts
... and 749 more

@jgbowser jgbowser force-pushed the raut-307-overflow-delete-cal-data branch from e29795b to 0b7944d Compare January 27, 2023 22:53
…ata from overflow menu

adds a Delete calibration data option to the overflow menus for TLC and POC calibrations from the
robot settings calibration page. Also adds to the api-client and react-api-client packags methods to
make a DELETE request to the /calibrations endpoint

closes RAUT-307
@jgbowser jgbowser force-pushed the raut-307-overflow-delete-cal-data branch from 0b7944d to 0507edd Compare January 27, 2023 23:31
@jgbowser jgbowser marked this pull request as ready for review January 30, 2023 05:35
@jgbowser jgbowser requested review from a team as code owners January 30, 2023 05:35
@jgbowser jgbowser requested review from jerader and a team and removed request for a team January 30, 2023 05:35
@@ -8,3 +8,4 @@ export * from './protocols'
export * from './server'
export * from './modules'
export * from './pipettes'
export * from './robot-calibrations'
Copy link
Contributor

Choose a reason for hiding this comment

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

Our naming pattern in api-client and react-api-client has been to name the resource directory after the api resource in the path directly. Because the api resource this is accessing is at /calibration/... we would name this directory calibration.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, gotcha. Looks like calibration works fine, I initially had calibrations and the .gitignore rules were ignoring the folder, I'll go ahead and make these naming updates shortly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Naming scheme updated

import type { HostConfig, EmptyResponse } from '../types'
import type { DeleteCalRequestParams } from './types'

export function deleteCalData(
Copy link
Contributor

Choose a reason for hiding this comment

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

This file and function should be called deleteCalibration if following past api-client additions
.

const { deleteCalData } = useDeleteCalDataMutation()

const handleDeleteCalibrationData = (
calType: 'pipetteOffset' | 'tipLength',
Copy link
Contributor

Choose a reason for hiding this comment

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

calType doesn't have to be passed in as a param because it's already a top level prop here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was my initial thought, but I followed the lead of the handleDownload and handleCalibration functions in this file that also passed in the calType as an argument, happy to make the change here though if you think I should

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Went ahead and removed this param from this function, as well as the other similar handler functions in this file for consistency's sake

@@ -136,6 +143,9 @@ export function OverflowMenu({
const applicablePipetteOffsetCal = pipetteOffsetCalibrations?.find(
p => p.mount === mount && p.pipette === serialNumber
)
const applicableTipLengthCal = tipLengthCalibrations?.find(
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not a reliable way of retrieving the correct TLC data to delete, because it doesn't take into consideration the the tiprack identity. Each entry in the outer TLC table should probably pass through a callback or both the tiprack and pipette info to match on

Copy link
Contributor Author

Choose a reason for hiding this comment

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

additional check on the tiprackUri added to make this reliable

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.

Changes look good 👍

@jgbowser jgbowser merged commit 9f65452 into edge Feb 1, 2023
@jgbowser jgbowser deleted the raut-307-overflow-delete-cal-data branch February 1, 2023 23:49
y3rsh added a commit that referenced this pull request Feb 7, 2023
* edge: (116 commits)
  feat(system-server): add sqlite database and barebones HTTP server (#12085)
  feat(ot3): add enableOT3FirmwareUpdates feature flag to gate firmware update functionality. (#12102)
  feat(app): add bare bones hardware section to protocol details (#12099)
  feat(app): Support failed calibrations in the calibration wizard (#12092)
  refactor(docs): clean up Versioning page (#12084)
  refactor(robot-server): Make run and protocol limits configurable at launch (#12094)
  feat(app): add robotServerVersion to display the current robot software version (#12096)
  fix(hardware): do not track tip motor positions (#12093)
  feat(engine): allow calibrateGripper command to save calibration data (#12046)
  feat(app, api-client, react-api-client): delete POC TLC calibration data from overflow menu (#12075)
  fix(api): actually update OT3 instrument calibration offset in cache instrument (#12089)
  fix(robot-server): correct the data returned from instruments endpoint (#12067)
  feat(api): add thermocycler plate lift to hardware controller (#12068)
  fix(app): reference moduleId from result not params (#12077)
  feat(app): create ODD protocol setup page (#12071)
  refactor(api): Deprecate presses and increment args when using PAPI pick_up_tip (#12079)
  fix(ot3): handle multiple responses for a tip action request (#12083)
  refactor(api): touch tip implementation for PAPIv2 engine core (#12053)
  refactor(app): Remove ssid parameter from OnDeviceRouteParams (#11930)
  fix(api): fix broken test in the api hardware controller (#12080)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants