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(protocol-designer): createFileWizard now accommodates MoaM for F… #14818

Merged
merged 4 commits into from
Apr 8, 2024

Conversation

jerader
Copy link
Collaborator

@jerader jerader commented Apr 5, 2024

…lex temp

closes AUTH-15

Overview

Create file wizard now allows for multiple modules! The deck map is wired up but nothing else is wired up. There are no designs for this so I brainstormed with Nick a bit on ideas and messed around with existing components and came up with the following:

Screen.Recording.2024-04-05.at.13.48.55.mov

Test Plan

Enable the MoaM feature flag!

Create a flex protocol and mess around with adding/removing modules and staging area slots. Make sure things are disabled if there is no room on the deck.

The total amount of temperature modules should be 7 if there is nothing else on the deck. The up arrow should be disabled with a tooltip if there is no more space. The down arrow should be disabled if there are no temperature modules to get rid of.

I thoroughly tested this already and added a bunch of test coverage so hopefully it should work as expected but please call out anything that doesn't work!

Changelog

  • modify EquipmentOptions and test to take into account having multiples
  • modify ModulesAndOtherTile to take into account having multiples
  • make a bunch of utils and edit existing ones to keep track of when things are disabled
  • add test coverage

Review requests

see test plan

Risk assessment

low

Comment on lines +154 to +159
let removeSlotForTrash = MODULES_SLOTS_FLEX
if (trashBin != null && hasTC) {
removeSlotForTrash = MODULES_SLOTS_FLEX.slice(0, -2)
} else if (trashBin != null && !hasTC) {
removeSlotForTrash = MODULES_SLOTS_FLEX.slice(0, -1)
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is tricky because the way the logic works rn, the trash bin gets assigned in the parent component (CreateFileWizard) which is down stream from when this util is called. Perhaps i need to add trashBin to its own field (not in additionalEquipment) to assign it a slot earlier.

I want to keep what i have though because that is a big refactor. if its giving us troubles, i'll have to refactor.

@jerader jerader marked this pull request as ready for review April 5, 2024 18:30
@jerader jerader requested a review from a team as a code owner April 5, 2024 18:30
@jerader jerader requested review from koji and ncdiehl11 and removed request for a team April 5, 2024 18:31
numMultiples === 7
? undefined
: () => {
multiples.setValue(numMultiples + 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
multiples.setValue(numMultiples + 1)
multiples.setValue(prevNumMultiples => prevNumMultiples + 1)

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.

the sandbox worked as expected.
This new feature is really nice!

@jerader jerader merged commit 49ab661 into edge Apr 8, 2024
13 of 14 checks passed
@jerader jerader deleted the pd_create-file-wizard-for-moam branch April 8, 2024 14:19
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.

2 participants