Skip to content

Commit

Permalink
Merge branch 'edge' into stacker_evt-script-test-axes
Browse files Browse the repository at this point in the history
  • Loading branch information
ahiuchingau authored Nov 20, 2024
2 parents 175d100 + 54a4017 commit 2a73c37
Show file tree
Hide file tree
Showing 23 changed files with 838 additions and 149 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function ListButtonAccordionContainer(
const { id, children } = props

return (
<Flex key={id} flexDirection={DIRECTION_COLUMN}>
<Flex key={id} flexDirection={DIRECTION_COLUMN} width="100%">
{children}
</Flex>
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"adapter_compatible_lab": "Adapter compatible labware",
"adapter": "Adapter",
"adapter": "Adapters",
"add_fixture": "Add a fixture",
"add_hardware_labware": "Add hardware/labware",
"add_hw_lw": "Add hardware/labware",
Expand All @@ -9,7 +9,7 @@
"add_module": "Add a module",
"add_rest": "Add labware and liquids to complete deck setup",
"alter_pause": "You may also need to alter the time you pause while your magnet is engaged.",
"aluminumBlock": "Aluminum block",
"aluminumBlock": "Aluminum blocks",
"clear_labware": "Clear labware",
"clear_slot": "Clear slot",
"clear": "Clear",
Expand Down Expand Up @@ -47,16 +47,16 @@
"protocol_starting_deck": "Protocol starting deck",
"read_more_gen1_gen2": "Read more about the differences between GEN1 and GEN2 Magnetic Modules",
"rename_lab": "Rename labware",
"reservoir": "Reservoir",
"reservoir": "Reservoirs",
"shift_click_to_select_all": "Shift + Click to select all",
"starting_deck_state": "Starting deck state",
"tc_slots_occupied_flex": "The Thermocycler needs slots A1 and B1. Slot A1 is occupied",
"tc_slots_occupied_ot2": "The Thermocycler needs slots 7, 8, 10, and 11. One or more of those slots is occupied",
"tipRack": "Tip rack",
"tipRack": "Tip racks",
"trash_required": "A trash bin or waste chute is required",
"tubeRack": "Tube rack",
"tubeRack": "Tube racks",
"untitled_protocol": "Untitled protocol",
"upload_custom_labware": "Upload custom labware",
"we_added_hardware": "We've added your deck hardware!",
"wellPlate": "Well plate"
"wellPlate": "Well plates"
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ interface PDListItemCustomizeProps {
label?: string
dropdown?: DropdownMenuProps
tag?: TagProps
forceDirection?: boolean
}

export function PDListItemCustomize({
Expand All @@ -38,7 +37,6 @@ export function PDListItemCustomize({
label,
dropdown,
tag,
forceDirection = false,
}: PDListItemCustomizeProps): JSX.Element {
const responsiveType = useResponsiveBreakpoints()
const isLargeScreen = responsiveType === 'xl' || responsiveType === 'lg'
Expand All @@ -53,7 +51,7 @@ export function PDListItemCustomize({
)}
{dropdown != null && (
<Flex paddingBottom={SPACING.spacing8}>
<DropdownMenu {...dropdown} forceDirection={forceDirection} />
<DropdownMenu {...dropdown} menuPlacement="bottom" />
</Flex>
)}
{tag != null && <Tag {...tag} />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ export function SelectFixtures(props: WizardTileProps): JSX.Element | null {
return (
<ListItem type="noActive" key={ae}>
<ListItemCustomize
menuPlacement="bottom"
linkText={t('remove')}
onClick={() => {
setValue(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ export function SelectModules(props: WizardTileProps): JSX.Element | null {
return (
<ListItem type="noActive" key={`${module.model}`}>
<ListItemCustomize
menuPlacement="bottom"
dropdown={
MOAM_MODULE_TYPES.includes(module.type) &&
robotType === FLEX_ROBOT_TYPE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ export function DeckSetupDetails(props: DeckSetupDetailsProps): JSX.Element {
}
const isLabwareOccludedByThermocyclerLid =
moduleOnDeck.type === THERMOCYCLER_MODULE_TYPE &&
(moduleOnDeck.moduleState as ThermocyclerModuleState).lidOpen !== true
(moduleOnDeck.moduleState as ThermocyclerModuleState).lidOpen !==
true &&
tab === 'protocolSteps'

const tempInnerProps = getModuleInnerProps(moduleOnDeck.moduleState)
const innerProps =
Expand Down
55 changes: 51 additions & 4 deletions protocol-designer/src/pages/Designer/DeckSetup/DeckSetupTools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ import { getDismissedHints } from '../../../tutorial/selectors'
import { createContainerAboveModule } from '../../../step-forms/actions/thunks'
import { ConfirmDeleteStagingAreaModal } from '../../../organisms'
import { BUTTON_LINK_STYLE } from '../../../atoms'
import { FIXTURES, MOAM_MODELS } from './constants'
import { getSlotInformation } from '../utils'
import { getModuleModelsBySlot, getDeckErrors } from './utils'
import { MagnetModuleChangeContent } from './MagnetModuleChangeContent'
import { ALL_ORDERED_CATEGORIES, FIXTURES, MOAM_MODELS } from './constants'
import { LabwareTools } from './LabwareTools'
import { MagnetModuleChangeContent } from './MagnetModuleChangeContent'
import { getModuleModelsBySlot, getDeckErrors } from './utils'

import type { ModuleModel } from '@opentrons/shared-data'
import type { ThunkDispatch } from '../../../types'
Expand All @@ -71,6 +71,8 @@ interface DeckSetupToolsProps {
} | null
}

export type CategoryExpand = Record<string, boolean>

export function DeckSetupTools(props: DeckSetupToolsProps): JSX.Element | null {
const { onCloseClick, setHoveredLabware, onDeckProps } = props
const { t, i18n } = useTranslation(['starting_deck_state', 'shared'])
Expand Down Expand Up @@ -117,13 +119,41 @@ export function DeckSetupTools(props: DeckSetupToolsProps): JSX.Element | null {
const [tab, setTab] = useState<'hardware' | 'labware'>(
moduleModels?.length === 0 || slot === 'offDeck' ? 'labware' : 'hardware'
)

const setAllCategories = (state: boolean): Record<string, boolean> =>
ALL_ORDERED_CATEGORIES.reduce<Record<string, boolean>>(
(acc, category) => ({ ...acc, [category]: state }),
{}
)
const allCategoriesExpanded = setAllCategories(true)
const allCategoriesCollapsed = setAllCategories(false)
const [
areCategoriesExpanded,
setAreCategoriesExpanded,
] = useState<CategoryExpand>(allCategoriesCollapsed)
const [searchTerm, setSearchTerm] = useState<string>('')

useEffect(() => {
if (searchTerm !== '') {
setAreCategoriesExpanded(allCategoriesExpanded)
} else {
setAreCategoriesExpanded(allCategoriesCollapsed)
}
}, [searchTerm])

const hasMagneticModule = Object.values(deckSetup.modules).some(
module => module.type === MAGNETIC_MODULE_TYPE
)
const moduleOnSlotIsMagneticModuleV1 =
Object.values(deckSetup.modules).find(module => module.slot === slot)
?.model === MAGNETIC_MODULE_V1

const handleCollapseAllCategories = (): void => {
setAreCategoriesExpanded(allCategoriesCollapsed)
}
const handleResetSearchTerm = (): void => {
setSearchTerm('')
}
const changeModuleWarning = useBlockingHint({
hintKey: 'change_magnet_module_model',
handleCancel: () => {
Expand Down Expand Up @@ -207,6 +237,11 @@ export function DeckSetupTools(props: DeckSetupToolsProps): JSX.Element | null {
)
}

const handleResetLabwareTools = (): void => {
handleCollapseAllCategories()
handleResetSearchTerm()
}

const handleClear = (): void => {
onDeckProps?.setHoveredModule(null)
onDeckProps?.setHoveredFixture(null)
Expand Down Expand Up @@ -242,7 +277,11 @@ export function DeckSetupTools(props: DeckSetupToolsProps): JSX.Element | null {
}
}
handleResetToolbox()
handleResetLabwareTools()
setSelectedHardware(null)
if (selectedHardware != null) {
setTab('hardware')
}
}
const handleConfirm = (): void => {
// clear entities first before recreating them
Expand Down Expand Up @@ -548,7 +587,15 @@ export function DeckSetupTools(props: DeckSetupToolsProps): JSX.Element | null {
)}
</Flex>
) : (
<LabwareTools setHoveredLabware={setHoveredLabware} slot={slot} />
<LabwareTools
setHoveredLabware={setHoveredLabware}
slot={slot}
searchTerm={searchTerm}
setSearchTerm={setSearchTerm}
areCategoriesExpanded={areCategoriesExpanded}
setAreCategoriesExpanded={setAreCategoriesExpanded}
handleReset={handleResetLabwareTools}
/>
)}
</Flex>
</Toolbox>
Expand Down
Loading

0 comments on commit 2a73c37

Please sign in to comment.