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

fix(protocol-designer): remove dropdown menu for module quantity #17531

Merged
merged 7 commits into from
Feb 19, 2025

Conversation

koji
Copy link
Contributor

@koji koji commented Feb 14, 2025

Overview

remove dropdown menu for module quantity and do a little bit refactoring.
remove the snackbar because it doesn't hit the module limit.

SelectModules still doing a lot of things in the component.

Refactoring is necessary to separate the UI and logic to enhance readability and maintainability in the future.

close AUTH-1451

Test Plan and Hands on Testing

  • go to select modules screen OT-2
  • go to select modules screen Flex

Changelog

  • move SelectModules to organisms and remove dropdown menu
  • export AddModuleEmptySelectorButton as a component and add test

Review requests

Risk assessment

low

@koji koji marked this pull request as ready for review February 14, 2025 16:41
@koji koji requested a review from a team as a code owner February 14, 2025 16:41
@koji koji removed the request for review from a team February 14, 2025 16:41
Copy link

codecov bot commented Feb 14, 2025

Codecov Report

Attention: Patch coverage is 58.82353% with 77 lines in your changes missing coverage. Please review.

Project coverage is 18.02%. Comparing base (875346d) to head (abdf845).
Report is 72 commits behind head on edge.

Files with missing lines Patch % Lines
...col-designer/src/organisms/SelectModules/index.tsx 50.64% 77 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             edge   #17531      +/-   ##
==========================================
- Coverage   26.17%   18.02%   -8.16%     
==========================================
  Files        3191     3090     -101     
  Lines      230174   222921    -7253     
  Branches     9814     7005    -2809     
==========================================
- Hits        60251    40178   -20073     
- Misses     169898   182743   +12845     
+ Partials       25        0      -25     
Flag Coverage Δ
app ?
labware-library ?
opentrons-ai-client ?
protocol-designer 18.02% <58.82%> (+0.59%) ⬆️
shared-data ?
step-generation ?

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

Files with missing lines Coverage Δ
...sms/SelectModules/AddModuleEmptySelectorButton.tsx 100.00% <100.00%> (ø)
...signer/src/pages/CreateNewProtocolWizard/index.tsx 0.00% <ø> (ø)
...col-designer/src/organisms/SelectModules/index.tsx 50.64% <50.64%> (ø)

... and 593 files with indirect coverage changes

Copy link
Collaborator

@ncdiehl11 ncdiehl11 left a comment

Choose a reason for hiding this comment

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

nice

@koji koji changed the base branch from edge to chore_release-pd-8.4.1 February 14, 2025 18:36
Comment on lines 119 to 122
const numSlotsAvailable = getNumSlotsAvailable(
modules,
additionalEquipment,
moduleModel
Copy link
Collaborator

Choose a reason for hiding this comment

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

with this change, doesn't that mean we can simplify getNumSlotsAvailable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i still don't touch that part since the ticket only mentions to modules. i added my question to weekly meeting.
once i get an answer i will update getNumSlotsAvailable.

Copy link
Collaborator

@jerader jerader left a comment

Choose a reason for hiding this comment

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

it works but i think there is additional cleanup to be done:

  1. getNumSlotsAvailable can be simplified since we won't need to account for MoaM logic for modules anymore
  2. the createModuleWithNoSlot thunk used in CreateNewProtocolWizard is never called anymore since the modules will always have an assigned slot associated with them. So i recommend deleting that thunk

@koji koji merged commit f8dfa37 into chore_release-pd-8.4.1 Feb 19, 2025
14 checks passed
@koji koji deleted the fix_remove-dropdown-from-modules branch February 19, 2025 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants