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

refactor(protocol-designer): tip position modal max values round down #14972

Merged
merged 3 commits into from
Apr 22, 2024

Conversation

jerader
Copy link
Collaborator

@jerader jerader commented Apr 22, 2024

closes AUTH-352

Overview

Since we are rounding the ranges for the x/y values to the nearest 1 decimals, they were being rounded up for the max value which resulted in the highest value in the description to be out of range. This PR rounds down instead of up.

Test Plan

Just review the code, the test cases tests this.

Changelog

  • use lodash floor to round down if needed
  • fix test

Review requests

see test plan

Risk assessment

low

@jerader jerader requested a review from a team as a code owner April 22, 2024 14:43
@jerader jerader requested review from koji and ncdiehl11 and removed request for a team April 22, 2024 14:43
case 'down': {
return floor(Number(value), DECIMALS_ALLOWED)
}
}
return value === null ? 0 : round(Number(value), DECIMALS_ALLOWED)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this line is not needed anymore since the line itself is unreachable and the above switch statement covers the value !== null

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oops thanks, i forgot to delete it

Copy link
Contributor

@koji koji left a comment

Choose a reason for hiding this comment

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

left one comment but the changes look good to me.

@jerader jerader merged commit 58a1fc0 into edge Apr 22, 2024
14 checks passed
@jerader jerader deleted the pd_round-down-for-upper-range branch April 22, 2024 15:48
y3rsh added a commit that referenced this pull request Apr 23, 2024
* edge: (194 commits)
  fix(app): clone run with RTPs from HistoricalProtocolRun (#14959)
  fix(api): Filter out `air_gap()` calls as higher-order commands (#14985)
  fix(app): fix infinitely re-rendering/never rendering firmware success toasts (#14981)
  feat(api): add option to ignore different tip presence states (#14980)
  feat(opentrons-ai-client) add input textbox to container (#14968)
  fix(app): add robotSerialNumber to proceedToRun event (#14976)
  fix(api): remove homing patch fix for right mount when a 96-channel is attached (#14975)
  feat(api-client,app,react-api-client): upload splash logo from desktop app (#14941)
  fix(robot-server): notify /runs when a non-current run is deleted (#14974)
  feature(api, robot-server): Allow fixit commands to recover from an error (#14908)
  feat(hardware-testing): enable multi sensor processing in liquid probe (#14883)
  fix(app): prevent "run again" banner from rendering after navigating away from the current run (#14973)
  refactor(components): refactor roundtab stories (#14956)
  refactor(protocol-designer): assign module slot in createFileWizard instead of modal (#14951)
  fix(app, api-client): fix choose protocol slideout issue (#14949)
  refactor(protocol-designer): tip position modal max values round down (#14972)
  feat(app): add tiprack selection step to quick transfer flow (#14950)
  ci(shared-data): install dependencies in workflow (#14958)
  fix(components): fix icon stories (#14969)
  feat(opentrons-ai-client): introduce react-markdown to chat display component (#14965)
  ...
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